aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2011-07-11 15:28:54 -0400
committerAvi Kivity <avi@redhat.com>2011-07-24 04:50:34 -0400
commitfce92dce79dbf5fff39c7ac2fb149729d79b7a39 (patch)
tree455461b843f5f94356786ea0e21132740458588a /include/linux/kvm_host.h
parentc37079586f317d7e7f1a70d36f0e5177691c89c2 (diff)
KVM: MMU: filter out the mmio pfn from the fault pfn
If the page fault is caused by mmio, the gfn can not be found in memslots, and 'bad_pfn' is returned on gfn_to_hva path, so we can use 'bad_pfn' to identify the mmio page fault. And, to clarify the meaning of mmio pfn, we return fault page instead of bad page when the gfn is not allowd to prefetch Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index c8e023902f7..eabb21a30c3 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -327,12 +327,17 @@ static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm)
327static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } 327static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; }
328 328
329extern struct page *bad_page; 329extern struct page *bad_page;
330extern struct page *fault_page;
331
330extern pfn_t bad_pfn; 332extern pfn_t bad_pfn;
333extern pfn_t fault_pfn;
331 334
332int is_error_page(struct page *page); 335int is_error_page(struct page *page);
333int is_error_pfn(pfn_t pfn); 336int is_error_pfn(pfn_t pfn);
334int is_hwpoison_pfn(pfn_t pfn); 337int is_hwpoison_pfn(pfn_t pfn);
335int is_fault_pfn(pfn_t pfn); 338int is_fault_pfn(pfn_t pfn);
339int is_noslot_pfn(pfn_t pfn);
340int is_invalid_pfn(pfn_t pfn);
336int kvm_is_error_hva(unsigned long addr); 341int kvm_is_error_hva(unsigned long addr);
337int kvm_set_memory_region(struct kvm *kvm, 342int kvm_set_memory_region(struct kvm *kvm,
338 struct kvm_userspace_memory_region *mem, 343 struct kvm_userspace_memory_region *mem,