qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Default NVMe MDTS value causes Widnows Server 2025 hangs and BSODs (during install at least)
@ 2025-11-28 10:28 Roger Pau Monné
  2025-11-28 16:46 ` Keith Busch
  0 siblings, 1 reply; 2+ messages in thread
From: Roger Pau Monné @ 2025-11-28 10:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter.Turner, ngoc-tu.dinh, Keith Busch, Klaus Jensen,
	Jesper Devantier, xen-devel

Hello,

As part of XenServer Windows Server 2025 testing using Xen plus QEMU
we discovered an issue during install that would lead to either the
Windows installer getting stuck without making progress (albeit the
screen was still showing the spinning circle correctly) or a BSOD that
doesn't seem to have a unique number, the most common one was 0x50
(PAGE_FAULT_IN_NONPAGED_AREA).

After a fair amount of debugging and following incorrect leads we have
narrowed down what triggers the issue to QEMU emulated NVMe reporting
a MDTS value of 7 by default (so max request size of 512KiB).
Switching to higher MDTS values seemed to solve the issue.

The commit that made that change:

e137d20e7dff hw/block/nvme: add check for mdts

Didn't contain much justification for the change from unlimited to
512KiB max request size.

Windows is like a black box to me, but I believe there's some error in
the Windows logic that splits requests, and hence when MDTS is set to
a sufficiently low value, and Windows has to split NVMe requests, it
causes Windows to hit an internal bug.  This will be raised with
Microsoft to get the issue debugged and possibly fixed on their side.

From limited experimentation setting mdts to 10 (so 4MiB max request
size) or 9 (2MiB) workarounds the issue.

Would it be acceptable for QEMU NVMe to consider increasing the
default MDTS value to something higher than 7 to workaround the issue?
I've tested both 9 and 10 and they prevent the issue, I would avoid 8
as it's too close to the current one that causes issues.  I don't have
many references of other emulated NVMe implementations, I just know
about Bhyve emulated NVMe, which sets MDTS to 9.

If bumping MDTS to a higher value is acceptable please let me know and
I will prepare a patch.

Regards, Roger.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Default NVMe MDTS value causes Widnows Server 2025 hangs and BSODs (during install at least)
  2025-11-28 10:28 Default NVMe MDTS value causes Widnows Server 2025 hangs and BSODs (during install at least) Roger Pau Monné
@ 2025-11-28 16:46 ` Keith Busch
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Busch @ 2025-11-28 16:46 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: qemu-devel, Peter.Turner, ngoc-tu.dinh, Klaus Jensen,
	Jesper Devantier, xen-devel

On Fri, Nov 28, 2025 at 11:28:47AM +0100, Roger Pau Monné wrote:
> Hello,
> 
> As part of XenServer Windows Server 2025 testing using Xen plus QEMU
> we discovered an issue during install that would lead to either the
> Windows installer getting stuck without making progress (albeit the
> screen was still showing the spinning circle correctly) or a BSOD that
> doesn't seem to have a unique number, the most common one was 0x50
> (PAGE_FAULT_IN_NONPAGED_AREA).
> 
> After a fair amount of debugging and following incorrect leads we have
> narrowed down what triggers the issue to QEMU emulated NVMe reporting
> a MDTS value of 7 by default (so max request size of 512KiB).
> Switching to higher MDTS values seemed to solve the issue.
> 
> The commit that made that change:
> 
> e137d20e7dff hw/block/nvme: add check for mdts
> 
> Didn't contain much justification for the change from unlimited to
> 512KiB max request size.
> 
> Windows is like a black box to me, but I believe there's some error in
> the Windows logic that splits requests, and hence when MDTS is set to
> a sufficiently low value, and Windows has to split NVMe requests, it
> causes Windows to hit an internal bug.  This will be raised with
> Microsoft to get the issue debugged and possibly fixed on their side.
> 
> From limited experimentation setting mdts to 10 (so 4MiB max request
> size) or 9 (2MiB) workarounds the issue.
> 
> Would it be acceptable for QEMU NVMe to consider increasing the
> default MDTS value to something higher than 7 to workaround the issue?
> I've tested both 9 and 10 and they prevent the issue, I would avoid 8
> as it's too close to the current one that causes issues.  I don't have
> many references of other emulated NVMe implementations, I just know
> about Bhyve emulated NVMe, which sets MDTS to 9.
> 
> If bumping MDTS to a higher value is acceptable please let me know and
> I will prepare a patch.

The mdts value is a prameter you can set at the command line. The 512k
default is really pretty reasonable, but you can set it up to 2MB
(mdts=9) if you want before hitting a different software limit that
won't let you go any higher. So rather than patch the device, I'd
recommend you just modify your startup command line parameters instead.

Not sure if it's still the case, but there was a time when Windows
Storport's maximum IO size had been limited to 128k, and that's exactly
what many nvme devices reported for MDTS, so Windows is certainly
supposed to work correctly with such values.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-28 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-28 10:28 Default NVMe MDTS value causes Widnows Server 2025 hangs and BSODs (during install at least) Roger Pau Monné
2025-11-28 16:46 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).