Loading arch/x86/include/asm/virtext.h +14 −0 Original line number Diff line number Diff line Loading @@ -107,4 +107,18 @@ static inline int cpu_has_svm(const char **msg) return 1; } /** Disable SVM on the current CPU * * You should call this only if cpu_has_svm() returned true. */ static inline void cpu_svm_disable(void) { uint64_t efer; wrmsrl(MSR_VM_HSAVE_PA, 0); rdmsrl(MSR_EFER, efer); wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK); } #endif /* _ASM_X86_VIRTEX_H */ arch/x86/kvm/svm.c +1 −5 Original line number Diff line number Diff line Loading @@ -259,11 +259,7 @@ static int has_svm(void) static void svm_hardware_disable(void *garbage) { uint64_t efer; wrmsrl(MSR_VM_HSAVE_PA, 0); rdmsrl(MSR_EFER, efer); wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK); cpu_svm_disable(); } static void svm_hardware_enable(void *garbage) Loading Loading
arch/x86/include/asm/virtext.h +14 −0 Original line number Diff line number Diff line Loading @@ -107,4 +107,18 @@ static inline int cpu_has_svm(const char **msg) return 1; } /** Disable SVM on the current CPU * * You should call this only if cpu_has_svm() returned true. */ static inline void cpu_svm_disable(void) { uint64_t efer; wrmsrl(MSR_VM_HSAVE_PA, 0); rdmsrl(MSR_EFER, efer); wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK); } #endif /* _ASM_X86_VIRTEX_H */
arch/x86/kvm/svm.c +1 −5 Original line number Diff line number Diff line Loading @@ -259,11 +259,7 @@ static int has_svm(void) static void svm_hardware_disable(void *garbage) { uint64_t efer; wrmsrl(MSR_VM_HSAVE_PA, 0); rdmsrl(MSR_EFER, efer); wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK); cpu_svm_disable(); } static void svm_hardware_enable(void *garbage) Loading