projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4eb64dc
)
KVM: reuse memslot in kvm_write_guest_page
author
Radim Krčmář
<rkrcmar@redhat.com>
Fri, 10 Apr 2015 19:47:27 +0000
(21:47 +0200)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Fri, 8 May 2015 08:51:38 +0000
(10:51 +0200)
Caching memslot value and using mark_page_dirty_in_slot() avoids another
O(log N) search when dirtying the page.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Message-Id: <
1428695247
-27603-1-git-send-email-rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c
patch
|
blob
|
blame
|
history
diff --git
a/virt/kvm/kvm_main.c
b/virt/kvm/kvm_main.c
index 90977418aeb6edfbf274c2260b48296638fd0762..b6d415156283625c7c3ec46dffc6bac48eb4899c 100644
(file)
--- a/
virt/kvm/kvm_main.c
+++ b/
virt/kvm/kvm_main.c
@@
-1590,15
+1590,17
@@
int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data,
int offset, int len)
{
int r;
+ struct kvm_memory_slot *memslot;
unsigned long addr;
- addr = gfn_to_hva(kvm, gfn);
+ memslot = gfn_to_memslot(kvm, gfn);
+ addr = gfn_to_hva_memslot(memslot, gfn);
if (kvm_is_error_hva(addr))
return -EFAULT;
r = __copy_to_user((void __user *)addr + offset, data, len);
if (r)
return -EFAULT;
- mark_page_dirty
(kvm
, gfn);
+ mark_page_dirty
_in_slot(kvm, memslot
, gfn);
return 0;
}
EXPORT_SYMBOL_GPL(kvm_write_guest_page);