set the OEM fields in the RSDT and the FADT from the SLIC
v2 cover set the OEM fields in the RSDT and the FADT from the SLIC
This is version 2 of
<http://thread.gmane.org/gmane.comp.emulators.qemu/386728>.
Changes in v2 (also annotated per patch):
- introduce acpi_get_slic_oem() [MST],
- drop machine property that disables the SLIC-based override [MST].
Thanks
Laszlo
Laszlo Ersek (4):
acpi: take oem_id in build_header(), optionally
acpi: expose oem_id and oem_table_id in build_rsdt()
acpi: add function to extract oem_id and oem_table_id from the user's
SLIC
pc: set the OEM fields in the RSDT and the FADT from the SLIC
include/hw/acpi/acpi.h | 7 +++++++ include/hw/acpi/aml-build.h | 5 +++-- hw/acpi/aml-build.c | 14 ++++++++++---- hw/acpi/core.c | 16 ++++++++++++++++ hw/acpi/nvdimm.c | 4 ++-- hw/arm/virt-acpi-build.c | 14 +++++++------- hw/i386/acpi-build.c | 31 ++++++++++++++++++------------- qemu-options.hx | 4 ++++ 8 files changed, 67 insertions(+), 28 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v2 1/4 acpi: take oem_id in build_header(), optionally
This patch is the continuation of commit 8870ca0e94f2 ("acpi: support specified oem table id for build_header"). It will allow us to control the OEM ID field too in the SDT header.
Cc: "Michael S. Tsirkin" <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Igor Mammedov <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Xiao Guangrong <[email protected]> (maintainer:NVDIMM)
Cc: Shannon Zhao <[email protected]> (maintainer:ARM ACPI Subsystem)
Cc: Paolo Bonzini <[email protected]> (maintainer:X86)
Cc: Richard W.M. Jones <[email protected]>
Cc: Aleksei Kovura <[email protected]>
Cc: Michael Tokarev <[email protected]>
Cc: Steven Newbury <[email protected]>
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
LP: https://bugs.launchpad.net/qemu/+bug/1533848
---
Notes:
v2:
- no change
include/hw/acpi/aml-build.h | 2 +- hw/acpi/aml-build.c | 11 ++++++++--- hw/acpi/nvdimm.c | 4 ++-- hw/arm/virt-acpi-build.c | 12 ++++++------ hw/i386/acpi-build.c | 20 ++++++++++---------- 5 files changed, 27 insertions(+), 22 deletions(-)
include/hw/acpi/aml-build.h +1 -1
@@ -357,7 +357,7 @@ Aml *aml_sizeof(Aml *arg);void build_header (GArray *linker,GArray *table_data,AcpiTableHeader *h,const char *sig,int len,uint8_t rev, -const char *oem_table_id); +const char *oem_id,const char *oem_table_id);void *acpi_data_push (GArray *table_data,unsigned size);unsigned acpi_data_len (GArray *table);void acpi_add_table (GArray *table_offsets,GArray *table_data);
hw/acpi/aml-build.c +8 -3
@@ -1430,12 +1430,17 @@ Aml *aml_alias(const char *source_object, const char *alias_object)void build_header (GArray *linker,GArray *table_data,AcpiTableHeader *h,const char *sig,int len,uint8_t rev, -const char *oem_table_id) +const char *oem_id,const char *oem_table_id) {memcpy (&h->signature, sig,4 ); h->length =cpu_to_le32 (len); h->revision = rev; -memcpy (h->oem_id,ACPI_BUILD_APPNAME6 ,6 ); + +if (oem_id) { +strncpy ((char *)h->oem_id, oem_id,sizeof h->oem_id); + }else { +memcpy (h->oem_id,ACPI_BUILD_APPNAME6 ,6 ); + }if (oem_table_id) {strncpy ((char *)h->oem_table_id, oem_table_id,sizeof (h->oem_table_id));
@@ -1510,5 +1515,5 @@ build_rsdt(GArray *table_data, GArray *linker, GArray *table_offsets) sizeof(uint32_t)); }build_header (linker, table_data, - (void *)rsdt,"RSDT" , rsdt_len,1 ,NULL ); + (void *)rsdt,"RSDT" , rsdt_len,1 ,NULL ,NULL ); }
hw/acpi/nvdimm.c +2 -2
@@ -365,7 +365,7 @@ static void nvdimm_build_nfit(GSList *device_list, GArray *table_offsets,build_header (linker, table_data, (void *)(table_data->data + header),"NFIT" , -sizeof (NvdimmNfitHeader) + structures->len,1 ,NULL ); +sizeof (NvdimmNfitHeader) + structures->len,1 ,NULL ,NULL );g_array_free (structures, true); }
@@ -470,7 +470,7 @@ static void nvdimm_build_ssdt(GSList *device_list, GArray *table_offsets,g_array_append_vals (table_data, ssdt->buf->data, ssdt->buf->len);build_header (linker, table_data, (void *)(table_data->data + table_data->len - ssdt->buf->len), -"SSDT" , ssdt->buf->len,1 ,"NVDIMM" ); +"SSDT" , ssdt->buf->len,1 ,NULL ,"NVDIMM" );free_aml_allocator (); }
hw/arm/virt-acpi-build.c +6 -6
@@ -407,7 +407,7 @@ build_spcr(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) spcr->pci_vendor_id =0xffff ;/* PCI Vendor ID: not a PCI device */ build_header (linker, table_data, (void *)spcr,"SPCR" ,sizeof (*spcr),2 , -NULL ); +NULL ,NULL ); } static void
@@ -426,7 +426,7 @@ build_mcfg(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) mcfg->allocation[0 ].end_bus_number = (memmap[VIRT_PCIE_ECAM ].size /PCIE_MMCFG_SIZE_MIN ) -1 ; -build_header (linker, table_data, (void *)mcfg,"MCFG" , len,1 ,NULL ); +build_header (linker, table_data, (void *)mcfg,"MCFG" , len,1 ,NULL ,NULL ); }/* GTDT */
@@ -452,7 +452,7 @@ build_gtdt(GArray *table_data, GArray *linker)build_header (linker, table_data, (void *)(table_data->data + gtdt_start),"GTDT" , - table_data->len - gtdt_start,2 ,NULL ); + table_data->len - gtdt_start,2 ,NULL ,NULL ); }/* MADT */
@@ -514,7 +514,7 @@ build_madt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info,build_header (linker, table_data, (void *)(table_data->data + madt_start),"APIC" , - table_data->len - madt_start,3 ,NULL ); + table_data->len - madt_start,3 ,NULL ,NULL ); }/* FADT */
@@ -539,7 +539,7 @@ build_fadt(GArray *table_data, GArray *linker, unsigned dsdt) sizeof fadt->dsdt);build_header (linker, table_data, - (void *)fadt,"FACP" ,sizeof (*fadt),5 ,NULL ); + (void *)fadt,"FACP" ,sizeof (*fadt),5 ,NULL ,NULL ); }/* DSDT */
@@ -578,7 +578,7 @@ build_dsdt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info)g_array_append_vals (table_data, dsdt->buf->data, dsdt->buf->len);build_header (linker, table_data, (void *)(table_data->data + table_data->len - dsdt->buf->len), -"DSDT" , dsdt->buf->len,2 ,NULL ); +"DSDT" , dsdt->buf->len,2 ,NULL ,NULL );free_aml_allocator (); }
hw/i386/acpi-build.c +10 -10
@@ -358,7 +358,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 ); + (void *)fadt,"FACP" ,sizeof (*fadt),1 ,NULL ,NULL ); } static void
@@ -428,7 +428,7 @@ build_madt(GArray *table_data, GArray *linker, AcpiCpuInfo *cpu,build_header (linker, table_data, (void *)(table_data->data + madt_start),"APIC" , - table_data->len - madt_start,1 ,NULL ); + table_data->len - madt_start,1 ,NULL ,NULL ); }/* Assign BSEL property to all buses. In the future, this can be changed
@@ -2197,7 +2197,7 @@ build_ssdt(GArray *table_data, GArray *linker,g_array_append_vals (table_data, ssdt->buf->data, ssdt->buf->len);build_header (linker, table_data, (void *)(table_data->data + table_data->len - ssdt->buf->len), -"SSDT" , ssdt->buf->len,1 ,NULL ); +"SSDT" , ssdt->buf->len,1 ,NULL ,NULL );free_aml_allocator (); }
@@ -2213,7 +2213,7 @@ build_hpet(GArray *table_data, GArray *linker) hpet->timer_block_id =cpu_to_le32 (0x8086a201 ); hpet->addr.address =cpu_to_le64 (HPET_BASE );build_header (linker, table_data, - (void *)hpet,"HPET" ,sizeof (*hpet),1 ,NULL ); + (void *)hpet,"HPET" ,sizeof (*hpet),1 ,NULL ,NULL ); } static void
@@ -2236,7 +2236,7 @@ build_tpm_tcpa(GArray *table_data, GArray *linker, GArray *tcpalog) sizeof(tcpa->log_area_start_address));build_header (linker, table_data, - (void *)tcpa,"TCPA" ,sizeof (*tcpa),2 ,NULL ); + (void *)tcpa,"TCPA" ,sizeof (*tcpa),2 ,NULL ,NULL );acpi_data_push (tcpalog,TPM_LOG_AREA_MINIMUM_SIZE ); }
@@ -2253,7 +2253,7 @@ build_tpm2(GArray *table_data, GArray *linker) tpm2_ptr->start_method =cpu_to_le32 (TPM2_START_METHOD_MMIO );build_header (linker, table_data, - (void *)tpm2_ptr,"TPM2" ,sizeof (*tpm2_ptr),4 ,NULL ); + (void *)tpm2_ptr,"TPM2" ,sizeof (*tpm2_ptr),4 ,NULL ,NULL ); } typedef enum {
@@ -2367,7 +2367,7 @@ build_srat(GArray *table_data, GArray *linker, PcGuestInfo *guest_info)build_header (linker, table_data, (void *)(table_data->data + srat_start),"SRAT" , - table_data->len - srat_start,1 ,NULL ); + table_data->len - srat_start,1 ,NULL ,NULL ); } static void
@@ -2396,7 +2396,7 @@ build_mcfg_q35(GArray *table_data, GArray *linker, AcpiMcfgInfo *info) }else { sig ="MCFG" ; } -build_header (linker, table_data, (void *)mcfg, sig, len,1 ,NULL ); +build_header (linker, table_data, (void *)mcfg, sig, len,1 ,NULL ,NULL ); } static void
@@ -2420,7 +2420,7 @@ build_dmar_q35(GArray *table_data, GArray *linker) drhd->address =cpu_to_le64 (Q35_HOST_BRIDGE_IOMMU_ADDR );build_header (linker, table_data, (void *)(table_data->data + dmar_start), -"DMAR" , table_data->len - dmar_start,1 ,NULL ); +"DMAR" , table_data->len - dmar_start,1 ,NULL ,NULL ); } static void
@@ -2529,7 +2529,7 @@ build_dsdt(GArray *table_data, GArray *linker,g_array_append_vals (table_data, dsdt->buf->data, dsdt->buf->len);build_header (linker, table_data, (void *)(table_data->data + table_data->len - dsdt->buf->len), -"DSDT" , dsdt->buf->len,1 ,NULL ); +"DSDT" , dsdt->buf->len,1 ,NULL ,NULL );free_aml_allocator (); }
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH v2 1/4] acpi: take oem_id in build_header(), optionally
Quoted 15 lines · Laszlo Ersek
This patch is the continuation of commit
8870ca0e94f2("acpi: support specified oem table id forbuild_header"). It will allow us to control the OEM ID field too in the SDT header.Cc: "Michael S. Tsirkin" <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Igor Mammedov <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Xiao Guangrong <[email protected]> (maintainer:NVDIMM)
Cc: Shannon Zhao <[email protected]> (maintainer:ARM ACPI Subsystem)
Cc: Paolo Bonzini <[email protected]> (maintainer:X86)
Cc: Richard W.M. Jones <[email protected]>
Cc: Aleksei Kovura <[email protected]>
Cc: Michael Tokarev <[email protected]>
Cc: Steven Newbury <[email protected]>
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
LP: https://bugs.launchpad.net/qemu/+bug/1533848
Quoted 1 line
Signed-off-by Laszlo Ersek <[email protected]>
Quoted 232 lines
---
Notes:
v2:
- no changeinclude/hw/acpi/aml-build.h | 2 +- hw/acpi/aml-build.c | 11 ++++++++--- hw/acpi/nvdimm.c | 4 ++-- hw/arm/virt-acpi-build.c | 12 ++++++------ hw/i386/acpi-build.c | 20 ++++++++++---------- 5 files changed, 27 insertions(+), 22 deletions(-)include/hw/acpi/aml-build.h +1
-1@@ -357,7 +357,7 @@ Aml *aml_sizeof(Aml *arg);void build_header (GArray *linker,GArray *table_data,AcpiTableHeader *h,const char *sig,int len,uint8_t rev, -const char *oem_table_id); +const char *oem_id,const char *oem_table_id);void *acpi_data_push (GArray *table_data,unsigned size);unsigned acpi_data_len (GArray *table);void acpi_add_table (GArray *table_offsets,GArray *table_data);hw/acpi/aml-build.c +8
-3@@ -1430,12 +1430,17 @@ Aml *aml_alias(const char *source_object, const char *alias_object)void build_header (GArray *linker,GArray *table_data,AcpiTableHeader *h,const char *sig,int len,uint8_t rev, -const char *oem_table_id) +const char *oem_id,const char *oem_table_id) {memcpy (&h->signature, sig,4 ); h->length =cpu_to_le32 (len); h->revision = rev; -memcpy (h->oem_id,ACPI_BUILD_APPNAME6 ,6 ); + +if (oem_id) { +strncpy ((char *)h->oem_id, oem_id,sizeof h->oem_id); + }else { +memcpy (h->oem_id,ACPI_BUILD_APPNAME6 ,6 ); + }if (oem_table_id) {strncpy ((char *)h->oem_table_id, oem_table_id,sizeof (h->oem_table_id));@@ -1510,5 +1515,5 @@ build_rsdt(GArray *table_data, GArray *linker, GArray *table_offsets) sizeof(uint32_t)); }build_header (linker, table_data, - (void *)rsdt,"RSDT" , rsdt_len,1 ,NULL ); + (void *)rsdt,"RSDT" , rsdt_len,1 ,NULL ,NULL ); }hw/acpi/nvdimm.c +2
-2@@ -365,7 +365,7 @@ static void nvdimm_build_nfit(GSList *device_list, GArray *table_offsets,build_header (linker, table_data, (void *)(table_data->data + header),"NFIT" , -sizeof (NvdimmNfitHeader) + structures->len,1 ,NULL ); +sizeof (NvdimmNfitHeader) + structures->len,1 ,NULL ,NULL );g_array_free (structures, true); }@@ -470,7 +470,7 @@ static void nvdimm_build_ssdt(GSList *device_list, GArray *table_offsets,g_array_append_vals (table_data, ssdt->buf->data, ssdt->buf->len);build_header (linker, table_data, (void *)(table_data->data + table_data->len - ssdt->buf->len), -"SSDT" , ssdt->buf->len,1 ,"NVDIMM" ); +"SSDT" , ssdt->buf->len,1 ,NULL ,"NVDIMM" );free_aml_allocator (); }hw/arm/virt-acpi-build.c +6
-6@@ -407,7 +407,7 @@ build_spcr(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) spcr->pci_vendor_id =0xffff ;/* PCI Vendor ID: not a PCI device */ build_header (linker, table_data, (void *)spcr,"SPCR" ,sizeof (*spcr),2 , -NULL ); +NULL ,NULL ); } static void@@ -426,7 +426,7 @@ build_mcfg(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) mcfg->allocation[0 ].end_bus_number = (memmap[VIRT_PCIE_ECAM ].size /PCIE_MMCFG_SIZE_MIN ) -1 ; -build_header (linker, table_data, (void *)mcfg,"MCFG" , len,1 ,NULL ); +build_header (linker, table_data, (void *)mcfg,"MCFG" , len,1 ,NULL ,NULL ); }/* GTDT */ @@ -452,7 +452,7 @@ build_gtdt(GArray *table_data, GArray *linker)build_header (linker, table_data, (void *)(table_data->data + gtdt_start),"GTDT" , - table_data->len - gtdt_start,2 ,NULL ); + table_data->len - gtdt_start,2 ,NULL ,NULL ); }/* MADT */ @@ -514,7 +514,7 @@ build_madt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info,build_header (linker, table_data, (void *)(table_data->data + madt_start),"APIC" , - table_data->len - madt_start,3 ,NULL ); + table_data->len - madt_start,3 ,NULL ,NULL ); }/* FADT */ @@ -539,7 +539,7 @@ build_fadt(GArray *table_data, GArray *linker, unsigned dsdt) sizeof fadt->dsdt);build_header (linker, table_data, - (void *)fadt,"FACP" ,sizeof (*fadt),5 ,NULL ); + (void *)fadt,"FACP" ,sizeof (*fadt),5 ,NULL ,NULL ); }/* DSDT */ @@ -578,7 +578,7 @@ build_dsdt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info)g_array_append_vals (table_data, dsdt->buf->data, dsdt->buf->len);build_header (linker, table_data, (void *)(table_data->data + table_data->len - dsdt->buf->len), -"DSDT" , dsdt->buf->len,2 ,NULL ); +"DSDT" , dsdt->buf->len,2 ,NULL ,NULL );free_aml_allocator (); }hw/i386/acpi-build.c +10
-10@@ -358,7 +358,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 ); + (void *)fadt,"FACP" ,sizeof (*fadt),1 ,NULL ,NULL ); } static void@@ -428,7 +428,7 @@ build_madt(GArray *table_data, GArray *linker, AcpiCpuInfo *cpu,build_header (linker, table_data, (void *)(table_data->data + madt_start),"APIC" , - table_data->len - madt_start,1 ,NULL ); + table_data->len - madt_start,1 ,NULL ,NULL ); }/* Assign BSEL property to all buses. In the future, this can be changed @@ -2197,7 +2197,7 @@ build_ssdt(GArray *table_data, GArray *linker,g_array_append_vals (table_data, ssdt->buf->data, ssdt->buf->len);build_header (linker, table_data, (void *)(table_data->data + table_data->len - ssdt->buf->len), -"SSDT" , ssdt->buf->len,1 ,NULL ); +"SSDT" , ssdt->buf->len,1 ,NULL ,NULL );free_aml_allocator (); }@@ -2213,7 +2213,7 @@ build_hpet(GArray *table_data, GArray *linker) hpet->timer_block_id =cpu_to_le32 (0x8086a201 ); hpet->addr.address =cpu_to_le64 (HPET_BASE );build_header (linker, table_data, - (void *)hpet,"HPET" ,sizeof (*hpet),1 ,NULL ); + (void *)hpet,"HPET" ,sizeof (*hpet),1 ,NULL ,NULL ); } static void@@ -2236,7 +2236,7 @@ build_tpm_tcpa(GArray *table_data, GArray *linker, GArray *tcpalog) sizeof(tcpa->log_area_start_address));build_header (linker, table_data, - (void *)tcpa,"TCPA" ,sizeof (*tcpa),2 ,NULL ); + (void *)tcpa,"TCPA" ,sizeof (*tcpa),2 ,NULL ,NULL );acpi_data_push (tcpalog,TPM_LOG_AREA_MINIMUM_SIZE ); }@@ -2253,7 +2253,7 @@ build_tpm2(GArray *table_data, GArray *linker) tpm2_ptr->start_method =cpu_to_le32 (TPM2_START_METHOD_MMIO );build_header (linker, table_data, - (void *)tpm2_ptr,"TPM2" ,sizeof (*tpm2_ptr),4 ,NULL ); + (void *)tpm2_ptr,"TPM2" ,sizeof (*tpm2_ptr),4 ,NULL ,NULL ); } typedef enum {@@ -2367,7 +2367,7 @@ build_srat(GArray *table_data, GArray *linker, PcGuestInfo *guest_info)build_header (linker, table_data, (void *)(table_data->data + srat_start),"SRAT" , - table_data->len - srat_start,1 ,NULL ); + table_data->len - srat_start,1 ,NULL ,NULL ); } static void@@ -2396,7 +2396,7 @@ build_mcfg_q35(GArray *table_data, GArray *linker, AcpiMcfgInfo *info) }else { sig ="MCFG" ; } -build_header (linker, table_data, (void *)mcfg, sig, len,1 ,NULL ); +build_header (linker, table_data, (void *)mcfg, sig, len,1 ,NULL ,NULL ); } static void@@ -2420,7 +2420,7 @@ build_dmar_q35(GArray *table_data, GArray *linker) drhd->address =cpu_to_le64 (Q35_HOST_BRIDGE_IOMMU_ADDR );build_header (linker, table_data, (void *)(table_data->data + dmar_start), -"DMAR" , table_data->len - dmar_start,1 ,NULL ); +"DMAR" , table_data->len - dmar_start,1 ,NULL ,NULL ); } static void@@ -2529,7 +2529,7 @@ build_dsdt(GArray *table_data, GArray *linker,g_array_append_vals (table_data, dsdt->buf->data, dsdt->buf->len);build_header (linker, table_data, (void *)(table_data->data + table_data->len - dsdt->buf->len), -"DSDT" , dsdt->buf->len,1 ,NULL ); +"DSDT" , dsdt->buf->len,1 ,NULL ,NULL );free_aml_allocator (); }
Signature · 1 line
Shannon
PATCH v2 2/4 acpi: expose oem_id and oem_table_id in build_rsdt()
In reply to Laszlo ErsekSince build_rsdt() is implemented as common utility code (in "hw/acpi/aml-build.c"), it should expose -- and forward -- the oem_id and oem_table_id parameters between board code and the generic build_header() function.
Cc: "Michael S. Tsirkin" <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Igor Mammedov <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Shannon Zhao <[email protected]> (maintainer:ARM ACPI Subsystem)
Cc: Paolo Bonzini <[email protected]> (maintainer:X86)
Cc: Richard W.M. Jones <[email protected]>
Cc: Aleksei Kovura <[email protected]>
Cc: Michael Tokarev <[email protected]>
Cc: Steven Newbury <[email protected]>
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
LP: https://bugs.launchpad.net/qemu/+bug/1533848
---
Notes:
v2:
- no change
include/hw/acpi/aml-build.h | 3 ++- hw/acpi/aml-build.c | 5 +++-- hw/arm/virt-acpi-build.c | 2 +- hw/i386/acpi-build.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-)
include/hw/acpi/aml-build.h +2 -1
@@ -364,6 +364,7 @@ void acpi_add_table(GArray *table_offsets, GArray *table_data);void acpi_build_tables_init (AcpiBuildTables *tables);void acpi_build_tables_cleanup (AcpiBuildTables *tables,bool mfre);void -build_rsdt (GArray *table_data,GArray *linker,GArray *table_offsets); +build_rsdt (GArray *table_data,GArray *linker,GArray *table_offsets, +const char *oem_id,const char *oem_table_id);#endif
hw/acpi/aml-build.c +3 -2
@@ -1496,7 +1496,8 @@ void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre)/* Build rsdt table */ void -build_rsdt (GArray *table_data,GArray *linker,GArray *table_offsets) +build_rsdt (GArray *table_data,GArray *linker,GArray *table_offsets, +const char *oem_id,const char *oem_table_id) {AcpiRsdtDescriptorRev1 *rsdt;size_t rsdt_len;
@@ -1515,5 +1516,5 @@ build_rsdt(GArray *table_data, GArray *linker, GArray *table_offsets) sizeof(uint32_t)); }build_header (linker, table_data, - (void *)rsdt,"RSDT" , rsdt_len,1 ,NULL ,NULL ); + (void *)rsdt,"RSDT" , rsdt_len,1 , oem_id, oem_table_id); }
hw/arm/virt-acpi-build.c +1 -1
@@ -642,7 +642,7 @@ void virt_acpi_build(VirtGuestInfo *guest_info, AcpiBuildTables *tables)/* RSDT is pointed to by RSDP */ rsdt = tables_blob->len; -build_rsdt (tables_blob, tables->linker, table_offsets); +build_rsdt (tables_blob, tables->linker, table_offsets,NULL ,NULL );/* RSDP is in FSEG memory, so allocate it separately */ build_rsdp (tables->rsdp, tables->linker, rsdt);
hw/i386/acpi-build.c +1 -1
@@ -2705,7 +2705,7 @@ 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); +build_rsdt (tables_blob, tables->linker, table_offsets,NULL ,NULL );/* RSDP is in FSEG memory, so allocate it separately */ build_rsdp (tables->rsdp, tables->linker, rsdt);
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH v2 2/4] acpi: expose oem_id and oem_table_id in build_rsdt()
Quoted 15 lines · Laszlo Ersek
Since
build_rsdt()is implemented as common utility code (in "hw/acpi/aml-build.c"), it should expose -- and forward -- theoem_idandoem_table_idparameters between board code and the genericbuild_header()function.Cc: "Michael S. Tsirkin" <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Igor Mammedov <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Shannon Zhao <[email protected]> (maintainer:ARM ACPI Subsystem)
Cc: Paolo Bonzini <[email protected]> (maintainer:X86)
Cc: Richard W.M. Jones <[email protected]>
Cc: Aleksei Kovura <[email protected]>
Cc: Michael Tokarev <[email protected]>
Cc: Steven Newbury <[email protected]>
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
LP: https://bugs.launchpad.net/qemu/+bug/1533848
Quoted 1 line
Signed-off-by Laszlo Ersek <[email protected]>
Quoted 73 lines
---
Notes:
v2:
- no changeinclude/hw/acpi/aml-build.h | 3 ++- hw/acpi/aml-build.c | 5 +++-- hw/arm/virt-acpi-build.c | 2 +- hw/i386/acpi-build.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-)include/hw/acpi/aml-build.h +2
-1@@ -364,6 +364,7 @@ void acpi_add_table(GArray *table_offsets, GArray *table_data);void acpi_build_tables_init (AcpiBuildTables *tables);void acpi_build_tables_cleanup (AcpiBuildTables *tables,bool mfre);void -build_rsdt (GArray *table_data,GArray *linker,GArray *table_offsets); +build_rsdt (GArray *table_data,GArray *linker,GArray *table_offsets, +const char *oem_id,const char *oem_table_id);#endif hw/acpi/aml-build.c +3
-2@@ -1496,7 +1496,8 @@ void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre)/* Build rsdt table */ void -build_rsdt (GArray *table_data,GArray *linker,GArray *table_offsets) +build_rsdt (GArray *table_data,GArray *linker,GArray *table_offsets, +const char *oem_id,const char *oem_table_id) {AcpiRsdtDescriptorRev1 *rsdt;size_t rsdt_len;@@ -1515,5 +1516,5 @@ build_rsdt(GArray *table_data, GArray *linker, GArray *table_offsets) sizeof(uint32_t)); }build_header (linker, table_data, - (void *)rsdt,"RSDT" , rsdt_len,1 ,NULL ,NULL ); + (void *)rsdt,"RSDT" , rsdt_len,1 , oem_id, oem_table_id); }hw/arm/virt-acpi-build.c +1
-1@@ -642,7 +642,7 @@ void virt_acpi_build(VirtGuestInfo *guest_info, AcpiBuildTables *tables)/* RSDT is pointed to by RSDP */ rsdt = tables_blob->len; -build_rsdt (tables_blob, tables->linker, table_offsets); +build_rsdt (tables_blob, tables->linker, table_offsets,NULL ,NULL );/* RSDP is in FSEG memory, so allocate it separately */ build_rsdp (tables->rsdp, tables->linker, rsdt);hw/i386/acpi-build.c +1
-1@@ -2705,7 +2705,7 @@ 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); +build_rsdt (tables_blob, tables->linker, table_offsets,NULL ,NULL );/* RSDP is in FSEG memory, so allocate it separately */ build_rsdp (tables->rsdp, tables->linker, rsdt);
Signature · 1 line
Shannon
PATCH v2 3/4 acpi: add function to extract oem_id and oem_table_id from the user's SLIC
In reply to Laszlo ErsekThe acpi_get_slic_oem() function stores pointers to these fields in the (first) SLIC table that the user passes in with the -acpitable switch.
Cc: "Michael S. Tsirkin" <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Igor Mammedov <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Richard W.M. Jones <[email protected]>
Cc: Aleksei Kovura <[email protected]>
Cc: Michael Tokarev <[email protected]>
Cc: Steven Newbury <[email protected]>
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
LP: https://bugs.launchpad.net/qemu/+bug/1533848
---
Notes:
v2:
- introduce [MST]
include/hw/acpi/acpi.h | 7 +++++++ hw/acpi/core.c | 16 ++++++++++++++++ 2 files changed, 23 insertions(+)
include/hw/acpi/acpi.h +7 -0
@@ -196,4 +196,11 @@ unsigned acpi_table_len(void *current);void acpi_table_add (const QemuOpts *opts,Error **errp);void acpi_table_add_builtin (const QemuOpts *opts,Error **errp); +typedef struct AcpiSlicOem AcpiSlicOem ; +struct AcpiSlicOem { +char *id; +char *table_id; +}; +int acpi_get_slic_oem (AcpiSlicOem *oem); +#endif /* !QEMU_HW_ACPI_H */
hw/acpi/core.c +16 -0
@@ -349,6 +349,22 @@ uint8_t *acpi_table_next(uint8_t *current) } } +int acpi_get_slic_oem (AcpiSlicOem *oem) +{ +uint8_t *u; + +for (u =acpi_table_first (); u; u =acpi_table_next (u)) { +struct acpi_table_header *hdr = (void *)(u -sizeof (hdr->_length)); + +if (memcmp (hdr->sig,"SLIC" ,4 ) ==0 ) { + oem->id = hdr->oem_id; + oem->table_id = hdr->oem_table_id; +return 0 ; + } + } +return -1 ; +} +static void acpi_notify_wakeup (Notifier *notifier,void *data) {ACPIREGS *ar =container_of (notifier,ACPIREGS , wakeup);
Signature · 1 line
1.8.3.1
PATCH v2 4/4 pc: set the OEM fields in the RSDT and the FADT from the SLIC
In reply to Laszlo ErsekThe 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.
This patch wires up the previous three patches.
Cc: "Michael S. Tsirkin" <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Igor Mammedov <[email protected]> (supporter:ACPI/SMBIOS)
Cc: Paolo Bonzini <[email protected]> (maintainer:X86)
Cc: Richard W.M. Jones <[email protected]>
Cc: Aleksei Kovura <[email protected]>
Cc: Michael Tokarev <[email protected]>
Cc: Steven Newbury <[email protected]>
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
LP: https://bugs.launchpad.net/qemu/+bug/1533848
---
Notes:
v2:
- rebase to new acpi_get_slic_oem() [MST]
- drop machine type property to disable this behavior [MST]
hw/i386/acpi-build.c | 13 +++++++++---- qemu-options.hx | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-)
hw/i386/acpi-build.c +9 -4
@@ -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,11 +2622,13 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)uint8_t *u;size_t aml_len =0 ;GArray *tables_blob = tables->table_data; +AcpiSlicOem slic_oem = { .id =NULL , .table_id =NULL };acpi_get_cpu_info (&cpu);acpi_get_pm_info (&pm);acpi_get_misc_info (&misc);acpi_get_pci_info (&pci); +acpi_get_slic_oem (&slic_oem); table_offsets =g_array_new (false, true/* clear */ ,sizeof (uint32_t ));
@@ -2654,7 +2657,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 +2709,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);
qemu-options.hx +4 -0
@@ -1472,6 +1472,10 @@ ACPI headers (possible overridden by other options). For data=, only data portion of the table is used, all header information is specified in the command line. +If a SLIC table is supplied to QEMU, then the SLIC's oem_id and oem_table_id +fields will override the same in the RSDT and the FADT (a.k.a. FACP), in order +to ensure the field matches required by the Microsoft SLIC spec and the ACPI +spec. ETEXI DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
Signature · 1 line
1.8.3.1
Quoted 7 lines · Laszlo Ersek
This is version 2 of
<http://thread.gmane.org/gmane.comp.emulators.qemu/386728>.Changes in v2 (also annotated per patch):
- introduceacpi_get_slic_oem()[MST],
- drop machine property that disables the SLIC-based override [MST].
Series looks good to me. This is much cleaner (less hacky) than the patch I posted. I started out with a similar approach but felt I was being too invasive, so decided to keep it simple.
Quoted 34 lines
Cc "Michael S. Tsirkin" <[email protected]>Cc Aleksei Kovura <[email protected]>Cc Igor Mammedov <[email protected]>Cc Michael Tokarev <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Richard W.M. Jones <[email protected]>Cc Shannon Zhao <[email protected]>Cc Steven Newbury <[email protected]>Cc Xiao Guangrong <[email protected]>Thanks
LaszloLaszlo Ersek (4):
acpi: takeoem_idinbuild_header(), optionally
acpi: exposeoem_idandoem_table_idinbuild_rsdt()
acpi: add function to extractoem_idandoem_table_idfrom the user's
SLIC
pc: set the OEM fields in the RSDT and the FADT from the SLICinclude/hw/acpi/acpi.h | 7 +++++++ include/hw/acpi/aml-build.h | 5 +++-- hw/acpi/aml-build.c | 14 ++++++++++---- hw/acpi/core.c | 16 ++++++++++++++++ hw/acpi/nvdimm.c | 4 ++-- hw/arm/virt-acpi-build.c | 14 +++++++------- hw/i386/acpi-build.c | 31 ++++++++++++++++++------------- qemu-options.hx | 4 ++++ 8 files changed, 67 insertions(+), 28 deletions(-)Signature · 1 line
1.8.3.1
Signature · 1 line
Sent from my Jolla
Steven Newbury
Reviewed-byQuoted 11 lines · Steven Newbury
Quoted 7 lines · Laszlo Ersek
This is version 2 of
<http://thread.gmane.org/gmane.comp.emulators.qemu/386728>.Changes in v2 (also annotated per patch):
- introduceacpi_get_slic_oem()[MST],
- drop machine property that disables the SLIC-based override [MST].Series looks good to me. This is much cleaner (less hacky) than the patch I posted. I started out with a similar approach but felt I was being too invasive, so decided to keep it simple.
For what it's worth:
Quoted 37 lines
Quoted 34 lines
Cc "Michael S. Tsirkin" <[email protected]>Cc Aleksei Kovura <[email protected]>Cc Igor Mammedov <[email protected]>Cc Michael Tokarev <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Richard W.M. Jones <[email protected]>Cc Shannon Zhao <[email protected]>Cc Steven Newbury <[email protected]>Cc Xiao Guangrong <[email protected]>Thanks
LaszloLaszlo Ersek (4):
acpi: takeoem_idinbuild_header(), optionally
acpi: exposeoem_idandoem_table_idinbuild_rsdt()
acpi: add function to extractoem_idandoem_table_idfrom the user's
SLIC
pc: set the OEM fields in the RSDT and the FADT from the SLICinclude/hw/acpi/acpi.h | 7 +++++++ include/hw/acpi/aml-build.h | 5 +++-- hw/acpi/aml-build.c | 14 ++++++++++---- hw/acpi/core.c | 16 ++++++++++++++++ hw/acpi/nvdimm.c | 4 ++-- hw/arm/virt-acpi-build.c | 14 +++++++------- hw/i386/acpi-build.c | 31 ++++++++++++++++++------------- qemu-options.hx | 4 ++++ 8 files changed, 67 insertions(+), 28 deletions(-)Signature · 1 line
1.8.3.1Signature · 1 line
Sent from my Joll
Signature · 1 line
Sent from my Jolla
Laszlo Ersek
Reviewed-by Steven Newbury Tested-by Aleksei Kovura Reviewed-by Steven Newbury Tested-by Aleksei Kovura Tested-by Aleksei Kovura Tested-by Aleksei Kovura on the v2 seriesQuoted 27 lines · Laszlo Ersek
This is version 2 of
<http://thread.gmane.org/gmane.comp.emulators.qemu/386728>.Changes in v2 (also annotated per patch):
- introduceacpi_get_slic_oem()[MST],
- drop machine property that disables the SLIC-based override [MST].Cc "Michael S. Tsirkin" <[email protected]>Cc Aleksei Kovura <[email protected]>Cc Igor Mammedov <[email protected]>Cc Michael Tokarev <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Richard W.M. Jones <[email protected]>Cc Shannon Zhao <[email protected]>Cc Steven Newbury <[email protected]>Cc Xiao Guangrong <[email protected]>Thanks
LaszloLaszlo Ersek (4):
acpi: takeoem_idinbuild_header(), optionally
acpi: exposeoem_idandoem_table_idinbuild_rsdt()
acpi: add function to extractoem_idandoem_table_idfrom the user's
SLIC
pc: set the OEM fields in the RSDT and the FADT from the SLIC
Quoted 10 lines
include/hw/acpi/acpi.h | 7 +++++++ include/hw/acpi/aml-build.h | 5 +++-- hw/acpi/aml-build.c | 14 ++++++++++---- hw/acpi/core.c | 16 ++++++++++++++++ hw/acpi/nvdimm.c | 4 ++-- hw/arm/virt-acpi-build.c | 14 +++++++------- hw/i386/acpi-build.c | 31 ++++++++++++++++++------------- qemu-options.hx | 4 ++++ 8 files changed, 67 insertions(+), 28 deletions(-)
Ping -- here's the review & testing feedback thus far:
patch 1: Reviewed-by: Shannon Zhao <[email protected]>
patch 2: Reviewed-by: Shannon Zhao <[email protected]>
patch 3: Reviewed-by: Steven Newbury <[email protected]>
patch 4: Reviewed-by: Steven Newbury <[email protected]>
(Tested-by inferred from
<https://bugzilla.redhat.com/show_bug.cgi?id=1248758#c28>.)
Michael, Igor, can one of you guys please pick this up?
Thanks
Laszlo
Quoted 52 lines · Laszlo Ersek
Quoted 27 lines · Laszlo Ersek
This is version 2 of
<http://thread.gmane.org/gmane.comp.emulators.qemu/386728>.Changes in v2 (also annotated per patch):
- introduceacpi_get_slic_oem()[MST],
- drop machine property that disables the SLIC-based override [MST].Cc "Michael S. Tsirkin" <[email protected]>Cc Aleksei Kovura <[email protected]>Cc Igor Mammedov <[email protected]>Cc Michael Tokarev <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Richard W.M. Jones <[email protected]>Cc Shannon Zhao <[email protected]>Cc Steven Newbury <[email protected]>Cc Xiao Guangrong <[email protected]>Thanks
LaszloLaszlo Ersek (4):
acpi: takeoem_idinbuild_header(), optionally
acpi: exposeoem_idandoem_table_idinbuild_rsdt()
acpi: add function to extractoem_idandoem_table_idfrom the user's
SLIC
pc: set the OEM fields in the RSDT and the FADT from the SLICQuoted 10 lines
include/hw/acpi/acpi.h | 7 +++++++ include/hw/acpi/aml-build.h | 5 +++-- hw/acpi/aml-build.c | 14 ++++++++++---- hw/acpi/core.c | 16 ++++++++++++++++ hw/acpi/nvdimm.c | 4 ++-- hw/arm/virt-acpi-build.c | 14 +++++++------- hw/i386/acpi-build.c | 31 ++++++++++++++++++------------- qemu-options.hx | 4 ++++ 8 files changed, 67 insertions(+), 28 deletions(-)Ping -- here's the review & testing feedback thus far:
patch 1: Reviewed-by: Shannon Zhao <[email protected]>
Reviewed-by Steven Newbury <[email protected]>Tested-by Aleksei Kovura <[email protected]>patch 2: Reviewed-by: Shannon Zhao <[email protected]>
Reviewed-by Steven Newbury <[email protected]>Tested-by Aleksei Kovura <[email protected]>patch 3: Reviewed-by: Steven Newbury <[email protected]>
Tested-by Aleksei Kovura <[email protected]>
Quoted 7 lines
patch 4: Reviewed-by: Steven Newbury <[email protected]>
Tested-by Aleksei Kovura <[email protected]>(Tested-by inferred from
<https://bugzilla.redhat.com/show_bug.cgi?id=1248758#c28>.)Michael, Igor, can one of you guys please pick this up?
Ping #2.
Quoted 1 line · Laszlo Ersek
Ping #2.
I think I asked this before, but somehow I don't see anyone answered. Is this thing worth to have now, when windows7 is 2 releases away, everyone is moving to windows8 or 10 rapidly, and these OSes don't benefit from this patch due to different activation scheme and different licensing terms?
Is it useful for anything but win7 (or 2008) ?
It was definitely useful when I dealt with this issue back when win7 come out, at that time it received no interest. Now, I think, it is of very limited/questionable use...
Thanks,
/mjt
Quoted 9 lines · Michael Tokarev
Quoted 1 line · Laszlo Ersek
Ping #2.
I think I asked this before, but somehow I don't see anyone answered. Is this thing worth to have now, when windows7 is 2 releases away, everyone is moving to windows8 or 10 rapidly, and these OSes don't benefit from this patch due to different activation scheme and different licensing terms?
Quoted 5 lines
Is it useful for anything but win7 (or 2008) ?
It was definitely useful when I dealt with this issue back when win7 come out, at that time it received no interest. Now, I think, it is of very limited/questionable use...
I can forward the arguments of the people who requested this functionality:
(1) Aleksei requested this fairly recently:
<https://github.com/tianocore/edk2/issues/5>.
(2) I've seen arguments about the long-term relevance of
Windows 2008 R2:
<https://bugzilla.redhat.com/show_bug.cgi?id=1248758#c15>
and of Windows 7:
<https://bugzilla.redhat.com/show_bug.cgi?id=1248758#c16>My own arguments:
- SLIC is actually governed by a public Microsoft spec, so it doesn't hurt to conform to it.
- We went to *much* greater lengths for enabling UEFI Windows 7 / UEFI Windows Server 2008 R2 on top of OVMF *without* a CSM. UEFI is not relevant at all in this thread, I'm just saying that in comparison to what we had taken on for the Win7 family's sake, this effort is almost negligible.
Thanks
Laszlo
Quoted 9 lines · Michael Tokarev
Quoted 1 line · Laszlo Ersek
Ping #2.
I think I asked this before, but somehow I don't see anyone answered. Is this thing worth to have now, when windows7 is 2 releases away, everyone is moving to windows8 or 10 rapidly, and these OSes don't benefit from this patch due to different activation scheme and different licensing terms?
Quoted 5 lines
Is it useful for anything but win7 (or 2008) ?
It was definitely useful when I dealt with this issue back when win7 come out, at that time it received no interest. Now, I think, it is of very limited/questionable use...
Given the limitation that I cannot reproduce this, if it's a real problem then it's certainly something we would need for virt-p2v.
The aim of virt-p2v is to virtualize existing Windows hosts, for VDI, to extend the life of hardware, or just generally to get the usual benefits of virtualization.
Enterprises often don't want to upgrade Windows frequently, and Windows 7 is supported by Microsoft until 2020-01-14 -- another 4 years.
Rich.
Signature · 5 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/