LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/2] ARC: define __ALIGN_STR and __ALIGN symbols for ARC
@ 2020-03-11 16:26 Eugeniy Paltsev
  2020-03-11 16:26 ` [PATCH 2/2] ARC: don't align ret_from_exception function Eugeniy Paltsev
  2020-03-11 16:35 ` [PATCH 1/2] ARC: define __ALIGN_STR and __ALIGN symbols for ARC Vineet Gupta
  0 siblings, 2 replies; 7+ messages in thread
From: Eugeniy Paltsev @ 2020-03-11 16:26 UTC (permalink / raw)
  To: linux-snps-arc, Vineet Gupta
  Cc: linux-kernel, Alexey Brodkin, Eugeniy Paltsev

As of today ARC uses generic __ALIGN_STR and __ALIGN symbol
definitions from "include/linux/linkage.h"
They are defined to ".align 4,0x90" which instructed the assembler
to use `0x90` as a fill byte when aligning functions declared with
ENTRY or similar macroses. This leads to generated weird instructions
in code (when alignment is used) like "ldh_s r12,[r0,0x20]" which is
encoded as 0x9090 for ARCv2.

Let's use ".align 4" which insert a "nop_s" instruction instead.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 arch/arc/include/asm/linkage.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arc/include/asm/linkage.h b/arch/arc/include/asm/linkage.h
index d9ee43c6b7db..fe19f1d412e7 100644
--- a/arch/arc/include/asm/linkage.h
+++ b/arch/arc/include/asm/linkage.h
@@ -29,6 +29,8 @@
 .endm
 
 #define ASM_NL		 `	/* use '`' to mark new line in macro */
+#define __ALIGN		.align 4
+#define __ALIGN_STR	__stringify(__ALIGN)
 
 /* annotation for data we want in DCCM - if enabled in .config */
 .macro ARCFP_DATA nm
-- 
2.21.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-11 22:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 16:26 [PATCH 1/2] ARC: define __ALIGN_STR and __ALIGN symbols for ARC Eugeniy Paltsev
2020-03-11 16:26 ` [PATCH 2/2] ARC: don't align ret_from_exception function Eugeniy Paltsev
2020-03-11 17:38   ` 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

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).