aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>2012-08-20 23:01:50 -0400
committerAvi Kivity <avi@redhat.com>2012-08-22 08:08:59 -0400
commitca3a490c7de8472b514e2d635c052b1e0f8e1c9d (patch)
tree7deb6eabd240ba306b0e4a21f27195c4d906960d /virt
parent69552c295e3df1431801526b5b705a0e130c920d (diff)
KVM: introduce KVM_HVA_ERR_BAD
Then, remove bad_hva and inline kvm_is_error_hva Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index c89d1b5129e4..e3e1658c491d 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -931,17 +931,6 @@ void kvm_disable_largepages(void)
931} 931}
932EXPORT_SYMBOL_GPL(kvm_disable_largepages); 932EXPORT_SYMBOL_GPL(kvm_disable_largepages);
933 933
934static inline unsigned long bad_hva(void)
935{
936 return PAGE_OFFSET;
937}
938
939int kvm_is_error_hva(unsigned long addr)
940{
941 return addr == bad_hva();
942}
943EXPORT_SYMBOL_GPL(kvm_is_error_hva);
944
945struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn) 934struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn)
946{ 935{
947 return __gfn_to_memslot(kvm_memslots(kvm), gfn); 936 return __gfn_to_memslot(kvm_memslots(kvm), gfn);
@@ -988,7 +977,7 @@ static unsigned long gfn_to_hva_many(struct kvm_memory_slot *slot, gfn_t gfn,
988 gfn_t *nr_pages) 977 gfn_t *nr_pages)
989{ 978{
990 if (!slot || slot->flags & KVM_MEMSLOT_INVALID) 979 if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
991 return bad_hva(); 980 return KVM_HVA_ERR_BAD;
992 981
993 if (nr_pages) 982 if (nr_pages)
994 *nr_pages = slot->npages - (gfn - slot->base_gfn); 983 *nr_pages = slot->npages - (gfn - slot->base_gfn);