[PATCH 0/1]

Alexander Sowarka alexander.sowarka at gmail.com
Sun Aug 28 21:30:19 CEST 2022


I was trying to read files from a Samsung MZ-VLB1T0B NVME device,
that was formatted with an ext4 filesystem. But I observed some
memory corruptions for the loaded file in u-boot. Closer investigation
revealed that the u-boot nvme driver can't handle large IO-operations
that are not aligned with the 4KB pages of the NVME device. In detail the
nvme driver would split the read operation into 2MB chunks. Due to the
misalignment 513 prp-entries are needed for  reading one such 2MB chunk.
The driver split the read into 1 entry for prp1 and a prp-list containing
512 entries for prp2. The issue is now that the driver splitted this list
across 2 pages (first page with 511 entries and pointer to the second page,
second page containing a single entry). This split violated the nvme-spec
(as all 512 entries of the list would fit on a single page) and caused
the observed memory corruption. The provided patch fixes the issue. END



Alexander Sowarka (1):
  nvme: Fix multipage prp-list

 drivers/nvme/nvme.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.37.1



More information about the U-Boot mailing list