From e3e022151ba6d477593b9dd1f18082ae4b74d4d7 Mon Sep 17 00:00:00 2001 From: David Mosberger-Tang Date: Wed, 8 Jun 2005 10:45:00 -0700 Subject: [PATCH] --- yaml --- r: 1897 b: refs/heads/master c: ad597bd518559f59ede8d01262cdf4467e13282e h: refs/heads/master i: 1895: fb05e8479bdde70158874fa0a6283d1138e6b349 v: v3 --- [refs] | 2 +- trunk/arch/ia64/mm/init.c | 19 +++++++++++++++++-- trunk/include/asm-ia64/pgtable.h | 8 ++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 3dc096641e0b..d2a91457cc54 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2bfe94905d3601774c6418c020ba830c118578b4 +refs/heads/master: ad597bd518559f59ede8d01262cdf4467e13282e diff --git a/trunk/arch/ia64/mm/init.c b/trunk/arch/ia64/mm/init.c index 547785e3cba2..4eb2f52b87a1 100644 --- a/trunk/arch/ia64/mm/init.c +++ b/trunk/arch/ia64/mm/init.c @@ -305,8 +305,9 @@ setup_gate (void) struct page *page; /* - * Map the gate page twice: once read-only to export the ELF headers etc. and once - * execute-only page to enable privilege-promotion via "epc": + * Map the gate page twice: once read-only to export the ELF + * headers etc. and once execute-only page to enable + * privilege-promotion via "epc": */ page = virt_to_page(ia64_imva(__start_gate_section)); put_kernel_page(page, GATE_ADDR, PAGE_READONLY); @@ -315,6 +316,20 @@ setup_gate (void) put_kernel_page(page, GATE_ADDR + PAGE_SIZE, PAGE_GATE); #else put_kernel_page(page, GATE_ADDR + PERCPU_PAGE_SIZE, PAGE_GATE); + /* Fill in the holes (if any) with read-only zero pages: */ + { + unsigned long addr; + + for (addr = GATE_ADDR + PAGE_SIZE; + addr < GATE_ADDR + PERCPU_PAGE_SIZE; + addr += PAGE_SIZE) + { + put_kernel_page(ZERO_PAGE(0), addr, + PAGE_READONLY); + put_kernel_page(ZERO_PAGE(0), addr + PERCPU_PAGE_SIZE, + PAGE_READONLY); + } + } #endif ia64_patch_gate(); } diff --git a/trunk/include/asm-ia64/pgtable.h b/trunk/include/asm-ia64/pgtable.h index ea121a002309..fcc9c3344ab4 100644 --- a/trunk/include/asm-ia64/pgtable.h +++ b/trunk/include/asm-ia64/pgtable.h @@ -8,7 +8,7 @@ * This hopefully works with any (fixed) IA-64 page-size, as defined * in . * - * Copyright (C) 1998-2004 Hewlett-Packard Co + * Copyright (C) 1998-2005 Hewlett-Packard Co * David Mosberger-Tang */ @@ -551,7 +551,11 @@ do { \ /* These tell get_user_pages() that the first gate page is accessible from user-level. */ #define FIXADDR_USER_START GATE_ADDR -#define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) +#ifdef HAVE_BUGGY_SEGREL +# define FIXADDR_USER_END (GATE_ADDR + 2*PAGE_SIZE) +#else +# define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) +#endif #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY