diff options
author | Robert Mustacchi <rm@joyent.com> | 2011-06-14 10:46:47 -0700 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2011-06-14 10:46:47 -0700 |
commit | c7f8cae268f9864a7b21d9edf6f32bdd10b1075d (patch) | |
tree | 7023526eed743d9ea61e2805801f54202d8badb4 /kvm_x86.c | |
parent | c964cb0a6c4c02d2341d3a172197615879086eea (diff) | |
download | illumos-kvm-c7f8cae268f9864a7b21d9edf6f32bdd10b1075d.tar.gz |
HVM-367 Clean up KVM_SET_CPUID2
Diffstat (limited to 'kvm_x86.c')
-rw-r--r-- | kvm_x86.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1662,13 +1662,19 @@ is_efer_nx(void) } int -kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid) +kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, + int *rv, intptr_t arg) { + struct kvm_cpuid2 *id; + + id = (void *)arg; + if (cpuid->nent > KVM_MAX_CPUID_ENTRIES) return (E2BIG); - bcopy(cpuid->entries, vcpu->arch.cpuid_entries, - cpuid->nent * sizeof (struct kvm_cpuid_entry2)); + if (copyin(id->entries, vcpu->arch.cpuid_entries, + cpuid->nent * sizeof (struct kvm_cpuid_entry2)) < 0) + return (EFAULT); vcpu_load(vcpu); vcpu->arch.cpuid_nent = cpuid->nent; |