summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2002-10-12 13:09:24 +1000
committerAnton Blanchard <anton@samba.org>2002-10-12 13:09:24 +1000
commit7159673ed2abfbdcdb3fdff4a7e958a770998227 (patch)
tree324c34c2c8939c84ac32020014c8fc3358a91925 /include
parentefc4b4580db56d9a377895938c18f0030a01e58c (diff)
ppc64: Fix pgd_index overflow in free_pgtables and move stack up to 2^41
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc64/a.out.h3
-rw-r--r--include/asm-ppc64/pgtable.h5
-rw-r--r--include/asm-ppc64/ppc32.h1
3 files changed, 4 insertions, 5 deletions
diff --git a/include/asm-ppc64/a.out.h b/include/asm-ppc64/a.out.h
index 797fbd0e14d5..7e2b95f3cdce 100644
--- a/include/asm-ppc64/a.out.h
+++ b/include/asm-ppc64/a.out.h
@@ -30,8 +30,7 @@ struct exec
#ifdef __KERNEL__
-/* 64-bit user address space is less PGDIR_SIZE due to pgd_index() bug. */
-#define STACK_TOP_USER64 (TASK_SIZE_USER64 - PGDIR_SIZE)
+#define STACK_TOP_USER64 (TASK_SIZE_USER64)
/* Give 32-bit user space a full 4G address space to live in. */
#define STACK_TOP_USER32 (TASK_SIZE_USER32)
diff --git a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h
index 03e4ece78907..80d3977cf73f 100644
--- a/include/asm-ppc64/pgtable.h
+++ b/include/asm-ppc64/pgtable.h
@@ -35,7 +35,7 @@
#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE)
-#define USER_PTRS_PER_PGD (TASK_SIZE_USER64 / PGDIR_SIZE)
+#define USER_PTRS_PER_PGD (1024)
#define FIRST_USER_PGD_NR 0
#define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
@@ -198,7 +198,8 @@ extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
* Find an entry in a page-table-directory. We combine the address region
* (the high order N bits) and the pgd portion of the address.
*/
-#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & (PTRS_PER_PGD -1))
+/* to avoid overflow in free_pgtables we dont use PTRS_PER_PGD here */
+#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & 0x7ff)
#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
diff --git a/include/asm-ppc64/ppc32.h b/include/asm-ppc64/ppc32.h
index 2f84579b2b4c..dd26d20232f1 100644
--- a/include/asm-ppc64/ppc32.h
+++ b/include/asm-ppc64/ppc32.h
@@ -119,7 +119,6 @@ typedef struct siginfo32 {
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
struct {
unsigned int _addr; /* faulting insn/memory ref. */
- int _trapno;
} _sigfault;
/* SIGPOLL */