diff options
author | Avi Kivity <avi@qumranet.com> | 2007-02-28 20:46:53 +0200 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-05-03 10:52:23 +0300 |
commit | 06465c5a3aa9948a7b00af49cd22ed8f235cdb0f (patch) | |
tree | 2a21941ae6f28445abbb3cc80dd3416cf2241b8d /drivers/kvm/kvm.h | |
parent | 46fc1477887c41c8e900f2c95485e222b9a54822 (diff) | |
download | kernel_samsung_aries-06465c5a3aa9948a7b00af49cd22ed8f235cdb0f.zip kernel_samsung_aries-06465c5a3aa9948a7b00af49cd22ed8f235cdb0f.tar.gz kernel_samsung_aries-06465c5a3aa9948a7b00af49cd22ed8f235cdb0f.tar.bz2 |
KVM: Handle cpuid in the kernel instead of punting to userspace
KVM used to handle cpuid by letting userspace decide what values to
return to the guest. We now handle cpuid completely in the kernel. We
still let userspace decide which values the guest will see by having
userspace set up the value table beforehand (this is necessary to allow
management software to set the cpu features to the least common denominator,
so that live migration can work).
The motivation for the change is that kvm kernel code can be impacted by
cpuid features, for example the x86 emulator.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r-- | drivers/kvm/kvm.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 59cbc5b..be3a0e7 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -55,6 +55,7 @@ #define KVM_NUM_MMU_PAGES 256 #define KVM_MIN_FREE_MMU_PAGES 5 #define KVM_REFILL_PAGES 25 +#define KVM_MAX_CPUID_ENTRIES 40 #define FX_IMAGE_SIZE 512 #define FX_IMAGE_ALIGN 16 @@ -286,6 +287,9 @@ struct kvm_vcpu { u32 ar; } tr, es, ds, fs, gs; } rmode; + + int cpuid_nent; + struct kvm_cpuid_entry cpuid_entries[KVM_MAX_CPUID_ENTRIES]; }; struct kvm_memory_slot { @@ -446,6 +450,7 @@ void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long value, struct x86_emulate_ctxt; +void kvm_emulate_cpuid(struct kvm_vcpu *vcpu); int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address); int emulate_clts(struct kvm_vcpu *vcpu); int emulator_get_dr(struct x86_emulate_ctxt* ctxt, int dr, |