From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [PATCH 2/4] x86,xen: introduce x86_init.mapping.pagetable_reserve Date: Wed, 13 Apr 2011 11:28:22 -0700 Message-ID: <4DA5EB46.6090302@linux.intel.com> References: <1302607192-21355-2-git-send-email-stefano.stabellini@eu.citrix.com> <4DA48EA9.70109@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Stefano Stabellini Cc: Yinghai Lu , "linux-kernel@vger.kernel.org" , "xen-devel@lists.xensource.com" , "konrad.wilk@oracle.com" , "jeremy@goop.org" , "mingo@elte.hu" , "H. Peter Anvin" List-Id: xen-devel@lists.xenproject.org On 04/13/2011 03:35 AM, Stefano Stabellini wrote: > Yes, that would be ideal, but we cannot do that because we don't know > exactly where is pgt_buf_end before allocating the pagetable pages and > the pagetable pages need to be marked RO before being hooked into the > pagetable. This is why we mark the whole range RO and after the > pagetable allocation when we know for sure where is pgt_buf_end we > modify the range pgt_buf_end-pgt_buf_top to RW. The hell? You have to fill the pages before you hook them into the page tables anyway (this means writing!) and then you have to mark them RO as you add them to the page tables... anything else doesn't make any sense at all. -hpa