aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2008-04-11 12:24:45 -0400
committerAvi Kivity <avi@qumranet.com>2008-04-27 11:21:16 -0400
commit62d9f0dbc92d7e398fde53fc6021338393522e68 (patch)
tree028e62807ead3db11f15694323743b90c8211ef8 /include
parenta45352908b88d383bc40e1e4d1a6cc5bbcefc895 (diff)
KVM: add ioctls to save/store mpstate
So userspace can save/restore the mpstate during migration. [avi: export the #define constants describing the value] [christian: add s390 stubs] [avi: ditto for ia64] Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/kvm_host.h5
-rw-r--r--include/linux/kvm.h15
-rw-r--r--include/linux/kvm_host.h4
3 files changed, 19 insertions, 5 deletions
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
index f35a6ad43c0a..9d963cd6533c 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -227,11 +227,6 @@ struct kvm_vcpu_arch {
227 u64 shadow_efer; 227 u64 shadow_efer;
228 u64 apic_base; 228 u64 apic_base;
229 struct kvm_lapic *apic; /* kernel irqchip context */ 229 struct kvm_lapic *apic; /* kernel irqchip context */
230#define KVM_MP_STATE_RUNNABLE 0
231#define KVM_MP_STATE_UNINITIALIZED 1
232#define KVM_MP_STATE_INIT_RECEIVED 2
233#define KVM_MP_STATE_SIPI_RECEIVED 3
234#define KVM_MP_STATE_HALTED 4
235 int mp_state; 230 int mp_state;
236 int sipi_vector; 231 int sipi_vector;
237 u64 ia32_misc_enable_msr; 232 u64 ia32_misc_enable_msr;
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index d302d63517e4..f8e211d8ce88 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -228,6 +228,18 @@ struct kvm_vapic_addr {
228 __u64 vapic_addr; 228 __u64 vapic_addr;
229}; 229};
230 230
231/* for KVM_SET_MPSTATE */
232
233#define KVM_MP_STATE_RUNNABLE 0
234#define KVM_MP_STATE_UNINITIALIZED 1
235#define KVM_MP_STATE_INIT_RECEIVED 2
236#define KVM_MP_STATE_HALTED 3
237#define KVM_MP_STATE_SIPI_RECEIVED 4
238
239struct kvm_mp_state {
240 __u32 mp_state;
241};
242
231struct kvm_s390_psw { 243struct kvm_s390_psw {
232 __u64 mask; 244 __u64 mask;
233 __u64 addr; 245 __u64 addr;
@@ -326,6 +338,7 @@ struct kvm_trace_rec {
326#define KVM_CAP_PIT 11 338#define KVM_CAP_PIT 11
327#define KVM_CAP_NOP_IO_DELAY 12 339#define KVM_CAP_NOP_IO_DELAY 12
328#define KVM_CAP_PV_MMU 13 340#define KVM_CAP_PV_MMU 13
341#define KVM_CAP_MP_STATE 14
329 342
330/* 343/*
331 * ioctls for VM fds 344 * ioctls for VM fds
@@ -387,5 +400,7 @@ struct kvm_trace_rec {
387#define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw) 400#define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw)
388/* initial reset for s390 */ 401/* initial reset for s390 */
389#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) 402#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97)
403#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state)
404#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state)
390 405
391#endif 406#endif
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 0bc400387cae..81d4c3305a28 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -237,6 +237,10 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
237 struct kvm_sregs *sregs); 237 struct kvm_sregs *sregs);
238int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, 238int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
239 struct kvm_sregs *sregs); 239 struct kvm_sregs *sregs);
240int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
241 struct kvm_mp_state *mp_state);
242int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
243 struct kvm_mp_state *mp_state);
240int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu, 244int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu,
241 struct kvm_debug_guest *dbg); 245 struct kvm_debug_guest *dbg);
242int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run); 246int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run);