projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6aa0b9d
)
KVM: Use kmalloc() instead of vmalloc() for KVM_[GS]ET_MSR
author
Avi Kivity
<avi@redhat.com>
Thu, 22 Jul 2010 20:24:52 +0000
(23:24 +0300)
committer
Avi Kivity
<avi@redhat.com>
Fri, 23 Jul 2010 06:07:14 +0000
(09:07 +0300)
We don't need more than a page, and vmalloc() is slower (much
slower recently due to a regression).
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/x86.c
patch
|
blob
|
blame
|
history
diff --git
a/arch/x86/kvm/x86.c
b/arch/x86/kvm/x86.c
index 05d571f6f19615cab8a90dec413e0a39537e914a..7fa89c39c64f67df0a62804cfa242ae6a2d6f638 100644
(file)
--- a/
arch/x86/kvm/x86.c
+++ b/
arch/x86/kvm/x86.c
@@
-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:
-
v
free(entries);
+
k
free(entries);
out:
return r;
}