Files
qemu-spoof/patches/0024-smbios-bios-type0.patch
T
lirent ec27a8f4e5 spoof: spoof-mode master fork (none/hyperv/vbs/physical) + microsoft-vm persona
Phase 0. Replace the spoof-hv knob with spoof-mode, a first-class selector modeled as
two axes (persona x presence) exposed as 4 presets:
- none: stock (spoof_on now requires mode != none, killing half-spoof states)
- hyperv: Microsoft Virtual Machine persona + Hyper-V presence (honest child VM)
- vbs (seeded default): real-OEM persona + Hyper-V presence (mimic physical Win11+VBS)
- physical: real-OEM persona + bare metal

Engine: spoof_mode()/spoof_persona_msvm()/spoof_presence_hyperv() in spoof-core; the
hv/waet/pvpanic/vmgenid policies now derive from the mode. microsoft-vm persona wired
across platform (ACPI OEM VRTUAL/MICROSFT, Microsoft Corporation), system type1
(Virtual Machine), storage (Virtual HD / Msft Virtual DVD-ROM) and EDID (MSF/Hyper-V).
New getters spoof_system_manufacturer/product (type1, real-OEM or Hyper-V). Patches:
0002 registers spoof-mode; 0024 now also forces type1 system identity. spoof-hv kept
as a back-compat alias. Inert without a seed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 23:15:15 +03:00

30 lines
1.7 KiB
Diff

qemu-spoof: SMBIOS type0 BIOS + type1 system identity
Stock QEMU leaves type0 vendor/version/date unset (guest reads an empty/firmware-
default "SeaBIOS" BIOS via WMI/dmidecode) and type1 system manufacturer/product fall
back to the bare machine values. Force the persona identity through smbios_set_defaults:
- real-OEM persona: vendor-formatted BIOS + board-brand system manufacturer/product;
- hyperv persona: Microsoft "Virtual Machine".
Config (-smbios) still wins; an un-seeded VM stays stock. (spoof.h include added by
0015-smbios-vm-bit.)
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 7d71418..8321f10 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -1027,6 +1027,15 @@ void smbios_set_defaults(const char *manufacturer, const char *product,
{
smbios_have_defaults = true;
+ /* qemu-spoof: a real OEM (or Hyper-V) BIOS + system identity. Stock leaves type0
+ * vendor/version/date unset (guest reads empty/"SeaBIOS") and type1 falls back to
+ * the bare machine manufacturer/product; force the persona's values. Platform-
+ * anchored; config (-smbios) still wins; inert without a seed. */
+ SMBIOS_SET_DEFAULT(smbios_type0.vendor, spoof_bios_vendor(NULL));
+ SMBIOS_SET_DEFAULT(smbios_type0.version, spoof_bios_version(NULL));
+ SMBIOS_SET_DEFAULT(smbios_type0.date, spoof_bios_date(NULL));
+ SMBIOS_SET_DEFAULT(smbios_type1.manufacturer, spoof_system_manufacturer(NULL));
+ SMBIOS_SET_DEFAULT(smbios_type1.product, spoof_system_product(NULL));
SMBIOS_SET_DEFAULT(smbios_type1.manufacturer, manufacturer);
SMBIOS_SET_DEFAULT(smbios_type1.product, product);
SMBIOS_SET_DEFAULT(smbios_type1.version, version);