diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2008-11-17 16:03:21 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-12-31 09:52:30 -0500 |
commit | 2c8dceebb238680d5577500f8283397d41ca5590 (patch) | |
tree | 5b96cfa8c5f89a79e0da1e8be91d5eb1a9b51fa4 /arch/x86/include | |
parent | 63d1142f8f69e39468bc6079ab2239e902828134 (diff) |
KVM: SVM: move svm_hardware_disable() code to asm/virtext.h
Create cpu_svm_disable() function.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/virtext.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/include/asm/virtext.h b/arch/x86/include/asm/virtext.h index 6f0d409c3682..2cfe363729c3 100644 --- a/arch/x86/include/asm/virtext.h +++ b/arch/x86/include/asm/virtext.h | |||
@@ -107,4 +107,18 @@ static inline int cpu_has_svm(const char **msg) | |||
107 | return 1; | 107 | return 1; |
108 | } | 108 | } |
109 | 109 | ||
110 | |||
111 | /** Disable SVM on the current CPU | ||
112 | * | ||
113 | * You should call this only if cpu_has_svm() returned true. | ||
114 | */ | ||
115 | static inline void cpu_svm_disable(void) | ||
116 | { | ||
117 | uint64_t efer; | ||
118 | |||
119 | wrmsrl(MSR_VM_HSAVE_PA, 0); | ||
120 | rdmsrl(MSR_EFER, efer); | ||
121 | wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK); | ||
122 | } | ||
123 | |||
110 | #endif /* _ASM_X86_VIRTEX_H */ | 124 | #endif /* _ASM_X86_VIRTEX_H */ |