Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320426
b: refs/heads/master
c: 0f6f281
h: refs/heads/master
v: v3
  • Loading branch information
Martin Schwidefsky committed Jul 26, 2012
1 parent ea3f50d commit d75020b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8143adafd2d00b13f1db96ce06b6bf479e0bfe5b
refs/heads/master: 0f6f281b731d20bfe75c13f85d33f3f05b440222
14 changes: 13 additions & 1 deletion trunk/arch/s390/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <asm/uaccess.h>
#include <asm/tlbflush.h>
#include <asm/ctl_reg.h>
#include <asm-generic/mm_hooks.h>

static inline int init_new_context(struct task_struct *tsk,
struct mm_struct *mm)
Expand Down Expand Up @@ -91,4 +90,17 @@ static inline void activate_mm(struct mm_struct *prev,
switch_mm(prev, next, current);
}

static inline void arch_dup_mmap(struct mm_struct *oldmm,
struct mm_struct *mm)
{
#ifdef CONFIG_64BIT
if (oldmm->context.asce_limit < mm->context.asce_limit)
crst_table_downgrade(mm, oldmm->context.asce_limit);
#endif
}

static inline void arch_exit_mmap(struct mm_struct *mm)
{
}

#endif /* __S390_MMU_CONTEXT_H */
2 changes: 2 additions & 0 deletions trunk/arch/s390/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ struct stack_frame {
regs->psw.mask = psw_user_bits | PSW_MASK_BA; \
regs->psw.addr = new_psw | PSW_ADDR_AMODE; \
regs->gprs[15] = new_stackp; \
__tlb_flush_mm(current->mm); \
crst_table_downgrade(current->mm, 1UL << 31); \
update_mm(current->mm, current); \
} while (0)

/* Forward declaration, a strange C thing */
Expand Down
12 changes: 10 additions & 2 deletions trunk/arch/s390/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,15 @@ void arch_pick_mmap_layout(struct mm_struct *mm)

int s390_mmap_check(unsigned long addr, unsigned long len)
{
int rc;

if (!is_compat_task() &&
len >= TASK_SIZE && TASK_SIZE < (1UL << 53))
return crst_table_upgrade(current->mm, 1UL << 53);
len >= TASK_SIZE && TASK_SIZE < (1UL << 53)) {
rc = crst_table_upgrade(current->mm, 1UL << 53);
if (rc)
return rc;
update_mm(current->mm, current);
}
return 0;
}

Expand All @@ -125,6 +131,7 @@ s390_get_unmapped_area(struct file *filp, unsigned long addr,
rc = crst_table_upgrade(mm, 1UL << 53);
if (rc)
return (unsigned long) rc;
update_mm(mm, current);
area = arch_get_unmapped_area(filp, addr, len, pgoff, flags);
}
return area;
Expand All @@ -147,6 +154,7 @@ s390_get_unmapped_area_topdown(struct file *filp, const unsigned long addr,
rc = crst_table_upgrade(mm, 1UL << 53);
if (rc)
return (unsigned long) rc;
update_mm(mm, current);
area = arch_get_unmapped_area_topdown(filp, addr, len,
pgoff, flags);
}
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/s390/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,13 @@ int crst_table_upgrade(struct mm_struct *mm, unsigned long limit)
crst_table_free(mm, table);
if (mm->context.asce_limit < limit)
goto repeat;
update_mm(mm, current);
return 0;
}

void crst_table_downgrade(struct mm_struct *mm, unsigned long limit)
{
pgd_t *pgd;

if (mm->context.asce_limit <= limit)
return;
__tlb_flush_mm(mm);
while (mm->context.asce_limit > limit) {
pgd = mm->pgd;
switch (pgd_val(*pgd) & _REGION_ENTRY_TYPE_MASK) {
Expand All @@ -118,7 +114,6 @@ void crst_table_downgrade(struct mm_struct *mm, unsigned long limit)
mm->task_size = mm->context.asce_limit;
crst_table_free(mm, (unsigned long *) pgd);
}
update_mm(mm, current);
}
#endif

Expand Down

0 comments on commit d75020b

Please sign in to comment.