[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4/4] x86/EFI: adjust EFI_MEMORY_WP handling for spec version 2.5



On Tue, Jun 09, 2015 at 10:08:56AM -0400, Konrad Rzeszutek Wilk wrote:
> .. ..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'?

<blushes> Please ignore that - I overlooked the movement
of the define up.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.