Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a73c028 authored by Avi Kivity's avatar Avi Kivity
Browse files

KVM: Use kmalloc() instead of vmalloc() for KVM_[GS]ET_MSR



We don't need more than a page, and vmalloc() is slower (much
slower recently due to a regression).

Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 6aa0b9de
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1562,7 +1562,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,

	r = -ENOMEM;
	size = sizeof(struct kvm_msr_entry) * msrs.nmsrs;
	entries = vmalloc(size);
	entries = kmalloc(size, GFP_KERNEL);
	if (!entries)
		goto out;

@@ -1581,7 +1581,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
	r = n;

out_free:
	vfree(entries);
	kfree(entries);
out:
	return r;
}