15 #ifndef _ASM_X86_VIRTEX_H
16 #define _ASM_X86_VIRTEX_H
18 #include <asm/processor.h>
27 static inline int cpu_has_vmx(
void)
29 unsigned long ecx = cpuid_ecx(1);
40 static inline void cpu_vmxoff(
void)
42 asm volatile (ASM_VMX_VMXOFF : : :
"cc");
46 static inline int cpu_vmx_enabled(
void)
55 static inline void __cpu_emergency_vmxoff(
void)
57 if (cpu_vmx_enabled())
63 static inline void cpu_emergency_vmxoff(
void)
66 __cpu_emergency_vmxoff();
83 static inline int cpu_has_svm(
const char **
msg)
93 cpuid(0x80000000, &eax, &ebx, &ecx, &edx);
94 if (eax < SVM_CPUID_FUNC) {
96 *msg =
"can't execute cpuid_8000000a";
100 cpuid(0x80000001, &eax, &ebx, &ecx, &edx);
101 if (!(ecx & (1 << SVM_CPUID_FEATURE_SHIFT))) {
103 *msg =
"svm not available";
114 static inline void cpu_svm_disable(
void)
125 static inline void cpu_emergency_svm_disable(
void)
127 if (cpu_has_svm(
NULL))