[lkml]   [2008]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH 1/6] x86: fix NX bit handling in change_page_attr
    This patch fixes a bug of change_page_attr/change_page_attr_addr on
    Intel i386/x86_64 CPUs. After changing page attribute to be
    executable with these functions, the page remains un-executable on
    Intel i386/x86_64 CPU. Because on Intel i386/x86_64 CPU, only if the
    "NX" bits of all three level page tables are cleared (PAE is enabled),
    the corresponding page is executable (refer to section 4.13.2 of Intel
    64 and IA-32 Architectures Software Developer's Manual). So, the bug
    is fixed through clearing the "NX" bit of PMD when splitting the huge

    Signed-off-by: Huang Ying <>

    arch/x86/mm/pageattr.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/arch/x86/mm/pageattr.c
    +++ b/arch/x86/mm/pageattr.c
    @@ -124,6 +124,7 @@ static int split_large_page(pte_t *kpte,
    * Install the new, split up pagetable:
    + pgprot_val(ref_prot) &= ~_PAGE_NX;
    __set_pmd_pte(kpte, address, mk_pte(base, ref_prot));
    base = NULL;

     \ /
      Last update: 2008-01-25 06:57    [W:0.019 / U:23.656 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site