KVM: VMX: Cache vmcs segment fields

Since the emulator now checks segment limits and access rights, it
generates a lot more accesses to the vmcs segment fields.  Undo some
of the performance hit by cacheing those fields in a read-only cache
(the entire cache is invalidated on any write, or on guest exit).

Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Avi Kivity
2011-04-27 19:42:18 +03:00
parent 1aa366163b
commit 2fb92db1ec
2 changed files with 93 additions and 10 deletions

View File

@@ -136,6 +136,7 @@ enum kvm_reg_ex {
VCPU_EXREG_CR3,
VCPU_EXREG_RFLAGS,
VCPU_EXREG_CPL,
VCPU_EXREG_SEGMENTS,
};
enum {