Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125235
b: refs/heads/master
c: 6aa07a0
h: refs/heads/master
i:
  125233: 4e4b98e
  125231: 6adb81c
v: v3
  • Loading branch information
Eduardo Habkost authored and Avi Kivity committed Dec 31, 2008
1 parent 08711e4 commit 7db2ad2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 710ff4a855d0f3bf74b5b4a20328e2858a8a2968
refs/heads/master: 6aa07a0d77f6aafbe69e4e8609ffaf2b7ee1b591
23 changes: 23 additions & 0 deletions trunk/arch/x86/include/asm/virtext.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,27 @@ static inline void cpu_vmxoff(void)
write_cr4(read_cr4() & ~X86_CR4_VMXE);
}

static inline int cpu_vmx_enabled(void)
{
return read_cr4() & X86_CR4_VMXE;
}

/** Disable VMX if it is enabled on the current CPU
*
* You shouldn't call this if cpu_has_vmx() returns 0.
*/
static inline void __cpu_emergency_vmxoff(void)
{
if (cpu_vmx_enabled())
cpu_vmxoff();
}

/** Disable VMX if it is supported and enabled on the current CPU
*/
static inline void cpu_emergency_vmxoff(void)
{
if (cpu_has_vmx())
__cpu_emergency_vmxoff();
}

#endif /* _ASM_X86_VIRTEX_H */

0 comments on commit 7db2ad2

Please sign in to comment.