diff options
| author | Steve French <sfrench@us.ibm.com> | 2010-05-14 11:15:28 -0400 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2010-05-14 11:15:28 -0400 |
| commit | 5f65f150fbc580ccfd57e5528e1fc905aaaef65c (patch) | |
| tree | 257527e3b5f8f04c39451f17481004d9e8d28350 /arch/x86/kvm/x86.c | |
| parent | baa456331738b4e76a92318b62b354377a30ad80 (diff) | |
| parent | 6a251b0ab67989f468f4cb65179e0cf40cf8c295 (diff) | |
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/x86/kvm/x86.c')
| -rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 3c4ca98ad27f..c4f35b545c1d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
| @@ -1712,6 +1712,7 @@ static int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu, | |||
| 1712 | if (copy_from_user(cpuid_entries, entries, | 1712 | if (copy_from_user(cpuid_entries, entries, |
| 1713 | cpuid->nent * sizeof(struct kvm_cpuid_entry))) | 1713 | cpuid->nent * sizeof(struct kvm_cpuid_entry))) |
| 1714 | goto out_free; | 1714 | goto out_free; |
| 1715 | vcpu_load(vcpu); | ||
| 1715 | for (i = 0; i < cpuid->nent; i++) { | 1716 | for (i = 0; i < cpuid->nent; i++) { |
| 1716 | vcpu->arch.cpuid_entries[i].function = cpuid_entries[i].function; | 1717 | vcpu->arch.cpuid_entries[i].function = cpuid_entries[i].function; |
| 1717 | vcpu->arch.cpuid_entries[i].eax = cpuid_entries[i].eax; | 1718 | vcpu->arch.cpuid_entries[i].eax = cpuid_entries[i].eax; |
| @@ -1729,6 +1730,7 @@ static int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu, | |||
| 1729 | r = 0; | 1730 | r = 0; |
| 1730 | kvm_apic_set_version(vcpu); | 1731 | kvm_apic_set_version(vcpu); |
| 1731 | kvm_x86_ops->cpuid_update(vcpu); | 1732 | kvm_x86_ops->cpuid_update(vcpu); |
| 1733 | vcpu_put(vcpu); | ||
| 1732 | 1734 | ||
| 1733 | out_free: | 1735 | out_free: |
| 1734 | vfree(cpuid_entries); | 1736 | vfree(cpuid_entries); |
| @@ -1749,9 +1751,11 @@ static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu, | |||
| 1749 | if (copy_from_user(&vcpu->arch.cpuid_entries, entries, | 1751 | if (copy_from_user(&vcpu->arch.cpuid_entries, entries, |
| 1750 | cpuid->nent * sizeof(struct kvm_cpuid_entry2))) | 1752 | cpuid->nent * sizeof(struct kvm_cpuid_entry2))) |
| 1751 | goto out; | 1753 | goto out; |
| 1754 | vcpu_load(vcpu); | ||
| 1752 | vcpu->arch.cpuid_nent = cpuid->nent; | 1755 | vcpu->arch.cpuid_nent = cpuid->nent; |
| 1753 | kvm_apic_set_version(vcpu); | 1756 | kvm_apic_set_version(vcpu); |
| 1754 | kvm_x86_ops->cpuid_update(vcpu); | 1757 | kvm_x86_ops->cpuid_update(vcpu); |
| 1758 | vcpu_put(vcpu); | ||
| 1755 | return 0; | 1759 | return 0; |
| 1756 | 1760 | ||
| 1757 | out: | 1761 | out: |
