aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>2012-08-20 22:59:12 -0400
committerAvi Kivity <avi@redhat.com>2012-08-22 08:08:52 -0400
commit037d92dc5d4691ae7cf44699c55ca83b1b441992 (patch)
treee3ec9d29b4312a11087c008551ea1ba54bdd7c13 /virt/kvm/kvm_main.c
parent67b29204c8c9ecb4b2799a06ab646eeb363a0fe6 (diff)
KVM: introduce gfn_to_pfn_memslot_atomic
It can instead of hva_to_pfn_atomic Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 7b94d70a323f..543f9b7e5aa2 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1102,12 +1102,6 @@ static pfn_t hva_to_pfn(unsigned long addr, bool atomic, bool *async,
1102 return pfn; 1102 return pfn;
1103} 1103}
1104 1104
1105pfn_t hva_to_pfn_atomic(unsigned long addr)
1106{
1107 return hva_to_pfn(addr, true, NULL, true, NULL);
1108}
1109EXPORT_SYMBOL_GPL(hva_to_pfn_atomic);
1110
1111static pfn_t __gfn_to_pfn(struct kvm *kvm, gfn_t gfn, bool atomic, bool *async, 1105static pfn_t __gfn_to_pfn(struct kvm *kvm, gfn_t gfn, bool atomic, bool *async,
1112 bool write_fault, bool *writable) 1106 bool write_fault, bool *writable)
1113{ 1107{
@@ -1155,6 +1149,14 @@ pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn)
1155 return hva_to_pfn(addr, false, NULL, true, NULL); 1149 return hva_to_pfn(addr, false, NULL, true, NULL);
1156} 1150}
1157 1151
1152pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn)
1153{
1154 unsigned long addr = gfn_to_hva_memslot(slot, gfn);
1155
1156 return hva_to_pfn(addr, true, NULL, true, NULL);
1157}
1158EXPORT_SYMBOL_GPL(gfn_to_pfn_memslot_atomic);
1159
1158int gfn_to_page_many_atomic(struct kvm *kvm, gfn_t gfn, struct page **pages, 1160int gfn_to_page_many_atomic(struct kvm *kvm, gfn_t gfn, struct page **pages,
1159 int nr_pages) 1161 int nr_pages)
1160{ 1162{