From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Xen MMU's requirement to pin pages RO and initial_memory_mapping. Date: Tue, 17 May 2011 14:17:16 -0400 Message-ID: <20110517181716.GA4490@dumpdata.com> References: <20110513153010.GB16519@dumpdata.com> <20110516154132.GA12486@dumpdata.com> <20110517180520.GC13706@dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20110517180520.GC13706@dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: "jeremy@goop.org" , "xen-devel@lists.xensource.com" , "linux-kernel@vger.kernel.org" , Ian Campbell , "hpa@zytor.com" , "hpa@linux.intel.com" , "yinghai@kernel.org" List-Id: xen-devel@lists.xenproject.org > > xen_alloc_pte_init and xen_alloc_pmd_init are the ones that mark the > > pagetable pages RO and pin them, calling make_lowmem_page_readonly and > > pin_pagetable_pfn. > > > > alloc_pte/pmd are called right before hooking them into the pagetable; > > unfortunately that means that they fail at marking the pagetable pages > > RO: make_lowmem_page_readonly uses lookup_address to find the pte > > corresponding to a page, however at this point the pagetable pages are > > not mapped yet (usually they are not hooked but when they are hooked, the > > upper level pagetable page is not hooked), so lookup_address fails. > > Right. We don't have to walk the hooked pagetable, I think. We are passed > in the PMD/PGD of the PFN and we could look at the content of that PFN. err, got that backwards. "passed in the PFN of the PMD/PGD".