Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197847
b: refs/heads/master
c: 8fbf065
h: refs/heads/master
i:
  197845: 18fbe94
  197843: bcf740d
  197839: 6b76f12
v: v3
  • Loading branch information
Avi Kivity committed May 19, 2010
1 parent 22397a7 commit ffa7941
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 98001d8d017cea1ee0f9f35c6227bbd63ef5005b
refs/heads/master: 8fbf065d625617bbbf6b72d5f78f84ad13c8b547
6 changes: 6 additions & 0 deletions trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
{
int r;

vcpu_load(vcpu);
r = -E2BIG;
if (cpuid->nent < vcpu->arch.cpuid_nent)
goto out;
Expand All @@ -1844,6 +1845,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,

out:
cpuid->nent = vcpu->arch.cpuid_nent;
vcpu_put(vcpu);
return r;
}

Expand Down Expand Up @@ -2134,6 +2136,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
int r;
unsigned bank_num = mcg_cap & 0xff, bank;

vcpu_load(vcpu);
r = -EINVAL;
if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS)
goto out;
Expand All @@ -2148,6 +2151,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
for (bank = 0; bank < bank_num; bank++)
vcpu->arch.mce_banks[bank*4] = ~(u64)0;
out:
vcpu_put(vcpu);
return r;
}

Expand Down Expand Up @@ -2456,7 +2460,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
r = -EFAULT;
if (copy_from_user(&mce, argp, sizeof mce))
goto out;
vcpu_load(vcpu);
r = kvm_vcpu_ioctl_x86_set_mce(vcpu, &mce);
vcpu_put(vcpu);
break;
}
case KVM_GET_VCPU_EVENTS: {
Expand Down

0 comments on commit ffa7941

Please sign in to comment.