summaryrefslogtreecommitdiff
path: root/include/linux/kvm.h
diff options
context:
space:
mode:
authorEddie Dong <eddie.dong@intel.com>2007-09-06 12:22:56 +0300
committerAvi Kivity <avi@qumranet.com>2007-10-13 10:18:25 +0200
commit96ad2cc6132479aa0aea485d0838a13fda765bd5 (patch)
treedc3596b92981332cee0749004b7076a7d52a90b1 /include/linux/kvm.h
parent6bf9e962d14deb9e460afbbfd83ea2f450325c2d (diff)
KVM: in-kernel LAPIC save and restore support
This patch adds a new vcpu-based IOCTL to save and restore the local apic registers for a single vcpu. The kernel only copies the apic page as a whole, extraction of registers is left to userspace side. On restore, the APIC timer is restarted from the initial count, this introduces a little delay, but works fine. Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/linux/kvm.h')
-rw-r--r--include/linux/kvm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 42d15150d7a3..30a83696906c 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -208,6 +208,12 @@ struct kvm_fpu {
__u32 pad2;
};
+/* for KVM_GET_LAPIC and KVM_SET_LAPIC */
+#define KVM_APIC_REG_SIZE 0x400
+struct kvm_lapic_state {
+ char regs[KVM_APIC_REG_SIZE];
+};
+
struct kvm_segment {
__u64 base;
__u32 limit;
@@ -380,5 +386,7 @@ struct kvm_signal_mask {
#define KVM_SET_SIGNAL_MASK _IOW(KVMIO, 0x8b, struct kvm_signal_mask)
#define KVM_GET_FPU _IOR(KVMIO, 0x8c, struct kvm_fpu)
#define KVM_SET_FPU _IOW(KVMIO, 0x8d, struct kvm_fpu)
+#define KVM_GET_LAPIC _IOR(KVMIO, 0x8e, struct kvm_lapic_state)
+#define KVM_SET_LAPIC _IOW(KVMIO, 0x8f, struct kvm_lapic_state)
#endif