diff options
-rw-r--r-- | arch/x86/kernel/i387.c | 1 | ||||
-rw-r--r-- | arch/x86/kvm/i8254.c | 3 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index 1f11f5ce668f..a46cb3522c0c 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c | |||
@@ -40,6 +40,7 @@ | |||
40 | 40 | ||
41 | static unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu; | 41 | static unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu; |
42 | unsigned int xstate_size; | 42 | unsigned int xstate_size; |
43 | EXPORT_SYMBOL_GPL(xstate_size); | ||
43 | unsigned int sig_xstate_ia32_size = sizeof(struct _fpstate_ia32); | 44 | unsigned int sig_xstate_ia32_size = sizeof(struct _fpstate_ia32); |
44 | static struct i387_fxsave_struct fx_scratch __cpuinitdata; | 45 | static struct i387_fxsave_struct fx_scratch __cpuinitdata; |
45 | 46 | ||
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 0fd6378981f4..ddeb2314b522 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c | |||
@@ -697,6 +697,7 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 flags) | |||
697 | pit->wq = create_singlethread_workqueue("kvm-pit-wq"); | 697 | pit->wq = create_singlethread_workqueue("kvm-pit-wq"); |
698 | if (!pit->wq) { | 698 | if (!pit->wq) { |
699 | mutex_unlock(&pit->pit_state.lock); | 699 | mutex_unlock(&pit->pit_state.lock); |
700 | kvm_free_irq_source_id(kvm, pit->irq_source_id); | ||
700 | kfree(pit); | 701 | kfree(pit); |
701 | return NULL; | 702 | return NULL; |
702 | } | 703 | } |
@@ -742,7 +743,7 @@ fail: | |||
742 | kvm_unregister_irq_mask_notifier(kvm, 0, &pit->mask_notifier); | 743 | kvm_unregister_irq_mask_notifier(kvm, 0, &pit->mask_notifier); |
743 | kvm_unregister_irq_ack_notifier(kvm, &pit_state->irq_ack_notifier); | 744 | kvm_unregister_irq_ack_notifier(kvm, &pit_state->irq_ack_notifier); |
744 | kvm_free_irq_source_id(kvm, pit->irq_source_id); | 745 | kvm_free_irq_source_id(kvm, pit->irq_source_id); |
745 | 746 | destroy_workqueue(pit->wq); | |
746 | kfree(pit); | 747 | kfree(pit); |
747 | return NULL; | 748 | return NULL; |
748 | } | 749 | } |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 25f19078b321..3a09c625d526 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -2387,7 +2387,7 @@ static void kvm_vcpu_ioctl_x86_get_xsave(struct kvm_vcpu *vcpu, | |||
2387 | if (cpu_has_xsave) | 2387 | if (cpu_has_xsave) |
2388 | memcpy(guest_xsave->region, | 2388 | memcpy(guest_xsave->region, |
2389 | &vcpu->arch.guest_fpu.state->xsave, | 2389 | &vcpu->arch.guest_fpu.state->xsave, |
2390 | sizeof(struct xsave_struct)); | 2390 | xstate_size); |
2391 | else { | 2391 | else { |
2392 | memcpy(guest_xsave->region, | 2392 | memcpy(guest_xsave->region, |
2393 | &vcpu->arch.guest_fpu.state->fxsave, | 2393 | &vcpu->arch.guest_fpu.state->fxsave, |
@@ -2405,7 +2405,7 @@ static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu, | |||
2405 | 2405 | ||
2406 | if (cpu_has_xsave) | 2406 | if (cpu_has_xsave) |
2407 | memcpy(&vcpu->arch.guest_fpu.state->xsave, | 2407 | memcpy(&vcpu->arch.guest_fpu.state->xsave, |
2408 | guest_xsave->region, sizeof(struct xsave_struct)); | 2408 | guest_xsave->region, xstate_size); |
2409 | else { | 2409 | else { |
2410 | if (xstate_bv & ~XSTATE_FPSSE) | 2410 | if (xstate_bv & ~XSTATE_FPSSE) |
2411 | return -EINVAL; | 2411 | return -EINVAL; |