All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: Aleksei Kovura <alex3kov@zoho.com>,
	Michael Tokarev <mjt@tls.msk.ru>,
	"Richard W.M. Jones" <rjones@redhat.com>,
	qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/4] pc: set the OEM fields in the RSDT and the FADT from the SLIC
Date: Thu, 14 Jan 2016 12:24:20 +0200	[thread overview]
Message-ID: <20160114122153-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <1452735417-5461-5-git-send-email-lersek@redhat.com>

On Thu, Jan 14, 2016 at 02:36:57AM +0100, Laszlo Ersek wrote:
> The Microsoft spec about the SLIC and MSDM ACPI tables at
> <http://go.microsoft.com/fwlink/p/?LinkId=234834> requires the OEM ID and
> OEM Table ID fields to be consistent between the SLIC and the RSDT/XSDT.
> That further affects the FADT, because a similar match between the FADT
> and the RSDT/XSDT is required by the ACPI spec in general.
> 
> The stashed SLIC OEM identifiers can be ignored with the new
> 
>   -machine heed-slic-oem=no
> 
> option.

I'd prefer "use-slic-oem".

But do we really expect people to use this?
Less knobs would be better ...

> Cc: "Michael S. Tsirkin" <mst@redhat.com> (supporter:ACPI/SMBIOS)
> Cc: Igor Mammedov <imammedo@redhat.com> (supporter:ACPI/SMBIOS)
> Cc: Paolo Bonzini <pbonzini@redhat.com> (maintainer:X86)
> Cc: Richard W.M. Jones <rjones@redhat.com>
> Cc: Aleksei Kovura <alex3kov@zoho.com>
> Cc: Michael Tokarev <mjt@tls.msk.ru>
> RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  include/hw/i386/pc.h |  2 ++
>  hw/i386/acpi-build.c | 22 ++++++++++++++++++----
>  hw/i386/pc.c         | 19 +++++++++++++++++++
>  qemu-options.hx      | 10 +++++++++-
>  4 files changed, 48 insertions(+), 5 deletions(-)
> 
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 588a33c..a762c29 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -56,6 +56,7 @@ struct PCMachineState {
>      OnOffAuto vmport;
>      OnOffAuto smm;
>      bool nvdimm;
> +    bool heed_slic_oem;
>  
>      /* RAM information (sizes, addresses, configuration): */
>      ram_addr_t below_4g_mem_size, above_4g_mem_size;
> @@ -67,6 +68,7 @@ struct PCMachineState {
>  #define PC_MACHINE_VMPORT           "vmport"
>  #define PC_MACHINE_SMM              "smm"
>  #define PC_MACHINE_NVDIMM           "nvdimm"
> +#define PC_MACHINE_HEED_SLIC_OEM    "heed-slic-oem"
>  
>  /**
>   * PCMachineClass:
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 6408362..cf2aafc 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -337,7 +337,8 @@ static void fadt_setup(AcpiFadtDescriptorRev1 *fadt, AcpiPmInfo *pm)
>  /* FADT */
>  static void
>  build_fadt(GArray *table_data, GArray *linker, AcpiPmInfo *pm,
> -           unsigned facs, unsigned dsdt)
> +           unsigned facs, unsigned dsdt,
> +           const char *oem_id, const char *oem_table_id)
>  {
>      AcpiFadtDescriptorRev1 *fadt = acpi_data_push(table_data, sizeof(*fadt));
>  
> @@ -358,7 +359,7 @@ build_fadt(GArray *table_data, GArray *linker, AcpiPmInfo *pm,
>      fadt_setup(fadt, pm);
>  
>      build_header(linker, table_data,
> -                 (void *)fadt, "FACP", sizeof(*fadt), 1, NULL, NULL);
> +                 (void *)fadt, "FACP", sizeof(*fadt), 1, oem_id, oem_table_id);
>  }
>  
>  static void
> @@ -2621,6 +2622,17 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
>      uint8_t *u;
>      size_t aml_len = 0;
>      GArray *tables_blob = tables->table_data;
> +    char *slic_oem_id = NULL;
> +    char *slic_oem_table_id = NULL;
> +    PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
> +    bool heed_slic_oem = object_property_get_bool(OBJECT(pcms),
> +                                                  PC_MACHINE_HEED_SLIC_OEM,
> +                                                  &error_abort);
> +
> +    if (heed_slic_oem) {
> +        slic_oem_id = acpi_slic_oem_id;
> +        slic_oem_table_id = acpi_slic_oem_table_id;
> +    }
>  
>      acpi_get_cpu_info(&cpu);
>      acpi_get_pm_info(&pm);
> @@ -2654,7 +2666,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
>  
>      /* ACPI tables pointed to by RSDT */
>      acpi_add_table(table_offsets, tables_blob);
> -    build_fadt(tables_blob, tables->linker, &pm, facs, dsdt);
> +    build_fadt(tables_blob, tables->linker, &pm, facs, dsdt,
> +               slic_oem_id, slic_oem_table_id);
>  
>      ssdt = tables_blob->len;
>      acpi_add_table(table_offsets, tables_blob);
> @@ -2705,7 +2718,8 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
>  
>      /* RSDT is pointed to by RSDP */
>      rsdt = tables_blob->len;
> -    build_rsdt(tables_blob, tables->linker, table_offsets, NULL, NULL);
> +    build_rsdt(tables_blob, tables->linker, table_offsets,
> +               slic_oem_id, slic_oem_table_id);
>  
>      /* RSDP is in FSEG memory, so allocate it separately */
>      build_rsdp(tables->rsdp, tables->linker, rsdt);
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index c36b8cf..3e7a72a 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1887,6 +1887,20 @@ static void pc_machine_set_nvdimm(Object *obj, bool value, Error **errp)
>      pcms->nvdimm = value;
>  }
>  
> +static bool pc_machine_get_heed_slic_oem(Object *obj, Error **errp)
> +{
> +    PCMachineState *pcms = PC_MACHINE(obj);
> +
> +    return pcms->heed_slic_oem;
> +}
> +
> +static void pc_machine_set_heed_slic_oem(Object *obj, bool value, Error **errp)
> +{
> +    PCMachineState *pcms = PC_MACHINE(obj);
> +
> +    pcms->heed_slic_oem = value;
> +}
> +
>  static void pc_machine_initfn(Object *obj)
>  {
>      PCMachineState *pcms = PC_MACHINE(obj);
> @@ -1926,6 +1940,11 @@ static void pc_machine_initfn(Object *obj)
>      pcms->nvdimm = false;
>      object_property_add_bool(obj, PC_MACHINE_NVDIMM, pc_machine_get_nvdimm,
>                               pc_machine_set_nvdimm, &error_abort);
> +
> +    pcms->heed_slic_oem = true;
> +    object_property_add_bool(obj, PC_MACHINE_HEED_SLIC_OEM,
> +                             pc_machine_get_heed_slic_oem,
> +                             pc_machine_set_heed_slic_oem, &error_abort);
>  }
>  
>  static void pc_machine_reset(void)
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 215d00d..e49964c 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -43,7 +43,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
>      "                aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
>      "                dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
>      "                suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
> -    "                nvdimm=on|off controls NVDIMM support (default=off)\n",
> +    "                nvdimm=on|off controls NVDIMM support (default=off)\n"
> +    "                heed_slic_oem=on|off adapts RSDT and FADT OEM identifiers to external SLIC (default=on)\n",
>      QEMU_ARCH_ALL)
>  STEXI
>  @item -machine [type=]@var{name}[,prop=@var{value}[,...]]
> @@ -84,6 +85,13 @@ controls whether DEA wrapping keys will be created to allow
>  execution of DEA cryptographic functions.  The default is on.
>  @item nvdimm=on|off
>  Enables or disables NVDIMM support. The default is off.
> +@item heed_slic_oem=on|off
> +If the user provides an external SLIC ACPI table with the -acpitable option,
> +then heed_slic_oem=on will adapt the OEM ID and OEM Table ID fields of the
> +auto-generated RSDT and FADT tables to the same fields in the external SLIC.
> +When heed_slic_oem is turned off, the RSDT and FADT tables will have general,
> +QEMU-branded OEM ID and OEM Table ID values. The default is on. heed_slic_oem
> +makes no difference if no SLIC table is provided by the user.
>  @end table
>  ETEXI
>  
> -- 
> 1.8.3.1

  reply	other threads:[~2016-01-14 10:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14  1:36 [Qemu-devel] [PATCH 0/4] set the OEM fields in the RSDT and the FADT from the SLIC Laszlo Ersek
2016-01-14  1:36 ` [Qemu-devel] [PATCH 1/4] acpi: take oem_id in build_header(), optionally Laszlo Ersek
2016-01-14  1:36 ` [Qemu-devel] [PATCH 2/4] acpi: expose oem_id and oem_table_id in build_rsdt() Laszlo Ersek
2016-01-14  1:36 ` [Qemu-devel] [PATCH 3/4] acpi: stash the OEM ID and OEM Table ID fields from an external SLIC table Laszlo Ersek
2016-01-14 10:21   ` Michael S. Tsirkin
2016-01-14 16:38     ` Laszlo Ersek
2016-01-14  1:36 ` [Qemu-devel] [PATCH 4/4] pc: set the OEM fields in the RSDT and the FADT from the SLIC Laszlo Ersek
2016-01-14 10:24   ` Michael S. Tsirkin [this message]
2016-01-14 16:44     ` Laszlo Ersek
2016-01-14 17:09       ` Laszlo Ersek
2016-01-14 10:03 ` [Qemu-devel] [PATCH 0/4] " Richard W.M. Jones
2016-01-14 10:06   ` Alex
2016-01-14 10:23     ` Richard W.M. Jones
2016-01-14 16:35       ` Laszlo Ersek
2016-01-15 16:07         ` Richard W.M. Jones
2016-01-15 16:13           ` Alex
2016-01-21 11:37         ` Richard W.M. Jones
2016-01-21 11:42           ` Michael Tokarev
2016-01-21 11:44             ` Richard W.M. Jones
2016-01-21 11:55             ` Laszlo Ersek

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=20160114122153-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=alex3kov@zoho.com \
    --cc=imammedo@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.