qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Haozhong Zhang <haozhong.zhang@intel.com>
To: Xiao Guangrong <guangrong.xiao@gmail.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [Qemu-devel] [PATCH] nvdimm acpi: fix region format interface code
Date: Thu, 8 Jun 2017 13:06:40 +0800	[thread overview]
Message-ID: <20170608050640.ov5wtygx737ory6z@hz-desktop> (raw)
In-Reply-To: <011f1bfe-f882-d940-52eb-7b5d511f9ffc@gmail.com>

On 06/08/17 11:07 +0800, Xiao Guangrong wrote:
> 
> 
> On 06/07/2017 04:06 PM, Haozhong Zhang wrote:
> > Per ACPI 6.2, section 5.2.25.6 and JEDEC Annex L Release 3, the
> > current region format interface code 0x201 indicates the block
> > addressed function interface 1, rather than a byte addressable
> > interface. Fix it by using 0x301 which indicates the byte addressable
> > no energy backed function interface 1.
> > 
> > Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
> > ---
> >   hw/acpi/nvdimm.c | 7 ++++---
> >   1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
> > index 8e7d6ec034..b5734f5897 100644
> > --- a/hw/acpi/nvdimm.c
> > +++ b/hw/acpi/nvdimm.c
> > @@ -338,9 +338,10 @@ static void nvdimm_build_structure_dcr(GArray *structures, DeviceState *dev)
> >       nfit_dcr->revision_id = cpu_to_le16(1 /* Current Revision supported
> >                                                in ACPI 6.0 is 1. */);
> >       nfit_dcr->serial_number = cpu_to_le32(sn);
> > -    nfit_dcr->fic = cpu_to_le16(0x201 /* Format Interface Code. See Chapter
> > -                                         2: NVDIMM Device Specific Method
> > -                                         (DSM) in DSM Spec Rev1.*/);
> > +    nfit_dcr->fic = cpu_to_le16(0x301 /* Format Interface Code:
> > +                                         Byte addressable, no energy backed.
> > +                                         See ACPI 6.2, sect 5.2.25.6 and
> > +                                         JEDEC Annex L Release 3. */);
> 
> Shouldn't the 'no energy backend' indicator be set only for !dax disk?

Above specs define RFIC for two classes of byte-addressable NVDIMM:
1. 0x10[0|1]: A function containing byte addressable persistent memory
              whose persistence is achieved through the use of DRAM,
              nonvolatile memory (e.g., Flash) and an energy source.
	      Only the DRAM portion is addressable by the system.
2. 0x30[0|1]: A function containing byte addressable persistent
              memory. All of the persistent memory is addressable by
              the system. No external energy source is required.
If the last bit is 0, then it's a proprietary interface.

The external backed energy is a mechanism that implements the
persistence for the first class, and it's not required for the
second class.

The key point in this patch is RFIC provided by QEMU should indicate a
*byte addressable* NVDIMM. Whether it's backed by the external energy
does not matter much here, so I think it's free to choose one of them.

Haozhong

  reply	other threads:[~2017-06-08  5:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07  8:06 [Qemu-devel] [PATCH] nvdimm acpi: fix region format interface code Haozhong Zhang
2017-06-07 15:32 ` Stefan Hajnoczi
2017-06-08  3:07 ` Xiao Guangrong
2017-06-08  5:06   ` Haozhong Zhang [this message]
2017-06-08  6:40     ` Xiao Guangrong
2017-06-08  6:50       ` Haozhong Zhang
2017-06-08  7:57         ` Dan Williams

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=20170608050640.ov5wtygx737ory6z@hz-desktop \
    --to=haozhong.zhang@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=guangrong.xiao@gmail.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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).