nvme/util: support multi-page prplists in PRP#53
Conversation
Support multiple pages of prplist in building PRP lists. Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
| uint64_t next_iova = __prplist_iova + pagesize; | ||
| __prplist[pos] = cpu_to_le64(next_iova); | ||
|
|
||
| __prplist = (leint64_t *)((char *)__prplist + pagesize); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Indeed, let me revert it back first and make some fixes on this. Thanks
Support multiple pages of prplist in building PRP lists.