qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v4 0/5] acpi: Permit OEM ID and OEM table ID fields to be changed


From: Marian Postevca
Subject: [PATCH v4 0/5] acpi: Permit OEM ID and OEM table ID fields to be changed
Date: Tue, 19 Jan 2021 02:32:11 +0200

Qemu's ACPI table generation sets the fields OEM ID and OEM table ID
to "BOCHS " and "BXPCxxxx" where "xxxx" is replaced by the ACPI
table name.

Some games like Red Dead Redemption 2 seem to check the ACPI OEM ID
and OEM table ID for the strings "BOCHS" and "BXPC" and if they are
found, the game crashes(this may be an intentional detection
mechanism to prevent playing the game in a virtualized environment).

This patch allows you to override these default values.

The feature can be used in this manner:
qemu -machine oem-id=ABCDEF,oem-table-id=GHIJKLMN

The oem-id string can be up to 6 bytes in size, and the
oem-table-id string can be up to 8 bytes in size. If the string are
smaller than their respective sizes they will be padded with space.
If either of these parameters is not set, the current default values
will be used for the one missing.

Note that the the OEM Table ID field will not be extended with the
name of the table, but will use either the default name or the user
provided one.

This does not affect the -acpitable option (for user-defined ACPI
tables), which has precedence over -machine option.

v4:
- Added testcases for pc,q35,microvm,aarch64
- Switched to strpadcpy() instead of own function
- Don't touch unrelated fields in tables
- Instead of VIRT_MACHINE(obj)->bar use Foo *vm = VIRT_MACHINE(obj);
  vm->bar

v3:
- Do not append the sig part to OEM table id
- build_header() always sets the passed in values for oem_id
  and oem_table_id
- Fixed a call to g_strdup() with a non-terminated string
- Use MachineState structures to hold the OEM fields
- Proper error handling in object setters
- Added description for object setters/getters
- Added support for pc,q35,microvm,aarch64

v2:
- Use machine properties to set the OEM fields values
- Pass the desired values from acpi_build()

Marian Postevca (5):
  tests/acpi: allow updates for expected data files
  acpi: Permit OEM ID and OEM table ID fields to be changed
  tests/acpi: add OEM ID and OEM TABLE ID test
  tests/acpi: update expected data files
  tests/acpi: disallow updates for expected data files

 hw/acpi/hmat.h                       |   3 +-
 hw/i386/acpi-common.h                |   3 +-
 include/hw/acpi/acpi-defs.h          |   2 +-
 include/hw/acpi/aml-build.h          |   8 +-
 include/hw/acpi/ghes.h               |   3 +-
 include/hw/acpi/pci.h                |   3 +-
 include/hw/acpi/vmgenid.h            |   2 +-
 include/hw/arm/virt.h                |   2 +
 include/hw/i386/microvm.h            |   4 +
 include/hw/i386/pc.h                 |   5 +-
 include/hw/mem/nvdimm.h              |   3 +-
 hw/acpi/aml-build.c                  |  29 ++---
 hw/acpi/ghes.c                       |   5 +-
 hw/acpi/hmat.c                       |   5 +-
 hw/acpi/nvdimm.c                     |  18 +--
 hw/acpi/pci.c                        |   5 +-
 hw/acpi/vmgenid.c                    |   4 +-
 hw/arm/virt-acpi-build.c             |  40 ++++---
 hw/arm/virt.c                        |  63 ++++++++++
 hw/i386/acpi-build.c                 |  86 +++++++++-----
 hw/i386/acpi-common.c                |   5 +-
 hw/i386/acpi-microvm.c               |  13 +-
 hw/i386/microvm.c                    |  66 +++++++++++
 hw/i386/pc.c                         |  64 ++++++++++
 tests/qtest/bios-tables-test.c       | 170 +++++++++++++++++++++++----
 tests/data/acpi/microvm/APIC         | Bin 70 -> 70 bytes
 tests/data/acpi/microvm/APIC.ioapic2 | Bin 82 -> 82 bytes
 tests/data/acpi/microvm/APIC.pcie    | Bin 110 -> 110 bytes
 tests/data/acpi/microvm/DSDT         | Bin 365 -> 365 bytes
 tests/data/acpi/microvm/DSDT.ioapic2 | Bin 365 -> 365 bytes
 tests/data/acpi/microvm/DSDT.pcie    | Bin 3031 -> 3031 bytes
 tests/data/acpi/microvm/DSDT.rtc     | Bin 404 -> 404 bytes
 tests/data/acpi/microvm/DSDT.usb     | Bin 414 -> 414 bytes
 tests/data/acpi/microvm/FACP         | Bin 268 -> 268 bytes
 tests/data/acpi/pc/APIC              | Bin 120 -> 120 bytes
 tests/data/acpi/pc/APIC.acpihmat     | Bin 128 -> 128 bytes
 tests/data/acpi/pc/APIC.cphp         | Bin 160 -> 160 bytes
 tests/data/acpi/pc/APIC.dimmpxm      | Bin 144 -> 144 bytes
 tests/data/acpi/pc/DSDT              | Bin 5065 -> 5065 bytes
 tests/data/acpi/pc/DSDT.acpihmat     | Bin 6390 -> 6390 bytes
 tests/data/acpi/pc/DSDT.bridge       | Bin 6924 -> 6924 bytes
 tests/data/acpi/pc/DSDT.cphp         | Bin 5529 -> 5529 bytes
 tests/data/acpi/pc/DSDT.dimmpxm      | Bin 6719 -> 6719 bytes
 tests/data/acpi/pc/DSDT.hpbridge     | Bin 5026 -> 5026 bytes
 tests/data/acpi/pc/DSDT.hpbrroot     | Bin 3084 -> 3084 bytes
 tests/data/acpi/pc/DSDT.ipmikcs      | Bin 5137 -> 5137 bytes
 tests/data/acpi/pc/DSDT.memhp        | Bin 6424 -> 6424 bytes
 tests/data/acpi/pc/DSDT.numamem      | Bin 5071 -> 5071 bytes
 tests/data/acpi/pc/DSDT.roothp       | Bin 5261 -> 5261 bytes
 tests/data/acpi/pc/FACP              | Bin 116 -> 116 bytes
 tests/data/acpi/pc/HMAT.acpihmat     | Bin 280 -> 280 bytes
 tests/data/acpi/pc/HPET              | Bin 56 -> 56 bytes
 tests/data/acpi/pc/NFIT.dimmpxm      | Bin 240 -> 240 bytes
 tests/data/acpi/pc/SLIT.cphp         | Bin 48 -> 48 bytes
 tests/data/acpi/pc/SLIT.memhp        | Bin 48 -> 48 bytes
 tests/data/acpi/pc/SRAT.acpihmat     | Bin 280 -> 280 bytes
 tests/data/acpi/pc/SRAT.cphp         | Bin 304 -> 304 bytes
 tests/data/acpi/pc/SRAT.dimmpxm      | Bin 392 -> 392 bytes
 tests/data/acpi/pc/SRAT.memhp        | Bin 264 -> 264 bytes
 tests/data/acpi/pc/SRAT.numamem      | Bin 224 -> 224 bytes
 tests/data/acpi/pc/SSDT.dimmpxm      | Bin 734 -> 734 bytes
 tests/data/acpi/pc/WAET              | Bin 40 -> 40 bytes
 tests/data/acpi/q35/APIC             | Bin 120 -> 120 bytes
 tests/data/acpi/q35/APIC.acpihmat    | Bin 128 -> 128 bytes
 tests/data/acpi/q35/APIC.cphp        | Bin 160 -> 160 bytes
 tests/data/acpi/q35/APIC.dimmpxm     | Bin 144 -> 144 bytes
 tests/data/acpi/q35/DSDT             | Bin 7801 -> 7801 bytes
 tests/data/acpi/q35/DSDT.acpihmat    | Bin 9126 -> 9126 bytes
 tests/data/acpi/q35/DSDT.bridge      | Bin 7819 -> 7819 bytes
 tests/data/acpi/q35/DSDT.cphp        | Bin 8265 -> 8265 bytes
 tests/data/acpi/q35/DSDT.dimmpxm     | Bin 9455 -> 9455 bytes
 tests/data/acpi/q35/DSDT.ipmibt      | Bin 7876 -> 7876 bytes
 tests/data/acpi/q35/DSDT.memhp       | Bin 9160 -> 9160 bytes
 tests/data/acpi/q35/DSDT.mmio64      | Bin 8932 -> 8932 bytes
 tests/data/acpi/q35/DSDT.numamem     | Bin 7807 -> 7807 bytes
 tests/data/acpi/q35/DSDT.tis         | Bin 8407 -> 8407 bytes
 tests/data/acpi/q35/FACP             | Bin 244 -> 244 bytes
 tests/data/acpi/q35/HMAT.acpihmat    | Bin 280 -> 280 bytes
 tests/data/acpi/q35/HPET             | Bin 56 -> 56 bytes
 tests/data/acpi/q35/MCFG             | Bin 60 -> 60 bytes
 tests/data/acpi/q35/NFIT.dimmpxm     | Bin 240 -> 240 bytes
 tests/data/acpi/q35/SLIT.cphp        | Bin 48 -> 48 bytes
 tests/data/acpi/q35/SLIT.memhp       | Bin 48 -> 48 bytes
 tests/data/acpi/q35/SRAT.acpihmat    | Bin 280 -> 280 bytes
 tests/data/acpi/q35/SRAT.cphp        | Bin 304 -> 304 bytes
 tests/data/acpi/q35/SRAT.dimmpxm     | Bin 392 -> 392 bytes
 tests/data/acpi/q35/SRAT.memhp       | Bin 264 -> 264 bytes
 tests/data/acpi/q35/SRAT.mmio64      | Bin 224 -> 224 bytes
 tests/data/acpi/q35/SRAT.numamem     | Bin 224 -> 224 bytes
 tests/data/acpi/q35/SSDT.dimmpxm     | Bin 734 -> 734 bytes
 tests/data/acpi/q35/TPM2.tis         | Bin 76 -> 76 bytes
 tests/data/acpi/q35/WAET             | Bin 40 -> 40 bytes
 tests/data/acpi/virt/APIC            | Bin 168 -> 168 bytes
 tests/data/acpi/virt/APIC.memhp      | Bin 168 -> 168 bytes
 tests/data/acpi/virt/APIC.numamem    | Bin 168 -> 168 bytes
 tests/data/acpi/virt/DSDT            | Bin 5204 -> 5204 bytes
 tests/data/acpi/virt/DSDT.memhp      | Bin 6565 -> 6565 bytes
 tests/data/acpi/virt/DSDT.numamem    | Bin 5204 -> 5204 bytes
 tests/data/acpi/virt/DSDT.pxb        | Bin 7689 -> 7689 bytes
 tests/data/acpi/virt/FACP            | Bin 268 -> 268 bytes
 tests/data/acpi/virt/FACP.memhp      | Bin 268 -> 268 bytes
 tests/data/acpi/virt/FACP.numamem    | Bin 268 -> 268 bytes
 tests/data/acpi/virt/GTDT            | Bin 96 -> 96 bytes
 tests/data/acpi/virt/GTDT.memhp      | Bin 96 -> 96 bytes
 tests/data/acpi/virt/GTDT.numamem    | Bin 96 -> 96 bytes
 tests/data/acpi/virt/MCFG            | Bin 60 -> 60 bytes
 tests/data/acpi/virt/MCFG.memhp      | Bin 60 -> 60 bytes
 tests/data/acpi/virt/MCFG.numamem    | Bin 60 -> 60 bytes
 tests/data/acpi/virt/NFIT.memhp      | Bin 224 -> 224 bytes
 tests/data/acpi/virt/SLIT.memhp      | Bin 48 -> 48 bytes
 tests/data/acpi/virt/SPCR            | Bin 80 -> 80 bytes
 tests/data/acpi/virt/SPCR.memhp      | Bin 80 -> 80 bytes
 tests/data/acpi/virt/SPCR.numamem    | Bin 80 -> 80 bytes
 tests/data/acpi/virt/SRAT.memhp      | Bin 226 -> 226 bytes
 tests/data/acpi/virt/SRAT.numamem    | Bin 106 -> 106 bytes
 tests/data/acpi/virt/SSDT.memhp      | Bin 736 -> 736 bytes
 116 files changed, 495 insertions(+), 116 deletions(-)

-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]