aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-02-28 20:46:53 +0200
committerAvi Kivity <avi@qumranet.com>2007-05-03 10:52:23 +0300
commit06465c5a3aa9948a7b00af49cd22ed8f235cdb0f (patch)
tree2a21941ae6f28445abbb3cc80dd3416cf2241b8d /include
parent46fc1477887c41c8e900f2c95485e222b9a54822 (diff)
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 'include')
-rw-r--r--include/linux/kvm.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 19aeb338518..15e23bc06e8 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -41,7 +41,6 @@ enum kvm_exit_reason {
KVM_EXIT_UNKNOWN = 0,
KVM_EXIT_EXCEPTION = 1,
KVM_EXIT_IO = 2,
- KVM_EXIT_CPUID = 3,
KVM_EXIT_DEBUG = 4,
KVM_EXIT_HLT = 5,
KVM_EXIT_MMIO = 6,
@@ -210,6 +209,22 @@ struct kvm_dirty_log {
};
};
+struct kvm_cpuid_entry {
+ __u32 function;
+ __u32 eax;
+ __u32 ebx;
+ __u32 ecx;
+ __u32 edx;
+ __u32 padding;
+};
+
+/* for KVM_SET_CPUID */
+struct kvm_cpuid {
+ __u32 nent;
+ __u32 padding;
+ struct kvm_cpuid_entry entries[0];
+};
+
#define KVMIO 0xAE
/*
@@ -243,5 +258,6 @@ struct kvm_dirty_log {
#define KVM_DEBUG_GUEST _IOW(KVMIO, 9, struct kvm_debug_guest)
#define KVM_GET_MSRS _IOWR(KVMIO, 13, struct kvm_msrs)
#define KVM_SET_MSRS _IOW(KVMIO, 14, struct kvm_msrs)
+#define KVM_SET_CPUID _IOW(KVMIO, 17, struct kvm_cpuid)
#endif