From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: Xen MMU's requirement to pin pages RO and initial_memory_mapping. Date: Mon, 16 May 2011 14:54:39 -0700 Message-ID: <4DD19D1F.3070506@linux.intel.com> References: <20110513153010.GB16519@dumpdata.com> <20110516154132.GA12486@dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20110516154132.GA12486@dumpdata.com> Sender: linux-kernel-owner@vger.kernel.org To: Konrad Rzeszutek Wilk Cc: Stefano Stabellini , "yinghai@kernel.org" , "jeremy@goop.org" , "hpa@zytor.com" , Ian Campbell , "linux-kernel@vger.kernel.org" , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 05/16/2011 08:41 AM, Konrad Rzeszutek Wilk wrote: >> They become pagetable pages when: >> >> - they are explicitly pinned by pin_pagetable_pfn >> >> - they are hooked into the current pagetable > > Ok, so could we use those two calls to trigger the pagetable walk > and mark them RO as appropiate? Which call sites are those? The > xen_set_pgd/xen_set_pud/xen_set_pmd ? Presumarily we don't have > to do that for the PTE's that are already mapped (as > xen_setup_kernel_pagetable, and xen_map_identity_early do this > already). > >> Like you wrote, considering that the x86_64 version of >> kernel_physical_mapping_init hooks the pagetable pages into the >> currently used pagetable, it wouldn't be possible to mark the pagetable >> pages RO after init_memory_mapping. > Doesn't Xen have some kind of compatibility mode which could be used during setup? -hpa