From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] kvm: allow RO page when atomic && !write_fault Date: Tue, 22 Feb 2011 16:24:12 -0300 Message-ID: <20110222192412.GA7645@amt.cnet> References: <4D61E058.9080201@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "kvm@vger.kernel.org" , LKML , Avi Kivity To: Lai Jiangshan Return-path: Content-Disposition: inline In-Reply-To: <4D61E058.9080201@cn.fujitsu.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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 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.