nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	linux-nvdimm <linux-nvdimm@lists.01.org>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/3] nvdimm, acpi: add NFIT platform capabilities
Date: Thu, 10 May 2018 15:39:45 +0200	[thread overview]
Message-ID: <20180510153945.3b90acd1@redhat.com> (raw)
In-Reply-To: <20180427215314.23168-2-ross.zwisler@linux.intel.com>

On Fri, 27 Apr 2018 15:53:13 -0600
Ross Zwisler <ross.zwisler@linux.intel.com> wrote:

> Add support for the NFIT Platform Capabilities Structure, newly added in
> ACPI 6.2 Errata A.

Look fine but I'd squash it into the next 3/3 patch.

> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> ---
>  hw/acpi/nvdimm.c | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
> index 59d6e4254c..859b390e07 100644
> --- a/hw/acpi/nvdimm.c
> +++ b/hw/acpi/nvdimm.c
> @@ -169,6 +169,21 @@ struct NvdimmNfitControlRegion {
>  } QEMU_PACKED;
>  typedef struct NvdimmNfitControlRegion NvdimmNfitControlRegion;
>  
> +/*
> + * NVDIMM Platform Capabilities Structure
> + *
> + * Defined in section 5.2.25.9 of ACPI 6.2 Errata A, September 2017
> + */
> +struct NvdimmNfitPlatformCaps {
> +    uint16_t type;
> +    uint16_t length;
> +    uint8_t highest_cap;
> +    uint8_t reserved[3];
> +    uint32_t capabilities;
> +    uint8_t reserved2[4];
> +} QEMU_PACKED;
> +typedef struct NvdimmNfitPlatformCaps NvdimmNfitPlatformCaps;
> +
>  /*
>   * Module serial number is a unique number for each device. We use the
>   * slot id of NVDIMM device to generate this number so that each device
> @@ -351,6 +366,21 @@ static void nvdimm_build_structure_dcr(GArray *structures, DeviceState *dev)
>                                           JEDEC Annex L Release 3. */);
>  }
>  
> +/*
> + * ACPI 6.2 Errata A: 5.2.25.9 NVDIMM Platform Capabilities Structure
> + */
> +static void
> +nvdimm_build_structure_caps(GArray *structures)
> +{
> +    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 = 1;
> +    nfit_caps->capabilities = cpu_to_le32(2 /* memory controller */);
> +}
>  static GArray *nvdimm_build_device_structure(void)
>  {
>      GSList *device_list = nvdimm_get_device_list();
> @@ -373,6 +403,8 @@ static GArray *nvdimm_build_device_structure(void)
>      }
>      g_slist_free(device_list);
>  
> +    nvdimm_build_structure_caps(structures);
> +
>      return structures;
>  }
>  

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  parent reply	other threads:[~2018-05-10 13:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 21:53 [PATCH 1/3] nvdimm: fix typo in label-size definition Ross Zwisler
2018-04-27 21:53 ` [PATCH 2/3] nvdimm, acpi: add NFIT platform capabilities Ross Zwisler
2018-04-30 11:39   ` Stefan Hajnoczi
2018-05-10 13:39   ` Igor Mammedov [this message]
2018-04-27 21:53 ` [PATCH 3/3] nvdimm: platform capabilities command line option Ross Zwisler
2018-04-30 11:39   ` Stefan Hajnoczi
2018-05-10 13:28   ` [Qemu-devel] " Igor Mammedov
2018-05-15 23:03     ` Ross Zwisler
2018-05-16  7:22       ` Igor Mammedov
2018-04-30 11:38 ` [PATCH 1/3] nvdimm: fix typo in label-size definition Stefan Hajnoczi
2018-05-03 22:20   ` Ross Zwisler
2018-05-04  8:44     ` Stefan Hajnoczi
2018-05-10 13:06 ` [Qemu-devel] " Igor Mammedov

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=20180510153945.3b90acd1@redhat.com \
    --to=imammedo@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ross.zwisler@linux.intel.com \
    --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).