diff options
author | Christoffer Dall <christoffer.dall@linaro.org> | 2014-08-19 06:15:00 -0400 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2014-08-27 16:46:08 -0400 |
commit | 64d831269ccbca1fc6d739a0f3c8aa24afb43a5e (patch) | |
tree | f31585ef953ddd09ab3327b79a9b0b406a089f8e /include/linux/kvm_host.h | |
parent | 7b46268d29543e313e731606d845e65c17f232e4 (diff) |
KVM: Introduce gfn_to_hva_memslot_prot
To support read-only memory regions on arm and arm64, we have a need to
resolve a gfn to an hva given a pointer to a memslot to avoid looping
through the memslots twice and to reuse the hva error checking of
gfn_to_hva_prot(), add a new gfn_to_hva_memslot_prot() function and
refactor gfn_to_hva_prot() to use this function.
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ebd723676633..6d8a658ec174 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -528,6 +528,8 @@ struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); | |||
528 | unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); | 528 | unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); |
529 | unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable); | 529 | unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable); |
530 | unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn); | 530 | unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn); |
531 | unsigned long gfn_to_hva_memslot_prot(struct kvm_memory_slot *slot, gfn_t gfn, | ||
532 | bool *writable); | ||
531 | void kvm_release_page_clean(struct page *page); | 533 | void kvm_release_page_clean(struct page *page); |
532 | void kvm_release_page_dirty(struct page *page); | 534 | void kvm_release_page_dirty(struct page *page); |
533 | void kvm_set_page_accessed(struct page *page); | 535 | void kvm_set_page_accessed(struct page *page); |