Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/vmbus/hyperv.c
Show All 32 Lines | |||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/timetc.h> | #include <sys/timetc.h> | ||||
#include <machine/md_var.h> | |||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_extern.h> | #include <vm/vm_extern.h> | ||||
#include <vm/vm_kern.h> | #include <vm/vm_kern.h> | ||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <dev/hyperv/include/hyperv.h> | #include <dev/hyperv/include/hyperv.h> | ||||
#include <dev/hyperv/include/hyperv_busdma.h> | #include <dev/hyperv/include/hyperv_busdma.h> | ||||
#include <dev/hyperv/vmbus/hyperv_machdep.h> | #include <dev/hyperv/vmbus/hyperv_machdep.h> | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | hyperv_identify(void) | ||||
do_cpuid(CPUID_LEAF_HV_FEATURES, regs); | do_cpuid(CPUID_LEAF_HV_FEATURES, regs); | ||||
if ((regs[0] & CPUID_HV_MSR_HYPERCALL) == 0) { | if ((regs[0] & CPUID_HV_MSR_HYPERCALL) == 0) { | ||||
/* | /* | ||||
* Hyper-V w/o Hypercall is impossible; someone | * Hyper-V w/o Hypercall is impossible; someone | ||||
* is faking Hyper-V. | * is faking Hyper-V. | ||||
*/ | */ | ||||
return (false); | return (false); | ||||
} | } | ||||
if (efi_boot) | |||||
return (true); | |||||
hyperv_features = regs[0]; | hyperv_features = regs[0]; | ||||
hyperv_pm_features = regs[2]; | hyperv_pm_features = regs[2]; | ||||
hyperv_features3 = regs[3]; | hyperv_features3 = regs[3]; | ||||
do_cpuid(CPUID_LEAF_HV_IDENTITY, regs); | do_cpuid(CPUID_LEAF_HV_IDENTITY, regs); | ||||
hyperv_ver_major = regs[1] >> 16; | hyperv_ver_major = regs[1] >> 16; | ||||
printf("Hyper-V Version: %d.%d.%d [SP%d]\n", | printf("Hyper-V Version: %d.%d.%d [SP%d]\n", | ||||
hyperv_ver_major, regs[1] & 0xffff, regs[0], regs[2]); | hyperv_ver_major, regs[1] & 0xffff, regs[0], regs[2]); | ||||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |