Skip to content

nvme/util: support multi-page prplists in PRP#53

Merged
minwooim merged 1 commit into
SamsungDS:mainfrom
minwooim:mdts
Mar 18, 2026
Merged

nvme/util: support multi-page prplists in PRP#53
minwooim merged 1 commit into
SamsungDS:mainfrom
minwooim:mdts

Conversation

@minwooim
Copy link
Copy Markdown
Collaborator

Support multiple pages of prplist in building PRP lists.

@minwooim minwooim merged commit 6763e31 into SamsungDS:main Mar 18, 2026
6 of 8 checks passed
Support multiple pages of prplist in building PRP lists.

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
Comment thread src/nvme/util.c
uint64_t next_iova = __prplist_iova + pagesize;
__prplist[pos] = cpu_to_le64(next_iova);

__prplist = (leint64_t *)((char *)__prplist + pagesize);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is essentially a memory overrun.

__prplist is a pointer to a 4KB chunk of memory that is a subset of memory allocated in __nvme_configure_sq(). This change overruns the memory assigned to this request and tramples over the memory in the next request; or in the case of the last request it may run passed the iommu mapping and fail.

It also breaks the test in rq_test which is expecting a limit enforcing max_prps.

I recommend reverting this commit. A more correct solution would require allocating another buffer, creating an ephemeral mapping and tearing that all down when the request is complete.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, let me revert it back first and make some fixes on this. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants