diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2011-07-11 15:28:54 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-07-24 04:50:34 -0400 |
commit | fce92dce79dbf5fff39c7ac2fb149729d79b7a39 (patch) | |
tree | 455461b843f5f94356786ea0e21132740458588a /include | |
parent | c37079586f317d7e7f1a70d36f0e5177691c89c2 (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')
-rw-r--r-- | include/linux/kvm_host.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index c8e023902f79..eabb21a30c34 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) | |||
327 | static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } | 327 | static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } |
328 | 328 | ||
329 | extern struct page *bad_page; | 329 | extern struct page *bad_page; |
330 | extern struct page *fault_page; | ||
331 | |||
330 | extern pfn_t bad_pfn; | 332 | extern pfn_t bad_pfn; |
333 | extern pfn_t fault_pfn; | ||
331 | 334 | ||
332 | int is_error_page(struct page *page); | 335 | int is_error_page(struct page *page); |
333 | int is_error_pfn(pfn_t pfn); | 336 | int is_error_pfn(pfn_t pfn); |
334 | int is_hwpoison_pfn(pfn_t pfn); | 337 | int is_hwpoison_pfn(pfn_t pfn); |
335 | int is_fault_pfn(pfn_t pfn); | 338 | int is_fault_pfn(pfn_t pfn); |
339 | int is_noslot_pfn(pfn_t pfn); | ||
340 | int is_invalid_pfn(pfn_t pfn); | ||
336 | int kvm_is_error_hva(unsigned long addr); | 341 | int kvm_is_error_hva(unsigned long addr); |
337 | int kvm_set_memory_region(struct kvm *kvm, | 342 | int kvm_set_memory_region(struct kvm *kvm, |
338 | struct kvm_userspace_memory_region *mem, | 343 | struct kvm_userspace_memory_region *mem, |