diff options
author | Eddie Dong <eddie.dong@intel.com> | 2007-09-06 05:22:56 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:25 -0400 |
commit | 96ad2cc6132479aa0aea485d0838a13fda765bd5 (patch) | |
tree | dc3596b92981332cee0749004b7076a7d52a90b1 /include | |
parent | 6bf9e962d14deb9e460afbbfd83ea2f450325c2d (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')
-rw-r--r-- | include/linux/kvm.h | 8 |
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 { | |||
208 | __u32 pad2; | 208 | __u32 pad2; |
209 | }; | 209 | }; |
210 | 210 | ||
211 | /* for KVM_GET_LAPIC and KVM_SET_LAPIC */ | ||
212 | #define KVM_APIC_REG_SIZE 0x400 | ||
213 | struct kvm_lapic_state { | ||
214 | char regs[KVM_APIC_REG_SIZE]; | ||
215 | }; | ||
216 | |||
211 | struct kvm_segment { | 217 | struct kvm_segment { |
212 | __u64 base; | 218 | __u64 base; |
213 | __u32 limit; | 219 | __u32 limit; |
@@ -380,5 +386,7 @@ struct kvm_signal_mask { | |||
380 | #define KVM_SET_SIGNAL_MASK _IOW(KVMIO, 0x8b, struct kvm_signal_mask) | 386 | #define KVM_SET_SIGNAL_MASK _IOW(KVMIO, 0x8b, struct kvm_signal_mask) |
381 | #define KVM_GET_FPU _IOR(KVMIO, 0x8c, struct kvm_fpu) | 387 | #define KVM_GET_FPU _IOR(KVMIO, 0x8c, struct kvm_fpu) |
382 | #define KVM_SET_FPU _IOW(KVMIO, 0x8d, struct kvm_fpu) | 388 | #define KVM_SET_FPU _IOW(KVMIO, 0x8d, struct kvm_fpu) |
389 | #define KVM_GET_LAPIC _IOR(KVMIO, 0x8e, struct kvm_lapic_state) | ||
390 | #define KVM_SET_LAPIC _IOW(KVMIO, 0x8f, struct kvm_lapic_state) | ||
383 | 391 | ||
384 | #endif | 392 | #endif |