]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/include/asm/virtext.h
Merge branch 'x86/urgent' into x86/core
[linux-2.6-omap-h63xx.git] / arch / x86 / include / asm / virtext.h
index 6f0d409c3682078ae81fbdfdf1d2287cd4679458..59363627523844adf3f5802ae9e8521e521e1f98 100644 (file)
@@ -107,4 +107,26 @@ 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);
+}
+
+/** 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 */