Skip to content

nvme: compute number of requested log page words correctly - #1215

Merged
iximeow merged 1 commit into
masterfrom
ixi/fix-log-page-size
Sep 11, 2026
Merged

nvme: compute number of requested log page words correctly#1215
iximeow merged 1 commit into
masterfrom
ixi/fix-log-page-size

Conversation

@iximeow

@iximeow iximeow commented Sep 11, 2026

Copy link
Copy Markdown
Member

(foo & 0xFFF) >> 16 is a rather doomed expression. this fixes the secondary issue I'd noticed in #1213, where log pages seemed to have random data in them from call to call.

the field we're trying to extract here is NUMDL in bits 31:16 of cdw10. basically all the symbols were right, just.. in the wrong order. the consequence here was that we were computing a log page request for 0 (meaning, 1) dword, and filling in the first four bytes of the request with zero. Linux has been requesting 127 (meaning, 128) dwords the entire time, to fill all 512 bytes of defined-and-reserved space in the log page.

I don't know why this goes from being what I observed with garbage data in 22.04, to being zeroed later on. I assume that's a kernel change, since prp1 becomes always-aligned, and I assume that the kernel decides to zero the page to guard against misbehaving devices like ours that don't write all the bits they're supposed to!

@iximeow iximeow added bug Something that isn't working. storage Related to storage devices/backends. guest-os Related to compatibility and/or functionality observed by guest software. labels Sep 11, 2026
@iximeow
iximeow merged commit a35415e into master Sep 11, 2026
13 of 14 checks passed
@iximeow
iximeow deleted the ixi/fix-log-page-size branch September 11, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something that isn't working. guest-os Related to compatibility and/or functionality observed by guest software. storage Related to storage devices/backends.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants