From: Ross Zwisler <ross.zwisler@linux.intel.com>
To: "Elliott, Robert (Persistent Memory)" <elliott@hpe.com>
Cc: 'Ross Zwisler' <ross.zwisler@linux.intel.com>,
Igor Mammedov <imammedo@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Eduardo Habkost <ehabkost@redhat.com>,
linux-nvdimm <linux-nvdimm@lists.01.org>,
"Michael S . Tsirkin" <mst@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [qemu PATCH v2 3/4] nvdimm, acpi: support NFIT platform capabilities
Date: Fri, 18 May 2018 09:23:06 -0600 [thread overview]
Message-ID: <20180518152306.GA3413@linux.intel.com> (raw)
In-Reply-To: <AT5PR8401MB11697DD6A19AA3F499ACDDBAAB910@AT5PR8401MB1169.NAMPRD84.PROD.OUTLOOK.COM>
On Thu, May 17, 2018 at 10:06:37PM +0000, Elliott, Robert (Persistent Memory) wrote:
>
>
> > -----Original Message-----
> > From: Linux-nvdimm [mailto:linux-nvdimm-bounces@lists.01.org] On Behalf Of
> > Ross Zwisler
> > Sent: Thursday, May 17, 2018 12:00 AM
> > Subject: [qemu PATCH v2 3/4] nvdimm, acpi: support NFIT platform
> > capabilities
> >
> > Add a machine command line option to allow the user to control the
> > Platform
> > Capabilities Structure in the virtualized NFIT. This Platform
> > Capabilities
> > Structure was added in ACPI 6.2 Errata A.
> >
> ...
> > +Platform Capabilities
> > +---------------------
> > +
> > +ACPI 6.2 Errata A added support for a new Platform Capabilities Structure
> > +which allows the platform to communicate what features it supports
> > related to
> > +NVDIMM data durability. Users can provide a capabilities value to a
> > guest via
> > +the optional "nvdimm-cap" machine command line option:
> > +
> > + -machine pc,accel=kvm,nvdimm,nvdimm-cap=2
> > +
> > +As of ACPI 6.2 Errata A, the following values are valid for the bottom
> > two
> > +bits:
> > +
> > +2 - Memory Controller Flush to NVDIMM Durability on Power Loss Capable.
> > +3 - CPU Cache Flush to NVDIMM Durability on Power Loss Capable.
>
> It's a bit unclear that those are decimal values for the field, not
> bit numbers.
Hmm..I was trying to be clear by saying "the following values are valid for
the bottom two bits", and having 2 and 3 as the possible values.
Would it help to show them in hex?
As of ACPI 6.2 Errata A, the following values are valid for the bottom two
bits:
0x2 - Memory Controller Flush to NVDIMM Durability on Power Loss Capable.
0x3 - CPU Cache Flush to NVDIMM Durability on Power Loss Capable.
More clearly showing that they are values created by combining bitfields?
> > -static GArray *nvdimm_build_device_structure(void)
> > +/*
> > + * ACPI 6.2 Errata A: 5.2.25.9 NVDIMM Platform Capabilities Structure
> > + */
> > +static void
> > +nvdimm_build_structure_caps(GArray *structures, uint32_t capabilities)
> > +{
> > + NvdimmNfitPlatformCaps *nfit_caps;
> > +
> > + nfit_caps = acpi_data_push(structures, sizeof(*nfit_caps));
> > +
> > + nfit_caps->type = cpu_to_le16(7 /* NVDIMM Platform Capabilities */);
> > + nfit_caps->length = cpu_to_le16(sizeof(*nfit_caps));
> > + nfit_caps->highest_cap = 2;
> > + nfit_caps->capabilities = cpu_to_le32(capabilities);
>
> highest_cap needs to be set to a value that at least covers the highest
> bit set to 1 used in capabilities.
>
> As capabilities bits are added, there are three different meanings:
> * 1: bit within highest_cap range, platform is claiming the 1 meaning
> * 0: bit within highest_cap range, platform is claiming the 0 meaning
> * not reported: bit not within highest_cap range, so the platform's
> implementation of this feature is unknown. Not necessarily the same
> as the 0 meaning.
>
> So, there should be a way to specify a highest_cap value to convey that
> some of the upper capabilities bits are valid and contain 0.
Right, I'll make this dynamic based on the capabilities value passed in by the
user. That's a much better solution, thanks. This should cover all the same
cases as you have outlined above, without burdening the user with yet another
input value.
next prev parent reply other threads:[~2018-05-18 15:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 5:00 [Qemu-devel] [qemu PATCH v2 0/4] support NFIT platform capabilities Ross Zwisler
2018-05-17 5:00 ` [Qemu-devel] [qemu PATCH v2 1/4] nvdimm: fix typo in label-size definition Ross Zwisler
2018-05-17 5:00 ` [Qemu-devel] [qemu PATCH v2 2/4] tests/.gitignore: add entry for generated file Ross Zwisler
2018-05-17 5:00 ` [Qemu-devel] [qemu PATCH v2 3/4] nvdimm, acpi: support NFIT platform capabilities Ross Zwisler
2018-05-17 22:06 ` Elliott, Robert (Persistent Memory)
2018-05-18 15:23 ` Ross Zwisler [this message]
2018-05-18 16:37 ` Elliott, Robert (Persistent Memory)
2018-05-18 19:31 ` Ross Zwisler
2018-05-21 15:54 ` Ross Zwisler
2018-05-17 5:00 ` [Qemu-devel] [qemu PATCH v2 4/4] ACPI testing: test " Ross Zwisler
2018-05-17 5:08 ` [Qemu-devel] [qemu PATCH v2 0/4] support " no-reply
2018-05-17 15:32 ` [Qemu-devel] [qemu PATCH v3 3/4] nvdimm, acpi: " Ross Zwisler
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=20180518152306.GA3413@linux.intel.com \
--to=ross.zwisler@linux.intel.com \
--cc=ehabkost@redhat.com \
--cc=elliott@hpe.com \
--cc=imammedo@redhat.com \
--cc=linux-nvdimm@lists.01.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).