summaryrefslogtreecommitdiff
path: root/kvm_x86.c
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2011-06-14 10:46:47 -0700
committerRobert Mustacchi <rm@joyent.com>2011-06-14 10:46:47 -0700
commitc7f8cae268f9864a7b21d9edf6f32bdd10b1075d (patch)
tree7023526eed743d9ea61e2805801f54202d8badb4 /kvm_x86.c
parentc964cb0a6c4c02d2341d3a172197615879086eea (diff)
downloadillumos-kvm-c7f8cae268f9864a7b21d9edf6f32bdd10b1075d.tar.gz
HVM-367 Clean up KVM_SET_CPUID2
Diffstat (limited to 'kvm_x86.c')
-rw-r--r--kvm_x86.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/kvm_x86.c b/kvm_x86.c
index 25d350d..17c6fe0 100644
--- a/kvm_x86.c
+++ b/kvm_x86.c
@@ -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;