Skip to contentSkip to conversation

s390: get 4 level pgds working.

PATCH New Martin Schwidefsky 1 participant 1 message Nov 11, 2004 s390

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390: get 4 level pgds working.

[patch] s390: get 4 level pgds working.

From: Martin Schwidefsky <[email protected]>

Replace mm->pgd with mm->pml4 in arch/s390 and add pte_read().

diffstat:

 arch/s390/kernel/process.c |    4 ++--
 include/asm-s390/pgtable.h |    7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)
arch/s390/kernel/process.c +2 -2
diff -urN linux-2.6/arch/s390/kernel/process.c linux-2.6-mm/arch/s390/kernel/process.c
@@ -261,14 +261,14 @@
 	save_fp_regs(&current->thread.fp_regs);
 	memcpy(&p->thread.fp_regs, &current->thread.fp_regs,
 	       sizeof(s390_fp_regs));
-        p->thread.user_seg = __pa((unsigned long) p->mm->pgd) | _SEGMENT_TABLE;
+        p->thread.user_seg = __pa((unsigned long) p->mm->pml4) | _SEGMENT_TABLE;
 	/* Set a new TLS ?  */
 	if (clone_flags & CLONE_SETTLS)
 		p->thread.acrs[0] = regs->gprs[6];
 #else /* CONFIG_ARCH_S390X */
 	/* Save the fpu registers to new thread structure. */
 	save_fp_regs(&p->thread.fp_regs);
-        p->thread.user_seg = __pa((unsigned long) p->mm->pgd) | _REGION_TABLE;
+        p->thread.user_seg = __pa((unsigned long) p->mm->pml4) | _REGION_TABLE;
 	/* Set a new TLS ?  */
 	if (clone_flags & CLONE_SETTLS) {
 		if (test_thread_flag(TIF_31BIT)) {
include/asm-s390/pgtable.h +7 -0
diff -urN linux-2.6/include/asm-s390/pgtable.h linux-2.6-mm/include/asm-s390/pgtable.h
@@ -398,6 +398,13 @@
 	return (pte_val(pte) & _PAGE_RO) == 0;
 }
 
+static inline int pte_read(pte_t pte)
+{
+	/* A present pte can always be used for reading.
+	 */
+	return 1;
+}
+
 extern inline int pte_dirty(pte_t pte)
 {
 	/* A pte is neither clean nor dirty on s/390. The dirty bit