aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-05-14 02:07:52 -0400
committerPaul Mundt <lethal@linux-sh.org>2012-05-14 02:07:52 -0400
commit9a7b7739f9dba4014fc93531e4c2b6efac41b0a7 (patch)
tree8f9f69de41c2b46f3c1e174e4b0676ca9f53dece /arch
parent5a1dc78a38bfb04159a08cd493e5b3d844939e6c (diff)
sh64: Utilize thread fault code encoding.
This plugs in fault code encoding for the sh64 page fault, too. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/kernel/cpu/sh5/entry.S20
-rw-r--r--arch/sh/mm/tlbflush_64.c12
2 files changed, 16 insertions, 16 deletions
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index 6b80295dd7a4..de60dc8d737d 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -1079,9 +1079,8 @@ restore_all:
1079 * 1079 *
1080 * Kernel TLB fault handlers will get a slightly different interface. 1080 * Kernel TLB fault handlers will get a slightly different interface.
1081 * (r2) struct pt_regs *, original register's frame pointer 1081 * (r2) struct pt_regs *, original register's frame pointer
1082 * (r3) writeaccess, whether it's a store fault as opposed to load fault 1082 * (r3) page fault error code (see asm/thread_info.h)
1083 * (r4) execaccess, whether it's a ITLB fault as opposed to DTLB fault 1083 * (r4) Effective Address of fault
1084 * (r5) Effective Address of fault
1085 * (LINK) return address 1084 * (LINK) return address
1086 * (SP) = r2 1085 * (SP) = r2
1087 * 1086 *
@@ -1092,26 +1091,25 @@ restore_all:
1092tlb_miss_load: 1091tlb_miss_load:
1093 or SP, ZERO, r2 1092 or SP, ZERO, r2
1094 or ZERO, ZERO, r3 /* Read */ 1093 or ZERO, ZERO, r3 /* Read */
1095 or ZERO, ZERO, r4 /* Data */ 1094 getcon TEA, r4
1096 getcon TEA, r5
1097 pta call_do_page_fault, tr0 1095 pta call_do_page_fault, tr0
1098 beq ZERO, ZERO, tr0 1096 beq ZERO, ZERO, tr0
1099 1097
1100tlb_miss_store: 1098tlb_miss_store:
1101 or SP, ZERO, r2 1099 or SP, ZERO, r2
1102 movi 1, r3 /* Write */ 1100 movi FAULT_CODE_WRITE, r3 /* Write */
1103 or ZERO, ZERO, r4 /* Data */ 1101 getcon TEA, r4
1104 getcon TEA, r5
1105 pta call_do_page_fault, tr0 1102 pta call_do_page_fault, tr0
1106 beq ZERO, ZERO, tr0 1103 beq ZERO, ZERO, tr0
1107 1104
1108itlb_miss_or_IRQ: 1105itlb_miss_or_IRQ:
1109 pta its_IRQ, tr0 1106 pta its_IRQ, tr0
1110 beqi/u r4, EVENT_INTERRUPT, tr0 1107 beqi/u r4, EVENT_INTERRUPT, tr0
1108
1109 /* ITLB miss */
1111 or SP, ZERO, r2 1110 or SP, ZERO, r2
1112 or ZERO, ZERO, r3 /* Read */ 1111 movi FAULT_CODE_ITLB, r3
1113 movi 1, r4 /* Text */ 1112 getcon TEA, r4
1114 getcon TEA, r5
1115 /* Fall through */ 1113 /* Fall through */
1116 1114
1117call_do_page_fault: 1115call_do_page_fault:
diff --git a/arch/sh/mm/tlbflush_64.c b/arch/sh/mm/tlbflush_64.c
index be01f92f8c89..99c5833036be 100644
--- a/arch/sh/mm/tlbflush_64.c
+++ b/arch/sh/mm/tlbflush_64.c
@@ -61,15 +61,17 @@ static pte_t *lookup_pte(struct mm_struct *mm, unsigned long address)
61 * and the problem, and then passes it off to one of the appropriate 61 * and the problem, and then passes it off to one of the appropriate
62 * routines. 62 * routines.
63 */ 63 */
64asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess, 64asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
65 unsigned long textaccess, unsigned long address) 65 unsigned long address)
66{ 66{
67 struct task_struct *tsk; 67 struct task_struct *tsk;
68 struct mm_struct *mm; 68 struct mm_struct *mm;
69 struct vm_area_struct * vma; 69 struct vm_area_struct * vma;
70 const struct exception_table_entry *fixup; 70 const struct exception_table_entry *fixup;
71 int write = error_code & FAULT_CODE_WRITE;
72 int textaccess = error_code & FAULT_CODE_ITLB;
71 unsigned int flags = (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | 73 unsigned int flags = (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
72 (writeaccess ? FAULT_FLAG_WRITE : 0)); 74 (write ? FAULT_FLAG_WRITE : 0));
73 pte_t *pte; 75 pte_t *pte;
74 int fault; 76 int fault;
75 77
@@ -122,7 +124,7 @@ good_area:
122 if (!(vma->vm_flags & VM_EXEC)) 124 if (!(vma->vm_flags & VM_EXEC))
123 goto bad_area; 125 goto bad_area;
124 } else { 126 } else {
125 if (writeaccess) { 127 if (write) {
126 if (!(vma->vm_flags & VM_WRITE)) 128 if (!(vma->vm_flags & VM_WRITE))
127 goto bad_area; 129 goto bad_area;
128 } else { 130 } else {
@@ -239,7 +241,7 @@ no_context:
239 printk(KERN_ALERT "Unable to handle kernel paging request"); 241 printk(KERN_ALERT "Unable to handle kernel paging request");
240 printk(" at virtual address %08lx\n", address); 242 printk(" at virtual address %08lx\n", address);
241 printk(KERN_ALERT "pc = %08Lx%08Lx\n", regs->pc >> 32, regs->pc & 0xffffffff); 243 printk(KERN_ALERT "pc = %08Lx%08Lx\n", regs->pc >> 32, regs->pc & 0xffffffff);
242 die("Oops", regs, writeaccess); 244 die("Oops", regs, error_code);
243 do_exit(SIGKILL); 245 do_exit(SIGKILL);
244 246
245/* 247/*