linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
To: linux-snps-arc@lists.infradead.org,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>
Cc: linux-kernel@vger.kernel.org,
	Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
	Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Subject: [PATCH 2/2] ARC: don't align ret_from_exception function
Date: Wed, 11 Mar 2020 19:26:44 +0300	[thread overview]
Message-ID: <20200311162644.7667-2-Eugeniy.Paltsev@synopsys.com> (raw)
In-Reply-To: <20200311162644.7667-1-Eugeniy.Paltsev@synopsys.com>

ARC have a tricky implemented ret_from_exception function.
It is written on ASM and can be called like regular function.
However it has another 'entry point' as it can be called as a
continuation of EV_Trap function.

As we declare "ret_from_exception" using ENTRY macro it may align
"ret_from_exception" by 4 bytes by adding padding before it.
"ret_from_exception" doesn't require alignment by 4 bytes
(as it doesn't go to vector table, etc...) so let's avoid aligning
it by switch from ENTRY (which is alias for SYM_FUNC_START) to
SYM_FUNC_START_NOALIGN macro.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 arch/arc/kernel/entry-arcv2.S | 2 +-
 arch/arc/kernel/entry.S       | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arc/kernel/entry-arcv2.S b/arch/arc/kernel/entry-arcv2.S
index 12d5f12d10d2..d482e1507f56 100644
--- a/arch/arc/kernel/entry-arcv2.S
+++ b/arch/arc/kernel/entry-arcv2.S
@@ -260,4 +260,4 @@ debug_marker_ds:
 	sr	r11, [AUX_IRQ_ACT]
 	b	.Lexcept_ret
 
-END(ret_from_exception)
+SYM_FUNC_END(ret_from_exception)
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S
index 60406ec62eb8..79409b518a09 100644
--- a/arch/arc/kernel/entry.S
+++ b/arch/arc/kernel/entry.S
@@ -280,7 +280,7 @@ END(EV_Trap)
 ;
 ; If ret to user mode do we need to handle signals, schedule() et al.
 
-ENTRY(ret_from_exception)
+SYM_FUNC_START_NOALIGN(ret_from_exception)
 
 	; Pre-{IRQ,Trap,Exception} K/U mode from pt_regs->status32
 	ld  r8, [sp, PT_status32]   ; returning to User/Kernel Mode
@@ -373,4 +373,3 @@ resume_kernel_mode:
 	b	.Lrestore_regs
 
 ##### DONT ADD CODE HERE - .Lrestore_regs actually follows in entry-<isa>.S
-
-- 
2.21.1


  reply	other threads:[~2020-03-11 16:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 16:26 [PATCH 1/2] ARC: define __ALIGN_STR and __ALIGN symbols for ARC Eugeniy Paltsev
2020-03-11 16:26 ` Eugeniy Paltsev [this message]
2020-03-11 17:38   ` [PATCH 2/2] ARC: don't align ret_from_exception function Vineet Gupta
2020-03-11 20:58     ` Eugeniy Paltsev
2020-03-11 21:10       ` Vineet Gupta
2020-03-11 22:28         ` Eugeniy Paltsev
2020-03-11 16:35 ` [PATCH 1/2] ARC: define __ALIGN_STR and __ALIGN symbols for ARC 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=20200311162644.7667-2-Eugeniy.Paltsev@synopsys.com \
    --to=eugeniy.paltsev@synopsys.com \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.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).