Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/local_apic.c
| Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
| #include <x86/mca.h> | #include <x86/mca.h> | ||||
| #include <machine/md_var.h> | #include <machine/md_var.h> | ||||
| #include <machine/smp.h> | #include <machine/smp.h> | ||||
| #include <machine/specialreg.h> | #include <machine/specialreg.h> | ||||
| #include <x86/init.h> | #include <x86/init.h> | ||||
| #include <x86/kvm.h> | #include <x86/kvm.h> | ||||
| #include <contrib/xen/arch-x86/cpuid.h> | #include <contrib/xen/arch-x86/cpuid.h> | ||||
| #include <x86/bhyve.h> | #include <x86/bhyve.h> | ||||
| #include <dev/hyperv/vmbus/x86/hyperv_reg.h> | |||||
| #ifdef DDB | #ifdef DDB | ||||
| #include <sys/interrupt.h> | #include <sys/interrupt.h> | ||||
| #include <ddb/ddb.h> | #include <ddb/ddb.h> | ||||
| #endif | #endif | ||||
| #ifdef __amd64__ | #ifdef __amd64__ | ||||
| #define SDT_APIC SDT_SYSIGT | #define SDT_APIC SDT_SYSIGT | ||||
| ▲ Show 20 Lines • Show All 2,014 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| u_int regs[4]; | u_int regs[4]; | ||||
| /* Check if we support extended destination IDs. */ | /* Check if we support extended destination IDs. */ | ||||
| switch (vm_guest) { | switch (vm_guest) { | ||||
| case VM_GUEST_XEN: | case VM_GUEST_XEN: | ||||
| cpuid_count(hv_base + 4, 0, regs); | cpuid_count(hv_base + 4, 0, regs); | ||||
| if (regs[0] & XEN_HVM_CPUID_EXT_DEST_ID) | if (regs[0] & XEN_HVM_CPUID_EXT_DEST_ID) | ||||
| apic_ext_dest_id = 1; | |||||
| break; | |||||
| case VM_GUEST_HV: | |||||
| cpuid_count(CPUID_LEAF_HV_STACK_INTERFACE, 0, regs); | |||||
| if (regs[0] != HYPERV_STACK_INTERFACE_EAX_SIG) | |||||
| break; | |||||
| cpuid_count(CPUID_LEAF_HV_STACK_PROPERTIES, 0, regs); | |||||
| if (regs[0] & HYPERV_PROPERTIES_EXT_DEST_ID) | |||||
| apic_ext_dest_id = 1; | apic_ext_dest_id = 1; | ||||
| break; | break; | ||||
| case VM_GUEST_KVM: | case VM_GUEST_KVM: | ||||
| kvm_cpuid_get_features(regs); | kvm_cpuid_get_features(regs); | ||||
| if (regs[0] & KVM_FEATURE_MSI_EXT_DEST_ID) | if (regs[0] & KVM_FEATURE_MSI_EXT_DEST_ID) | ||||
| apic_ext_dest_id = 1; | apic_ext_dest_id = 1; | ||||
| break; | break; | ||||
| case VM_GUEST_BHYVE: | case VM_GUEST_BHYVE: | ||||
| ▲ Show 20 Lines • Show All 259 Lines • Show Last 20 Lines | |||||