qemu-spoof: scrub device ACPI _HIDs (vmgenid / pvpanic / fw_cfg) vmgenid: _HID QEMUVGID -> MSFT0002 when vmgenid policy = mask. pvpanic: omit the QEMU0001 _HID node when spoof_pvpanic_hide(). fw_cfg: _HID QEMU0002 -> spoof_fwcfg_acpi_devid(). Inert unless a spoof-seed is set. diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index 70ad029..7f95d79 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -11,6 +11,7 @@ */ #include "qemu/osdep.h" +#include "hw/misc/spoof.h" #include "qapi/error.h" #include "qemu/module.h" #include "hw/acpi/acpi.h" @@ -53,7 +54,8 @@ void vmgenid_build_acpi(VmGenIdState *vms, GArray *table_data, GArray *guid, build_append_named_dword(ssdt->buf, "VGIA"); scope = aml_scope("\\_SB"); dev = aml_device("VGEN"); - aml_append(dev, aml_name_decl("_HID", aml_string("QEMUVGID"))); + aml_append(dev, aml_name_decl("_HID", aml_string("%s", + spoof_vmgenid_policy() == SPOOF_VGID_MASK ? "MSFT0002" : "QEMUVGID"))); aml_append(dev, aml_name_decl("_CID", aml_string("VM_Gen_Counter"))); aml_append(dev, aml_name_decl("_DDN", aml_string("VM_Gen_Counter"))); diff --git a/hw/misc/pvpanic-isa.c b/hw/misc/pvpanic-isa.c index 85fb7da..4b6854e 100644 --- a/hw/misc/pvpanic-isa.c +++ b/hw/misc/pvpanic-isa.c @@ -13,6 +13,7 @@ */ #include "qemu/osdep.h" +#include "hw/misc/spoof.h" #include "qemu/module.h" #include "system/runstate.h" @@ -69,6 +70,10 @@ static void build_pvpanic_isa_aml(AcpiDevAmlIf *adev, Aml *scope) PVPanicISAState *s = PVPANIC_ISA_DEVICE(adev); Aml *dev = aml_device("PEVT"); + if (spoof_pvpanic_hide()) { /* qemu-spoof: omit the QEMU0001 _HID node */ + return; + } + aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0001"))); crs = aml_resource_template(); diff --git a/hw/nvram/fw_cfg-acpi.c b/hw/nvram/fw_cfg-acpi.c index 2e6ef89..8bb7be7 100644 --- a/hw/nvram/fw_cfg-acpi.c +++ b/hw/nvram/fw_cfg-acpi.c @@ -5,13 +5,14 @@ */ #include "qemu/osdep.h" +#include "hw/misc/spoof.h" #include "hw/nvram/fw_cfg_acpi.h" #include "hw/acpi/aml-build.h" void fw_cfg_acpi_dsdt_add(Aml *scope, const MemMapEntry *fw_cfg_memmap) { Aml *dev = aml_device("FWCF"); - aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002"))); + aml_append(dev, aml_name_decl("_HID", aml_string("%s", spoof_fwcfg_acpi_devid("QEMU0002")))); /* device present, functioning, decoding, not shown in UI */ aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); aml_append(dev, aml_name_decl("_CCA", aml_int(1)));