[Bug 290249] PRP_OFFET_INVALID on nvme writes

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 17 Oct 2025 03:35:42 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290249

--- Comment #4 from Warner Losh <imp@FreeBSD.org> ---
This almost certainly is a bug in the busdma implementation on riscv, I fear.

You can add checks in ndastart() to make sure that the passed in buffer is 512
or 4096 byte aligned (depending on how your NVME drive is formatted). That
would be the first step to see if the VAs that the filesystem is passing down
the tree is valid. If they are, then you know you'll need to chase this into
the busdma implementation that's doing the mapping. You can also check in
nvme_qpair.c:nvme_single_map to see if the mapped in address is page aligned.
But to print a reliable error message, you'll need to check the call to
bus_dmamap_load in nvme_qpair_construct and look at queuemem_phys after
bus_dmamap_load returns (though this would see if the PRP memory is poorly
mapped, not that the I/O payload is poorly mapped).

And while you're at it, maybe you could do a nvmecontrol identify nvme0 and
attach the output to the bug. There's a small possibility that it's due to
something weird in the identify (but i doubt it: things are supposed to be
power of 2 aligned to the extent that identify only reports the exponent... it
doesn't hurt to make sure).

Hope this helps.

-- 
You are receiving this mail because:
You are the assignee for the bug.