diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1317,7 +1317,8 @@ identify_cpu1(); identify_hypervisor(); - identify_hypervisor_smbios(); + if (vm_guest == VM_GUEST_NO || vm_guest == VM_GUEST_VM) + identify_hypervisor_smbios(); identify_cpu_fixup_bsp(); identify_cpu2(); initializecpucache(); diff --git a/sys/dev/smbios/smbios_subr.c b/sys/dev/smbios/smbios_subr.c --- a/sys/dev/smbios/smbios_subr.c +++ b/sys/dev/smbios/smbios_subr.c @@ -69,6 +69,10 @@ char *p; int i; + KASSERT(vm_guest == VM_GUEST_NO || vm_guest == VM_GUEST_VM, + ("SMBios hypervisor detection with specific type %d already detected", + vm_guest)); + /* * XXX: Some of these entries may not be needed since they were * added to FreeBSD before the checks above. diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1435,7 +1435,8 @@ } identify_hypervisor(); - identify_hypervisor_smbios(); + if (vm_guest == VM_GUEST_NO || vm_guest == VM_GUEST_VM) + identify_hypervisor_smbios(); /* Init basic tunables, hz etc */ init_param1();