From 602b458201ffd6f261fb8ee16b5175d733d3ec32 Mon Sep 17 00:00:00 2001 From: Marian Postevca Date: Tue, 19 Jan 2021 02:32:13 +0200 Subject: acpi: Permit OEM ID and OEM table ID fields to be changed 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. Signed-off-by: Marian Postevca Message-Id: <20210119003216.17637-3-posteuca@mutex.one> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hw/acpi/pci.c') diff --git a/hw/acpi/pci.c b/hw/acpi/pci.c index 9510597..ec455c3 100644 --- a/hw/acpi/pci.c +++ b/hw/acpi/pci.c @@ -28,7 +28,8 @@ #include "hw/acpi/pci.h" #include "hw/pci/pcie_host.h" -void build_mcfg(GArray *table_data, BIOSLinker *linker, AcpiMcfgInfo *info) +void build_mcfg(GArray *table_data, BIOSLinker *linker, AcpiMcfgInfo *info, + const char *oem_id, const char *oem_table_id) { int mcfg_start = table_data->len; @@ -56,6 +57,6 @@ void build_mcfg(GArray *table_data, BIOSLinker *linker, AcpiMcfgInfo *info) build_append_int_noprefix(table_data, 0, 4); build_header(linker, table_data, (void *)(table_data->data + mcfg_start), - "MCFG", table_data->len - mcfg_start, 1, NULL, NULL); + "MCFG", table_data->len - mcfg_start, 1, oem_id, oem_table_id); } -- cgit v1.1