lkml.org 
[lkml]   [2012]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 07/10] KVM: introduce readonly_fault_pfn
On 07/17/2012 05:44 PM, Xiao Guangrong wrote:
> Introduce readonly_fault_pfn, in the later patch, it indicates failure
> when we try to get a writable pfn from the readonly memslot
>
> +
> inline int kvm_is_mmio_pfn(pfn_t pfn)
> {
> if (pfn_valid(pfn)) {
> @@ -949,13 +952,15 @@ EXPORT_SYMBOL_GPL(kvm_disable_largepages);
>
> int is_error_page(struct page *page)
> {
> - return page == bad_page || page == hwpoison_page || page == fault_page;
> + return page == bad_page || page == hwpoison_page || page == fault_page
> + || page == readonly_fault_page;

All those checks are slow, and get_page(fault_page) etc. isn't very
scalable.

We should move to ERR_PTR() etc. We could use ENOENT, EHWPOISON,
EFAULT, and EROFS for the above, or maybe there are better matches.

> }
> EXPORT_SYMBOL_GPL(is_error_page);
>
> int is_error_pfn(pfn_t pfn)
> {
> - return pfn == bad_pfn || pfn == hwpoison_pfn || pfn == fault_pfn;
> + return pfn == bad_pfn || pfn == hwpoison_pfn || pfn == fault_pfn
> + || pfn == readonly_fault_pfn;
> }

And a similar change here.
--
error compiling committee.c: too many arguments to function




\
 
 \ /
  Last update: 2012-07-19 13:01    [W:0.210 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site