aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
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 /arch/x86/kvm/x86.c
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 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index b364d192896c..5c3c9d38c780 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -817,6 +817,7 @@ int kvm_dev_ioctl_check_extension(long ext)
817 case KVM_CAP_CLOCKSOURCE: 817 case KVM_CAP_CLOCKSOURCE:
818 case KVM_CAP_PIT: 818 case KVM_CAP_PIT:
819 case KVM_CAP_NOP_IO_DELAY: 819 case KVM_CAP_NOP_IO_DELAY:
820 case KVM_CAP_MP_STATE:
820 r = 1; 821 r = 1;
821 break; 822 break;
822 case KVM_CAP_VAPIC: 823 case KVM_CAP_VAPIC:
@@ -3083,6 +3084,24 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
3083 return 0; 3084 return 0;
3084} 3085}
3085 3086
3087int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
3088 struct kvm_mp_state *mp_state)
3089{
3090 vcpu_load(vcpu);
3091 mp_state->mp_state = vcpu->arch.mp_state;
3092 vcpu_put(vcpu);
3093 return 0;
3094}
3095
3096int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
3097 struct kvm_mp_state *mp_state)
3098{
3099 vcpu_load(vcpu);
3100 vcpu->arch.mp_state = mp_state->mp_state;
3101 vcpu_put(vcpu);
3102 return 0;
3103}
3104
3086static void set_segment(struct kvm_vcpu *vcpu, 3105static void set_segment(struct kvm_vcpu *vcpu,
3087 struct kvm_segment *var, int seg) 3106 struct kvm_segment *var, int seg)
3088{ 3107{