From: Ian Campbell Subject: Re: [PATCH] xen/arm: define PAGE_HYPERVISOR as BUFFERABLE Date: Tue, 4 Jun 2013 14:44:38 +0100 Message-ID: <1370353478.24512.103.camel@zakaz.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Julien Grall , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Tue, 2013-06-04 at 14:29 +0100, Stefano Stabellini wrote: > On Fri, 10 May 2013, Stefano Stabellini wrote: > > Use stage 1 attribute indexes for PAGE_HYPERVISOR, the appriopriate one > > for normal memory hypervisor mappings would be BUFFERABLE. > > > > Signed-off-by: Stefano Stabellini > > > > diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h > > index fd6946e..13f76fc 100644 > > --- a/xen/include/asm-arm/page.h > > +++ b/xen/include/asm-arm/page.h > > @@ -58,7 +58,7 @@ > > #define DEV_WC BUFFERABLE > > #define DEV_CACHED WRITEBACK > > > > -#define PAGE_HYPERVISOR (MATTR_MEM) > > +#define PAGE_HYPERVISOR (BUFFERABLE) > > #define MAP_SMALL_PAGES PAGE_HYPERVISOR > > > > /* > > This patch is completely wrong, fortunately it hasn't been applied. Yes, it appears to have slipped through my net, sorry. (But good in this case!) > > Despite the name, BUFFERABLE means non-cacheable. Mapping a guest page > non-cacheable in the hypervisor would cause mismatch in memory > attributes. > > We should map the guest page as "normal memory", that is WRITEBACK. The hypervisor's own memory mappings are using WRITEALLOC not WRITEBACK (see mfn_to_xen_entry). Is one or the other wrong? > diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h > index fd6946e..13f76fc 100644 > --- a/xen/include/asm-arm/page.h > +++ b/xen/include/asm-arm/page.h > @@ -58,7 +58,7 @@ > #define DEV_WC BUFFERABLE > #define DEV_CACHED WRITEBACK > > -#define PAGE_HYPERVISOR (MATTR_MEM) > +#define PAGE_HYPERVISOR (WRITEBACK) > #define MAP_SMALL_PAGES PAGE_HYPERVISOR > > /*