diff options
author | Avi Kivity <avi@redhat.com> | 2010-12-05 11:56:11 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:31:16 -0500 |
commit | aff48baa34c033318ad322ecbf2e4bcd891b29ca (patch) | |
tree | 84955c55c812dd540cd0c54e5bdf6d3f5bfd08be /arch/x86/include/asm | |
parent | 9f8fe5043fd26627c2fa2e9a41896885e675000b (diff) |
KVM: Fetch guest cr3 from hardware on demand
Instead of syncing the guest cr3 every exit, which is expensince on vmx
with ept enabled, sync it only on demand.
[sheng: fix incorrect cr3 seen by Windows XP]
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 6268f6ce6434..95f026be8b5e 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -117,6 +117,7 @@ enum kvm_reg { | |||
117 | 117 | ||
118 | enum kvm_reg_ex { | 118 | enum kvm_reg_ex { |
119 | VCPU_EXREG_PDPTR = NR_VCPU_REGS, | 119 | VCPU_EXREG_PDPTR = NR_VCPU_REGS, |
120 | VCPU_EXREG_CR3, | ||
120 | }; | 121 | }; |
121 | 122 | ||
122 | enum { | 123 | enum { |
@@ -533,6 +534,7 @@ struct kvm_x86_ops { | |||
533 | struct kvm_segment *var, int seg); | 534 | struct kvm_segment *var, int seg); |
534 | void (*get_cs_db_l_bits)(struct kvm_vcpu *vcpu, int *db, int *l); | 535 | void (*get_cs_db_l_bits)(struct kvm_vcpu *vcpu, int *db, int *l); |
535 | void (*decache_cr0_guest_bits)(struct kvm_vcpu *vcpu); | 536 | void (*decache_cr0_guest_bits)(struct kvm_vcpu *vcpu); |
537 | void (*decache_cr3)(struct kvm_vcpu *vcpu); | ||
536 | void (*decache_cr4_guest_bits)(struct kvm_vcpu *vcpu); | 538 | void (*decache_cr4_guest_bits)(struct kvm_vcpu *vcpu); |
537 | void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0); | 539 | void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0); |
538 | void (*set_cr3)(struct kvm_vcpu *vcpu, unsigned long cr3); | 540 | void (*set_cr3)(struct kvm_vcpu *vcpu, unsigned long cr3); |