Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356907
b: refs/heads/master
c: c08800a
h: refs/heads/master
i:
  356905: dc52c0b
  356903: 68e8d47
v: v3
  • Loading branch information
Dongxiao Xu authored and Marcelo Tosatti committed Feb 6, 2013
1 parent f463f72 commit c05bd4c
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 4293b5e5a68074431cafa74d549c1327ba1d0deb
refs/heads/master: c08800a56cb8622bb61577abb4a120c6fdc4b9be
8 changes: 8 additions & 0 deletions trunk/arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3227,6 +3227,14 @@ static int vmx_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
if (!is_paging(vcpu)) {
hw_cr4 &= ~X86_CR4_PAE;
hw_cr4 |= X86_CR4_PSE;
/*
* SMEP is disabled if CPU is in non-paging mode in
* hardware. However KVM always uses paging mode to
* emulate guest non-paging mode with TDP.
* To emulate this behavior, SMEP needs to be manually
* disabled when guest switches to non-paging mode.
*/
hw_cr4 &= ~X86_CR4_SMEP;
} else if (!(cr4 & X86_CR4_PAE)) {
hw_cr4 &= ~X86_CR4_PAE;
}
Expand Down

0 comments on commit c05bd4c

Please sign in to comment.