Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 216744
b: refs/heads/master
c: 92f842e
h: refs/heads/master
v: v3
  • Loading branch information
Martin Schwidefsky authored and Martin Schwidefsky committed Oct 25, 2010
1 parent 923e86a commit 21827ec
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 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: 6931be0803ddae2791f3c646c8e1e0f82ca26013
refs/heads/master: 92f842eac7ee321c8a0749aba2513541b4ac226f
1 change: 1 addition & 0 deletions trunk/arch/s390/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
extern pgd_t swapper_pg_dir[] __attribute__ ((aligned (4096)));
extern void paging_init(void);
extern void vmem_map_init(void);
extern void fault_init(void);

/*
* The S390 doesn't have any external MMU info: the kernel page
Expand Down
21 changes: 18 additions & 3 deletions trunk/arch/s390/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@
#define VM_FAULT_BADMAP 0x020000
#define VM_FAULT_BADACCESS 0x040000

static unsigned long store_indication;

void fault_init(void)
{
unsigned long long facility_list[2];

if (stfle(facility_list, 2) < 2)
return;
if ((facility_list[0] & (1ULL << 61)) &&
(facility_list[1] & (1ULL << 52)))
store_indication = 0xc00;
}

static inline int notify_page_fault(struct pt_regs *regs)
{
int ret = 0;
Expand Down Expand Up @@ -294,7 +307,7 @@ static inline int do_exception(struct pt_regs *regs, int access,
struct mm_struct *mm;
struct vm_area_struct *vma;
unsigned long address;
int fault;
int fault, write;

if (notify_page_fault(regs))
return 0;
Expand Down Expand Up @@ -348,8 +361,10 @@ static inline int do_exception(struct pt_regs *regs, int access,
* make sure we exit gracefully rather than endlessly redo
* the fault.
*/
fault = handle_mm_fault(mm, vma, address,
(access == VM_WRITE) ? FAULT_FLAG_WRITE : 0);
write = (access == VM_WRITE ||
(trans_exc_code & store_indication) == 0x400) ?
FAULT_FLAG_WRITE : 0;
fault = handle_mm_fault(mm, vma, address, write);
if (unlikely(fault & VM_FAULT_ERROR))
goto out_up;

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/s390/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ void __init paging_init(void)
#endif
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
free_area_init_nodes(max_zone_pfns);
fault_init();
}

void __init mem_init(void)
Expand Down

0 comments on commit 21827ec

Please sign in to comment.