lkml.org 
[lkml]   [2014]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] x86: Allow kernel_map_pages_in_pgd() to work when NX is disabled
The function kernel_map_pages_in_pgd() will not map pages if NX is
disabled, which causes a lot of problems booting in EFI mode
(efi_map_region() and other functions depend on this). This patch
just makes sure that the NX flag doesn't get set in the page tables
if NX is disabled, rather than not mapping the pages at all.

Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
---
--- linux-3.16-rc3/arch/x86/mm/pageattr.c.orig 2014-07-02 12:04:49.244288159 -0400
+++ linux-3.16-rc3/arch/x86/mm/pageattr.c 2014-07-02 12:05:55.808290437 -0400
@@ -1862,10 +1862,7 @@ int kernel_map_pages_in_pgd(pgd_t *pgd,
.flags = 0,
};

- if (!(__supported_pte_mask & _PAGE_NX))
- goto out;
-
- if (!(page_flags & _PAGE_NX))
+ if ((!(__supported_pte_mask & _PAGE_NX)) || !(page_flags & _PAGE_NX))
cpa.mask_clr = __pgprot(_PAGE_NX);

cpa.mask_set = __pgprot(_PAGE_PRESENT | page_flags);


\
 
 \ /
  Last update: 2014-07-09 09:41    [W:0.050 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site