Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125237
b: refs/heads/master
c: 2c8dcee
h: refs/heads/master
i:
  125235: 7db2ad2
v: v3
  • Loading branch information
Eduardo Habkost authored and Avi Kivity committed Dec 31, 2008
1 parent b6f43fa commit 4732f8a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 63d1142f8f69e39468bc6079ab2239e902828134
refs/heads/master: 2c8dceebb238680d5577500f8283397d41ca5590
14 changes: 14 additions & 0 deletions trunk/arch/x86/include/asm/virtext.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
6 changes: 1 addition & 5 deletions trunk/arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4732f8a

Please sign in to comment.