[PATCH 2/2] coreboot: add qemu detection

--- src/coreboot.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/coreboot.c b/src/coreboot.c index 120bc2e..2c8bd2d 100644 --- a/src/coreboot.c +++ b/src/coreboot.c @@ -14,6 +14,7 @@ #include "config.h" // CONFIG_* #include "acpi.h" // find_acpi_features #include "pci.h" // pci_probe_devices +#include "paravirt.h" // PlatformRunningOn /**************************************************************** @@ -165,6 +166,10 @@ coreboot_preinit(void) if (cbmb) { CBvendor = &cbmb->strings[cbmb->vendor_idx]; CBpart = &cbmb->strings[cbmb->part_idx]; + if (strcmp(CBvendor, "Emulation") == 0 && + strcmp(CBpart, "QEMU x86") == 0) { + PlatformRunningOn |= PF_QEMU; + } dprintf(1, "Found mainboard %s %s\n", CBvendor, CBpart); } -- 1.7.9.7

On 06/03/13 08:06, Gerd Hoffmann wrote:
--- src/coreboot.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/src/coreboot.c b/src/coreboot.c index 120bc2e..2c8bd2d 100644 --- a/src/coreboot.c +++ b/src/coreboot.c @@ -14,6 +14,7 @@ #include "config.h" // CONFIG_* #include "acpi.h" // find_acpi_features #include "pci.h" // pci_probe_devices +#include "paravirt.h" // PlatformRunningOn
/**************************************************************** @@ -165,6 +166,10 @@ coreboot_preinit(void) if (cbmb) { CBvendor = &cbmb->strings[cbmb->vendor_idx]; CBpart = &cbmb->strings[cbmb->part_idx]; + if (strcmp(CBvendor, "Emulation") == 0 && + strcmp(CBpart, "QEMU x86") == 0) { + PlatformRunningOn |= PF_QEMU; + } dprintf(1, "Found mainboard %s %s\n", CBvendor, CBpart); }
And if Kevin ACKs this, then I suppose we should set the same bit in src/csm.c (which is 32-bit flat), as early as possible, if the SMBIOS looks filled in by OVMF? Thanks Laszlo

On Mon, Jun 03, 2013 at 08:06:27AM +0200, Gerd Hoffmann wrote:
--- src/coreboot.c | 5 +++++ 1 file changed, 5 insertions(+)
Thanks - I pushed this change. -Kevin
participants (3)
-
Gerd Hoffmann
-
Kevin O'Connor
-
Laszlo Ersek