summaryrefslogtreecommitdiff
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
parentefc4b4580db56d9a377895938c18f0030a01e58c (diff)
ppc64: Fix pgd_index overflow in free_pgtables and move stack up to 2^41
-rw-r--r--arch/ppc64/kernel/misc.S4
-rw-r--r--arch/ppc64/kernel/sys_ppc32.c2
-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
5 files changed, 7 insertions, 8 deletions
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index 79159b798f00..6a24f70a10cb 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -641,7 +641,7 @@ _GLOBAL(sys_call_table32)
.llong .sys_fchdir
.llong .sys_bdflush
.llong .sys32_sysfs /* 135 */
- .llong .sys32_personality
+ .llong .ppc64_personality
.llong .sys_ni_syscall /* for afs_syscall */
.llong .sys_setfsuid
.llong .sys_setfsgid
@@ -884,7 +884,7 @@ _GLOBAL(sys_call_table)
.llong .sys_fchdir
.llong .sys_bdflush
.llong .sys_sysfs /* 135 */
- .llong .sys_personality
+ .llong .ppc64_personality
.llong .sys_ni_syscall /* for afs_syscall */
.llong .sys_setfsuid
.llong .sys_setfsgid
diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
index cc6b9e4845f4..e42d3cae3c96 100644
--- a/arch/ppc64/kernel/sys_ppc32.c
+++ b/arch/ppc64/kernel/sys_ppc32.c
@@ -3680,7 +3680,7 @@ asmlinkage int ppc64_newuname(struct new_utsname * name)
extern asmlinkage long sys_personality(unsigned long);
-asmlinkage int sys32_personality(unsigned long personality)
+asmlinkage int ppc64_personality(unsigned long personality)
{
int ret;
if (current->personality == PER_LINUX32 && personality == PER_LINUX)
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 */