[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1367476850.5660.2.camel@nexus>
Date: Thu, 02 May 2013 15:40:50 +0900
From: Fernando Luis Vázquez Cao
<fernando_b1@....ntt.co.jp>
To: "H. Peter Anvin" <hpa@...ux.intel.com>,
Yinghai Lu <yinghai@...nel.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] x86, 64bit: do not assume CPU is NX capable when setting
early page tables
The kernel sets the NX bit in the early page tables without checking whether
the CPU actually supports this feature. If it doesn't the first attempt to use
them will cause a kernel hang. Since these are temporary page tables marked as
initdata this fix takes the approach of not bothering with the NX bit at all.
Noticed when my AMD machine that happened to have the NX feature disabled by
the BIOS failed to boot after the update to 3.9.
Cc: stable@...r.kernel.org
Signed-off-by: Fernando Luis Vazquez Cao <fernando@....ntt.co.jp>
---
diff -urNp linux-3.9/arch/x86/kernel/head64.c linux-3.9-fix/arch/x86/kernel/head64.c
--- linux-3.9/arch/x86/kernel/head64.c 2013-04-29 09:36:01.000000000 +0900
+++ linux-3.9-fix/arch/x86/kernel/head64.c 2013-05-02 14:38:52.589276092 +0900
@@ -99,7 +99,7 @@ again:
pmd_p[i] = 0;
*pud_p = (pudval_t)pmd_p - __START_KERNEL_map + phys_base + _KERNPG_TABLE;
}
- pmd = (physaddr & PMD_MASK) + (__PAGE_KERNEL_LARGE & ~_PAGE_GLOBAL);
+ pmd = (physaddr & PMD_MASK) + (__PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL);
pmd_p[pmd_index(address)] = pmd;
return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists