qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Dexuan Cui <decui@microsoft.com>
Cc: Haozhong Zhang <haozhong.zhang@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Jeff Moyer <jmoyer@redhat.com>,
	Wei Yang <richardw.yang@linux.intel.com>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	Laszlo Ersek <lersek@redhat.com>,
	"Williams, Dan J" <dan.j.williams@intel.com>
Subject: Re: Microsoft and Intel NVDIMM ACPI _DSM interfaces status?
Date: Thu, 18 Mar 2021 19:30:39 +0000	[thread overview]
Message-ID: <YFOqX3ghd/fggpPR@stefanha-x1.localdomain> (raw)
In-Reply-To: <MW2PR2101MB1756B8A06546D00D9307BA4CBF699@MW2PR2101MB1756.namprd21.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 4362 bytes --]

On Thu, Mar 18, 2021 at 02:00:29AM +0000, Dexuan Cui wrote:
> > From: Laszlo Ersek <lersek@redhat.com>
> > Sent: Wednesday, March 17, 2021 3:45 PM
> > > The specs for the Intel interface are available here:
> > > ...
> > > This is the interface that QEMU emulates. It has been reported that
> > > Windows 2016 Server and 2019 Server guests do not recognize QEMU's
> > > emulated NVDIMM devices using the Microsoft driver.
> 
> I'm not sure why this happens -- sorry, I have no Windows knowledge.
>  
> > > Should QEMU emulate both of them to make running Windows guests easy?
> 
> I'm not sure about the background here, but since it looks like QEMU is already
> able to emulate the Intel NVDIMM, I suppose it should be quick to add the
> emulation of the Hyper-V NVDIMM. I think they're pretty similar, and the
> _DSM interface supported by Hyper-V NVDIMM is simple.
>  
> > In my (uneducated) opinion: yes. Microsoft standarized their Region
> > Format Interface, with their _DSM UUID and all; and right now, that spec
> > seems to be the *only* officially approved format in the RFIC registry.
> > So it's plausible to me that, unlike the Linux kernel, Microsoft's
> > driver doesn't support the -- technically unapproved, nonstandard --
> > Intel Region Format Interface.
> > 
> > Dexuan, please correct me if I'm wrong.
> > 
> > Thanks,
> > Laszlo
> 
> Hi Laszlo, I'm not 100% sure, but I guess your may be correct.
> 
> BTW, earlier in 2019, we made the below patches (which are in the mainline):
> 
> 2019-02-28    libnvdimm/btt: Fix LBA masking during 'free list' population
> 2019-02-12    acpi/nfit: Require opt-in for read-only label configurations
> 2019-02-02    libnvdimm/dimm: Add a no-BLK quirk based on NVDIMM family
> 2019-01-29    nfit: Add Hyper-V NVDIMM DSM command set to white list
> 2019-01-29    nfit: acpi_nfit_ctl(): Check out_obj->type in the right place
> 
> The patches improve the interoperability between Windows VM and 
> Linux VM, e.g. the same Hyper-V NVDIMM device can work this way:
> the Windows VM creates an NTFS partition based on the device, and
> creates a text file in the partition, and later we shut down the Windows VM
> and assign the device to Linux VM, and Linux VM is able to read the text file.
> 
> Before the patches, IIRC, Linux VM could only use the Hyper-V NVIDMM
> device in label-less mode.
> 
> Let me share some old 2019 notes about Hyper-V NVDIMM, in case the
> info may be helpful to you: 
> 
> "
> In Linux VM, IMO the label-less mode is preferred for Hyper-V NVDIMM,
> because Hyper-V does not support _LSW (I'm not sure about the latest
> status), so Dan made the patch "acpi/nfit: Require opt-in for read-only
> label configurations" to not use the Hyper-V label info, by default.
> In label-less mode, when creating a namespace, Linux can set it to
> one of the 4 namespace modes: fsdax, devdax, sector, and raw (these
> namespace modes are Linux-specific and can not be recognized
> by Windows.). 
> 
> With the "nfit.force_labels" bootup-time kernel parameter, Linux can
> be forced to be in label mode, and then if Hyper-V initializes the 4KB
> BTT Info Block(s) with the standard EFI_BTT_ABSTRACTION_GUID
> (which is defined in UEFI 2.7 spec), we're supposed to support the
> "interoperability" between Windows VM and Linux VM.
> 
> Note: label-less mode is incompatible with label mode. A namespace
> created in one mode can't be recognized when Linux runs in the other
> mode. In label mode, so far, only 2 namespace modes (raw and sector)
> can be supported by the Hyper-V NVDIMM, because Hyper-V doesn't
> support _LSW, yet. If Hyper-V sets the EFI_BTT_ABSTRACTION_GUID,
> the namespace is "BTT-capable" and can be in sector namespace
> mode, otherwise it's in raw namespace mode.
> 
> After a Windows VM initializes a BTT-capable namespace in a Hyper-V
> NVDIMM device by creating a NTFS file system in the namespace, we
> can re-assign the Hyper-V NVDIMM device to Linux VM, and in label
> mode Linux VM is supposed to be able to read and write the files in
> the NTFS file system.
> "

Thank you, Laszlo and Dexuan!

I wonder if there are existing Windows drivers available that work with
QEMU's NVDIMM device. Otherwise it may make sense to implement the
Hyper-V interface.

Stefan

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-03-18 19:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 11:49 Microsoft and Intel NVDIMM ACPI _DSM interfaces status? Stefan Hajnoczi
2021-03-17 22:45 ` Laszlo Ersek
2021-03-18  2:00   ` Dexuan Cui
2021-03-18 19:30     ` Stefan Hajnoczi [this message]
2021-03-17 23:52 ` Dan Williams
2021-03-18 19:28   ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YFOqX3ghd/fggpPR@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=decui@microsoft.com \
    --cc=haozhong.zhang@intel.com \
    --cc=jmoyer@redhat.com \
    --cc=lersek@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richardw.yang@linux.intel.com \
    --cc=ross.zwisler@linux.intel.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).