Re: [PATCH 00 of 10] x86: unify asm/pgtable.h

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeremy Fitzhardinge <jeremy@...>
Cc: LKML <linux-kernel@...>, Andi Kleen <ak@...>, Glauber de Oliveira Costa <glommer@...>, Jan Beulich <jbeulich@...>
Date: Tuesday, January 8, 2008 - 8:43 pm

* Ingo Molnar <mingo@elte.hu> wrote:


but then it crashes init:

 init[1]: segfault at ffffffffff600400 ip ffffffffff600400 sp 
 7fff81bedda8 error5printk: 7740690 messages suppressed.

because you changed __PAGE_KERNEL_VSYSCALL as well, from:

 #define __PAGE_KERNEL_VSYSCALL \
         (_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)

to:

 #define __PAGE_KERNEL_VSYSCALL          (__PAGE_KERNEL_RO | _PAGE_USER)

but __PAGE_KERNEL_RO is an NX one, so the vsyscall cannot execute 
instructions.

so this wants to be:

 #define __PAGE_KERNEL_VSYSCALL          (__PAGE_KERNEL_RX | _PAGE_USER)

this was the last bug and the resulting kernel boots fine. 3 nasty bugs 
in one patch :-/

	Ingo

---------------->
Subject: x86: move all asm/pgtable constants into one place, fix
From: Ingo Molnar <mingo@elte.hu>

fix.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/asm-x86/pgtable.h |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

Index: linux-x86.q/include/asm-x86/pgtable.h
===================================================================
--- linux-x86.q.orig/include/asm-x86/pgtable.h
+++ linux-x86.q/include/asm-x86/pgtable.h
@@ -68,27 +68,27 @@ extern unsigned long long __PAGE_KERNEL,
 #endif	/* __ASSEMBLER__ */
 #else
 #define __PAGE_KERNEL_EXEC						\
-	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL)
+	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
 #define __PAGE_KERNEL		(__PAGE_KERNEL_EXEC | _PAGE_NX)
 #endif
 
 #define __PAGE_KERNEL_RO		(__PAGE_KERNEL & ~_PAGE_RW)
 #define __PAGE_KERNEL_RX		(__PAGE_KERNEL_EXEC & ~_PAGE_RW)
 #define __PAGE_KERNEL_NOCACHE		(__PAGE_KERNEL | _PAGE_PCD | _PAGE_PWT)
-#define __PAGE_KERNEL_VSYSCALL		(__PAGE_KERNEL_RO | _PAGE_USER)
+#define __PAGE_KERNEL_VSYSCALL		(__PAGE_KERNEL_RX | _PAGE_USER)
 #define __PAGE_KERNEL_VSYSCALL_NOCACHE	(__PAGE_KERNEL_VSYSCALL | _PAGE_PCD | _PAGE_PWT)
 #define __PAGE_KERNEL_LARGE		(__PAGE_KERNEL | _PAGE_PSE)
 #define __PAGE_KERNEL_LARGE_EXEC	(__PAGE_KERNEL_EXEC | _PAGE_PSE)
 
-#define PAGE_KERNEL			__pgprot(__PAGE_KERNEL)
-#define PAGE_KERNEL_RO			__pgprot(__PAGE_KERNEL_RO)
-#define PAGE_KERNEL_EXEC		__pgprot(__PAGE_KERNEL_EXEC)
-#define PAGE_KERNEL_RX			__pgprot(__PAGE_KERNEL_RX)
-#define PAGE_KERNEL_NOCACHE		__pgprot(__PAGE_KERNEL_NOCACHE)
-#define PAGE_KERNEL_LARGE		__pgprot(__PAGE_KERNEL_LARGE)
-#define PAGE_KERNEL_LARGE_EXEC		__pgprot(__PAGE_KERNEL_LARGE_EXEC)
-#define PAGE_KERNEL_VSYSCALL		__pgprot(__PAGE_KERNEL_VSYSCALL)
-#define PAGE_KERNEL_VSYSCALL_NOCACHE	__pgprot(__PAGE_KERNEL_VSYSCALL_NOCACHE)
+#define PAGE_KERNEL			__pgprot(__PAGE_KERNEL | _PAGE_GLOBAL)
+#define PAGE_KERNEL_RO			__pgprot(__PAGE_KERNEL_RO | _PAGE_GLOBAL)
+#define PAGE_KERNEL_EXEC		__pgprot(__PAGE_KERNEL_EXEC | _PAGE_GLOBAL)
+#define PAGE_KERNEL_RX			__pgprot(__PAGE_KERNEL_RX | _PAGE_GLOBAL)
+#define PAGE_KERNEL_NOCACHE		__pgprot(__PAGE_KERNEL_NOCACHE | _PAGE_GLOBAL)
+#define PAGE_KERNEL_LARGE		__pgprot(__PAGE_KERNEL_LARGE | _PAGE_GLOBAL)
+#define PAGE_KERNEL_LARGE_EXEC		__pgprot(__PAGE_KERNEL_LARGE_EXEC | _PAGE_GLOBAL)
+#define PAGE_KERNEL_VSYSCALL		__pgprot(__PAGE_KERNEL_VSYSCALL | _PAGE_GLOBAL)
+#define PAGE_KERNEL_VSYSCALL_NOCACHE	__pgprot(__PAGE_KERNEL_VSYSCALL_NOCACHE | _PAGE_GLOBAL)
 
 /*         xwr */
 #define __P000	PAGE_NONE
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 6:42 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 7:12 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 7:23 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 7:28 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 8:07 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 7:44 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 8:01 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 8:13 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 8:20 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 8:28 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 8:30 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 8:53 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Andi Kleen, (Tue Jan 8, 9:11 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 8:59 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 9:07 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Andi Kleen, (Tue Jan 8, 9:12 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 9:35 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jan Beulich, (Wed Jan 9, 5:37 am)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Andi Kleen, (Tue Jan 8, 9:42 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 9:56 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Andi Kleen, (Tue Jan 8, 10:11 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Wed Jan 9, 6:47 am)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Andi Kleen, (Wed Jan 9, 10:26 am)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 11:22 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Wed Jan 9, 6:48 am)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 9:20 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 8:43 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 9:09 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 9:16 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 9:21 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 9:37 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Andi Kleen, (Tue Jan 8, 9:18 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 9:22 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Andi Kleen, (Tue Jan 8, 9:37 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Jeremy Fitzhardinge, (Tue Jan 8, 8:55 pm)
Re: [PATCH 00 of 10] x86: unify asm/pgtable.h, Ingo Molnar, (Tue Jan 8, 7:51 pm)
[PATCH 05 of 10] x86: page.h: make pte_t a union to always i..., Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)
[PATCH 02 of 10] x86: avoid name conflict for Voyager leave_mm, Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)
[PATCH 09 of 10] x86: unify paravirt pagetable accessors, Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)
[PATCH 10 of 10] xen: mask out PWT too, Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)
Re: [PATCH 10 of 10] xen: mask out PWT too, Jan Beulich, (Wed Jan 9, 5:17 am)
Re: [PATCH 10 of 10] xen: mask out PWT too, Jeremy Fitzhardinge, (Wed Jan 9, 3:04 pm)
[PATCH 08 of 10] x86: unify zero_page definition, Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)
[PATCH 06 of 10] x86/vmi: fix compilation as a result of pte..., Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)
[PATCH 04 of 10] x86: unify pgtable accessors which use supp..., Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)
[PATCH 07 of 10] x86: pgtable: unify pte accessors, Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)
[PATCH 01 of 10] x86: move all asm/pgtable constants into on..., Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)
[PATCH 03 of 10] x86/pgtable: unify pagetable accessors, Jeremy Fitzhardinge, (Tue Jan 8, 6:00 pm)