From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 4/4] x86/EFI: adjust EFI_MEMORY_WP handling for spec version 2.5 Date: Tue, 9 Jun 2015 10:08:57 -0400 Message-ID: <20150609140856.GG15200@x230> References: <55770B190200007800082A2C@mail.emea.novell.com> <55770C2D0200007800082A4B@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z2KDB-00084O-Qo for xen-devel@lists.xenproject.org; Tue, 09 Jun 2015 14:09:05 +0000 Content-Disposition: inline In-Reply-To: <55770C2D0200007800082A4B@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel List-Id: xen-devel@lists.xenproject.org . ..snip.. > @@ -1220,6 +1224,9 @@ void __init efi_init_memory(void) > prot |= _PAGE_PAT | MAP_SMALL_PAGES; > else if ( desc->Attribute & (EFI_MEMORY_UC | EFI_MEMORY_UCE) ) > prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES; > + else if ( efi_bs_revision >= EFI_REVISION(2, 5) && > + (desc->Attribute & EFI_MEMORY_WP) ) > + prot |= _PAGE_PAT | _PAGE_PWT | MAP_SMALL_PAGES; > else > { > printk(XENLOG_ERR "Unknown cachability for MFNs %#lx-%#lx%s\n", > @@ -1229,7 +1236,8 @@ void __init efi_init_memory(void) > prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES; > } > > - if ( desc->Attribute & EFI_MEMORY_WP ) > + if ( desc->Attribute & (efi_bs_revision < EFI_REVISION(2, 5) > + ? EFI_MEMORY_WP : EFI_MEMORY_RO) ) > prot &= ~_PAGE_RW; > if ( desc->Attribute & EFI_MEMORY_XP ) > prot |= _PAGE_NX; > --- a/xen/include/efi/efidef.h > +++ b/xen/include/efi/efidef.h > @@ -156,11 +156,15 @@ typedef enum { > #define EFI_MEMORY_WT 0x0000000000000004 > #define EFI_MEMORY_WB 0x0000000000000008 > #define EFI_MEMORY_UCE 0x0000000000000010 > +#define EFI_MEMORY_WP 0x0000000000001000 > > // physical memory protection on range > -#define EFI_MEMORY_WP 0x0000000000001000 You delete EFI_MEMORY_WP it here, but you use it in 'efi_init_memory'? > #define EFI_MEMORY_RP 0x0000000000002000 > #define EFI_MEMORY_XP 0x0000000000004000 > +#define EFI_MEMORY_RO 0x0000000000020000 > + > +#define EFI_MEMORY_NV 0x0000000000008000 > +#define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000 Those two are new (NV, MORE_RELIABLE), should they be part of a different patch? Or if they are part of the new spec just mention in the commit that you are adding it in for future use? > > // range requires a runtime mapping > #define EFI_MEMORY_RUNTIME 0x8000000000000000 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel