projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6de1273
)
KVM: VMX: Optimize vmx_get_cpl()
author
Avi Kivity
<avi@redhat.com>
Mon, 7 Mar 2011 12:54:28 +0000
(14:54 +0200)
committer
Avi Kivity
<avi@redhat.com>
Wed, 11 May 2011 11:56:54 +0000
(07:56 -0400)
In long mode, vm86 mode is disallowed, so we need not check for
it. Reading rflags.vm may require a VMREAD, so it is expensive.
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/vmx.c
patch
|
blob
|
blame
|
history
diff --git
a/arch/x86/kvm/vmx.c
b/arch/x86/kvm/vmx.c
index 4d117072acf85040f0fab5b207c575c8cf2f4673..e8a35ee00735e5dac09a989016e0cf966f4eaad0 100644
(file)
--- a/
arch/x86/kvm/vmx.c
+++ b/
arch/x86/kvm/vmx.c
@@
-2120,7
+2120,8
@@
static int vmx_get_cpl(struct kvm_vcpu *vcpu)
if (!is_protmode(vcpu))
return 0;
- if (kvm_get_rflags(vcpu) & X86_EFLAGS_VM) /* if virtual 8086 */
+ if (!is_long_mode(vcpu)
+ && (kvm_get_rflags(vcpu) & X86_EFLAGS_VM)) /* if virtual 8086 */
return 3;
return vmcs_read16(GUEST_CS_SELECTOR) & 3;