From 54bd7c510ba027763130eaeb09004ef5780c06e6 Mon Sep 17 00:00:00 2001 From: Stefan Kristiansson Date: Fri, 12 Oct 2012 09:38:18 +0300 Subject: openrisc: avoid using function parameter regs in reset vector The kernel might be invoked through the reset vector, so to preserve parameters passed to it, temp regs that are not in the function parameter range needs to be used. Signed-off-by: Stefan Kristiansson Signed-off-by: Jonas Bonn --- arch/openrisc/kernel/head.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/openrisc/kernel') diff --git a/arch/openrisc/kernel/head.S b/arch/openrisc/kernel/head.S index 1088b5fca3bd..46aa940ebd20 100644 --- a/arch/openrisc/kernel/head.S +++ b/arch/openrisc/kernel/head.S @@ -291,9 +291,9 @@ /* Jump to .init code at _start which lives in the .head section * and will be discarded after boot. */ - LOAD_SYMBOL_2_GPR(r4, _start) - tophys (r3,r4) /* MMU disabled */ - l.jr r3 + LOAD_SYMBOL_2_GPR(r15, _start) + tophys (r13,r15) /* MMU disabled */ + l.jr r13 l.nop /* ---[ 0x200: BUS exception ]------------------------------------------- */ -- cgit v1.2.3 From 7f81ea7e28c3e4e5b762111dc676b24152f85a3a Mon Sep 17 00:00:00 2001 From: Len Brown Date: Sun, 10 Feb 2013 00:58:20 -0500 Subject: openrisc idle: delete pm_idle pm_idle() on openrisc was dead code. Signed-off-by: Len Brown Cc: linux@lists.openrisc.net Signed-off-by: Jonas Bonn --- arch/openrisc/kernel/idle.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch/openrisc/kernel') diff --git a/arch/openrisc/kernel/idle.c b/arch/openrisc/kernel/idle.c index 7d618feb1b72..5e8a3b6d6bc6 100644 --- a/arch/openrisc/kernel/idle.c +++ b/arch/openrisc/kernel/idle.c @@ -39,11 +39,6 @@ void (*powersave) (void) = NULL; -static inline void pm_idle(void) -{ - barrier(); -} - void cpu_idle(void) { set_thread_flag(TIF_POLLING_NRFLAG); -- cgit v1.2.3 From a81252d75e14cc2cf0ee45078ef143562a0bc279 Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Thu, 14 Feb 2013 16:16:49 +0100 Subject: openrisc: fix up vmalloc page table loading vmalloc'ed pages are faulted into a process' page tables on demand. In order to facilitate this, do_page_fault needs to know whether it was called via a page fault exception or a TLB-miss exception. This patch adds a wrapper around the _x_page_fault_handler entry points that the TLB-miss exceptions can call into in order to have the relevant parameter set to satisfy do_page_fault. This fixes a bug and is "good enough" for now. That said, this whole handling of vmalloc needs to be audited for correctness at some point. Signed-off-by: Jonas Bonn --- arch/openrisc/kernel/entry.S | 14 ++++++++++++-- arch/openrisc/kernel/head.S | 6 ++---- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'arch/openrisc/kernel') diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S index 5e5b30601bbf..3de971224cfc 100644 --- a/arch/openrisc/kernel/entry.S +++ b/arch/openrisc/kernel/entry.S @@ -201,12 +201,17 @@ EXCEPTION_ENTRY(_bus_fault_handler) l.nop /* ---[ 0x300: Data Page Fault exception ]------------------------------- */ +EXCEPTION_ENTRY(_dtlb_miss_page_fault_handler) + l.and r5,r5,r0 + l.j 1f + l.nop EXCEPTION_ENTRY(_data_page_fault_handler) /* set up parameters for do_page_fault */ + l.ori r5,r0,0x300 // exception vector +1: l.addi r3,r1,0 // pt_regs /* r4 set be EXCEPTION_HANDLE */ // effective address of fault - l.ori r5,r0,0x300 // exception vector /* * __PHX__: TODO @@ -276,12 +281,17 @@ EXCEPTION_ENTRY(_data_page_fault_handler) l.nop /* ---[ 0x400: Insn Page Fault exception ]------------------------------- */ +EXCEPTION_ENTRY(_itlb_miss_page_fault_handler) + l.and r5,r5,r0 + l.j 1f + l.nop EXCEPTION_ENTRY(_insn_page_fault_handler) /* set up parameters for do_page_fault */ + l.ori r5,r0,0x400 // exception vector +1: l.addi r3,r1,0 // pt_regs /* r4 set be EXCEPTION_HANDLE */ // effective address of fault - l.ori r5,r0,0x400 // exception vector l.ori r6,r0,0x0 // !write access /* call fault.c handler in or32/mm/fault.c */ diff --git a/arch/openrisc/kernel/head.S b/arch/openrisc/kernel/head.S index 46aa940ebd20..b357e7f79aca 100644 --- a/arch/openrisc/kernel/head.S +++ b/arch/openrisc/kernel/head.S @@ -1069,8 +1069,7 @@ d_pte_not_present: EXCEPTION_LOAD_GPR4 EXCEPTION_LOAD_GPR5 EXCEPTION_LOAD_GPR6 - l.j _dispatch_do_dpage_fault - l.nop + EXCEPTION_HANDLE(_dtlb_miss_page_fault_handler) /* ==============================================[ ITLB miss handler ]=== */ ENTRY(itlb_miss_handler) @@ -1192,8 +1191,7 @@ i_pte_not_present: EXCEPTION_LOAD_GPR4 EXCEPTION_LOAD_GPR5 EXCEPTION_LOAD_GPR6 - l.j _dispatch_do_ipage_fault - l.nop + EXCEPTION_HANDLE(_itlb_miss_page_fault_handler) /* ==============================================[ boot tlb handlers ]=== */ -- cgit v1.2.3 From ae6fef1790512edde8776ee2a158b1e13d085f61 Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Fri, 15 Feb 2013 17:07:17 +0100 Subject: openrisc: really pass correct arg to schedule_tail Commit 287ad220cd8b5a9d29f71c78f6e4051093f051fc tried to set up the argument to schedule_tail, but ended up using TI_STACK which isn't a defined symbol. Sadly, the old openrisc compiler silently ignores this fact and it was first discovered now when building with an updated toolchain. Reported-by: Christian Svensson Signed-off-by: Jonas Bonn --- arch/openrisc/kernel/entry.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/openrisc/kernel') diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S index 3de971224cfc..e7fadc0234cd 100644 --- a/arch/openrisc/kernel/entry.S +++ b/arch/openrisc/kernel/entry.S @@ -1050,7 +1050,7 @@ ENTRY(_switch) * we are expected to have set up the arg to schedule_tail already, * hence we do so here unconditionally: */ - l.lwz r3,TI_STACK(r3) /* Load 'prev' as schedule_tail arg */ + l.lwz r3,TI_TASK(r3) /* Load 'prev' as schedule_tail arg */ l.jr r9 l.nop -- cgit v1.2.3 From 160d83781a32e94a1e337efd6722939001e62398 Mon Sep 17 00:00:00 2001 From: Stefan Kristiansson Date: Tue, 26 Feb 2013 07:36:29 +0100 Subject: openrisc: add missing header inclusion Prevents build issue with updated toolchain Reported-by: Jack Thomasson Tested-by: Christian Svensson Signed-off-by: Stefan Kristiansson Signed-off-by: Jonas Bonn --- arch/openrisc/kernel/head.S | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/openrisc/kernel') diff --git a/arch/openrisc/kernel/head.S b/arch/openrisc/kernel/head.S index b357e7f79aca..1d3c9c28ac25 100644 --- a/arch/openrisc/kernel/head.S +++ b/arch/openrisc/kernel/head.S @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3