Re: [PATCH] kvm: allow RO page when atomic && !write_fault

From: Marcelo Tosatti
Date: Tue Feb 22 2011 - 15:06:41 EST


On Mon, Feb 21, 2011 at 11:47:36AM +0800, Lai Jiangshan wrote:
>
> Atomic-able hva_to_pfn() patches and allow-read-only-page patches
> are merged almost the same time. But hva_to_pfn() does not handle
> these two issues well together.
>
> When @atomic && !@write_fault && host-is-read-only-page-mapped
> the code will return fault_page, actually, it will be better
> if we return the pfn of the read-only-page.
>
> Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>

Lai,

For pte prefetch, user of atomic hva_to_pfn, the write_fault parameter
is meaningless (since that information is only available for the pte
being faulted).

Returning fault page for a read-only page is useful so that pte prefetch
is aborted.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/