Commit 7159673e authored by Anton Blanchard's avatar Anton Blanchard

ppc64: Fix pgd_index overflow in free_pgtables and move stack up to 2^41

parent efc4b458
......@@ -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
......
......@@ -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)
......
......@@ -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)
......
......@@ -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))
......
......@@ -119,7 +119,6 @@ typedef struct siginfo32 {
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
struct {
unsigned int _addr; /* faulting insn/memory ref. */
int _trapno;
} _sigfault;
/* SIGPOLL */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment