From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, arc-linux-dev@synopsys.com,
Vineet Gupta <Vineet.Gupta1@synopsys.com>
Subject: [PATCH 09/19] ARC: entry.S: FAKE_RET_FROM_EXCPN can always use r9
Date: Sun, 7 Jun 2015 14:08:13 +0530 [thread overview]
Message-ID: <1433666303-26112-10-git-send-email-vgupta@synopsys.com> (raw)
In-Reply-To: <1433666303-26112-1-git-send-email-vgupta@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
arch/arc/include/asm/entry.h | 16 ++++++++--------
arch/arc/kernel/entry.S | 24 +++++++++++-------------
2 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/arch/arc/include/asm/entry.h b/arch/arc/include/asm/entry.h
index e880a5f1b2e4..c976b54c9b07 100644
--- a/arch/arc/include/asm/entry.h
+++ b/arch/arc/include/asm/entry.h
@@ -331,14 +331,14 @@
* Look at EV_ProtV to see how this is actually used
*-------------------------------------------------------------*/
-.macro FAKE_RET_FROM_EXCPN reg
-
- ld \reg, [sp, PT_status32]
- bic \reg, \reg, (STATUS_U_MASK|STATUS_DE_MASK)
- bset \reg, \reg, STATUS_L_BIT
- sr \reg, [erstatus]
- mov \reg, 55f
- sr \reg, [eret]
+.macro FAKE_RET_FROM_EXCPN
+
+ ld r9, [sp, PT_status32]
+ bic r9, r9, (STATUS_U_MASK|STATUS_DE_MASK)
+ bset r9, r9, STATUS_L_BIT
+ sr r9, [erstatus]
+ mov r9, 55f
+ sr r9, [eret]
rtie
55:
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S
index 6cced37e7a76..0a75f81e2853 100644
--- a/arch/arc/kernel/entry.S
+++ b/arch/arc/kernel/entry.S
@@ -261,7 +261,7 @@ ENTRY(instr_service)
lr r0, [efa]
mov r1, sp
- FAKE_RET_FROM_EXCPN r9
+ FAKE_RET_FROM_EXCPN
bl do_insterror_or_kprobe
b ret_from_exception
@@ -278,7 +278,7 @@ ENTRY(mem_service)
lr r0, [efa]
mov r1, sp
- FAKE_RET_FROM_EXCPN r9
+ FAKE_RET_FROM_EXCPN
bl do_memory_error
b ret_from_exception
@@ -330,12 +330,11 @@ ENTRY(EV_TLBProtV)
lr r2, [ecr]
lr r0, [efa] ; Faulting Data address
- ; --------(4) Return from CPU Exception Mode ---------
- ; Fake a rtie, but rtie to next label
- ; That way, subsequently, do_page_fault ( ) executes in pure kernel
- ; mode with further Exceptions enabled
+ ; Exception auto-disables further Intr/exceptions.
+ ; Re-enable them by pretending to return from exception
+ ; (so rest of handler executes in pure K mode)
- FAKE_RET_FROM_EXCPN r9
+ FAKE_RET_FROM_EXCPN
mov r1, sp
@@ -377,7 +376,7 @@ ENTRY(call_do_page_fault)
EXCEPTION_PROLOGUE
lr r0, [efa] ; Faulting Data address
mov r1, sp
- FAKE_RET_FROM_EXCPN r9
+ FAKE_RET_FROM_EXCPN
mov blink, ret_from_exception
b do_page_fault
@@ -394,7 +393,7 @@ ENTRY(EV_PrivilegeV)
lr r0, [efa]
mov r1, sp
- FAKE_RET_FROM_EXCPN r9
+ FAKE_RET_FROM_EXCPN
bl do_privilege_fault
b ret_from_exception
@@ -410,7 +409,7 @@ ENTRY(EV_Extension)
lr r0, [efa]
mov r1, sp
- FAKE_RET_FROM_EXCPN r9
+ FAKE_RET_FROM_EXCPN
bl do_extension_fault
b ret_from_exception
@@ -472,7 +471,7 @@ trap_with_param:
; Now that we have read EFA, it is safe to do "fake" rtie
; and get out of CPU exception mode
- FAKE_RET_FROM_EXCPN r11
+ FAKE_RET_FROM_EXCPN
; Save callee regs in case gdb wants to have a look
; SP will grow up by size of CALLEE Reg-File
@@ -512,8 +511,7 @@ ENTRY(EV_Trap)
; ======= (5a) Trap is due to System Call ========
- ; Before doing anything, return from CPU Exception Mode
- FAKE_RET_FROM_EXCPN r11
+ FAKE_RET_FROM_EXCPN
; If syscall tracing ongoing, invoke pre-pos-hooks
GET_CURR_THR_INFO_FLAGS r10
--
1.9.1
next prev parent reply other threads:[~2015-06-07 8:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-07 8:38 [PATCH 00/19] ARCv2 port to Linux - (A) prepratory patches Vineet Gupta
2015-06-07 8:38 ` [PATCH 01/19] ARC: mm/cache_arc700.c -> mm/cache.c Vineet Gupta
2015-06-07 8:38 ` [PATCH 02/19] ARC: cacheflush: move some code around, delete old comments Vineet Gupta
2015-06-07 8:38 ` [PATCH 03/19] ARC: cacheflush: No need to retain DC_CTRL from __before_dc_op() Vineet Gupta
2015-06-07 8:38 ` [PATCH 04/19] ARC: untangle cache flush loop Vineet Gupta
2015-06-07 8:38 ` [PATCH 05/19] ARC: entry.S: common'ize scrtach reg freeup in intr + exceptions Vineet Gupta
2015-06-07 8:38 ` [PATCH 06/19] ARC: entry.S: Introduce INTERRUPT_{PROLOGUE,EPILOGUE} Vineet Gupta
2015-06-07 8:38 ` [PATCH 07/19] ARC: entry.S: canonical'ize EXCEPTION_{PROLOGUE,EPILOGUE} Vineet Gupta
2015-06-07 8:38 ` [PATCH 08/19] ARC: entry.S: confine EXCEPTION_* macros to one file Vineet Gupta
2015-06-07 8:38 ` Vineet Gupta [this message]
2015-06-07 8:38 ` [PATCH 10/19] ARC: entry.S: Trap handler to use r10 for syscall vs. brkpt decision Vineet Gupta
2015-06-07 8:38 ` [PATCH 11/19] ARC: entry.S: comments cleanup Vineet Gupta
2015-06-07 8:38 ` [PATCH 12/19] ARC: entry.S: Ensure that restore_regs is local to compilation unit Vineet Gupta
2015-06-07 8:38 ` [PATCH 13/19] ARC: entry.S: split into ARCompact ISA specific, common bits Vineet Gupta
2015-06-07 8:38 ` [PATCH 14/19] ARC: entry.S: move some code around for cache locality in return path Vineet Gupta
2015-06-07 8:38 ` [PATCH 15/19] ARC: entry.S: micro-optimize Trap handler Vineet Gupta
2015-06-07 8:38 ` Vineet Gupta
2015-06-07 8:38 ` [PATCH 16/19] ARC: entry.S: use single EXCEPTION_PROLOGUE Vineet Gupta
2015-06-07 8:38 ` Vineet Gupta
2015-06-07 8:38 ` [PATCH 17/19] ARC: entry.S: [arcompact] simplify SWITCH_TO_KERNEL_STK Vineet Gupta
2015-06-07 8:38 ` [PATCH 18/19] ARC: Make way for pt_regs != user_regs_struct Vineet Gupta
2015-06-07 8:38 ` Vineet Gupta
2015-06-07 8:38 ` [PATCH 19/19] ARC: intc: split into ARCompact ISA specific, common bits Vineet Gupta
2015-06-07 8:47 ` [PATCH 00/19] ARCv2 port to Linux - (A) prepratory patches Vineet Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433666303-26112-10-git-send-email-vgupta@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=arc-linux-dev@synopsys.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).