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

[Xen-changelog] [xen stable-4.4] x86/EFI: fix EFI_MEMORY_WP handling



commit a7c37b2680f4e94c9de778195cad4c26315785a6
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Jun 18 09:37:12 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jun 18 09:37:12 2015 +0200

    x86/EFI: fix EFI_MEMORY_WP handling
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    
    Backport: Also fix EFI_MEMORY_XP handling (along the lines of what
    master commit abcf15fa8f ["x86: switch default mapping attributes
    to non-executable"] does): We must not set the NX bit when the CPU
    doesn't support it, as the bit being set may trigger Reserved Bit
    faults in that case.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: af23e79f46583abc18e8cffdec0b69297cfbdff0
    master date: 2015-06-10 12:01:35 +0200
---
 xen/arch/x86/efi/boot.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 98dd60f..8026d95 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -1621,8 +1621,8 @@ void __init efi_init_memory(void)
         }
 
         if ( desc->Attribute & EFI_MEMORY_WP )
-            prot &= _PAGE_RW;
-        if ( desc->Attribute & EFI_MEMORY_XP )
+            prot &= ~_PAGE_RW;
+        if ( (desc->Attribute & EFI_MEMORY_XP) && cpu_has_nx )
             prot |= _PAGE_NX_BIT;
 
         if ( pfn_to_pdx(emfn - 1) < (DIRECTMAP_SIZE >> PAGE_SHIFT) &&
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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