x86: cpu_emergency_svm_disable() function
authorEduardo Habkost <ehabkost@redhat.com>
Mon, 17 Nov 2008 21:03:22 +0000 (19:03 -0200)
committerAvi Kivity <avi@redhat.com>
Wed, 31 Dec 2008 14:52:30 +0000 (16:52 +0200)
This function can be used by the reboot or kdump code to forcibly
disable SVM on the CPU.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/include/asm/virtext.h

index 2cfe363729c3cc49f1cd1c4d0360d3c3d10ce136..59363627523844adf3f5802ae9e8521e521e1f98 100644 (file)
@@ -121,4 +121,12 @@ static inline void cpu_svm_disable(void)
        wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK);
 }
 
+/** Makes sure SVM is disabled, if it is supported on the CPU
+ */
+static inline void cpu_emergency_svm_disable(void)
+{
+       if (cpu_has_svm(NULL))
+               cpu_svm_disable();
+}
+
 #endif /* _ASM_X86_VIRTEX_H */