[RFC PATCH 11/13] ARC: head: elide ZOL

Sergey Matyukevich geomatsi at gmail.com
Tue Feb 22 06:15:04 PST 2022


From: Vineet Gupta <vgupta at kernel.org>

Add entry implementation based on double load/stores
if ZOL is not supported.

Signed-off-by: Vineet Gupta <vgupta at kernel.org>
---
 arch/arc/include/asm/asm-macro-ll64-emul.h | 3 +++
 arch/arc/include/asm/entry.h               | 2 ++
 arch/arc/kernel/head.S                     | 8 +++++++-
 arch/arc/kernel/vmlinux.lds.S              | 2 +-
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arc/include/asm/asm-macro-ll64-emul.h b/arch/arc/include/asm/asm-macro-ll64-emul.h
index 886320cc74ad..417c892d557e 100644
--- a/arch/arc/include/asm/asm-macro-ll64-emul.h
+++ b/arch/arc/include/asm/asm-macro-ll64-emul.h
@@ -15,6 +15,9 @@
 	.ifeqs	"\d", "r6"
 		st.ab	r7, [\s, \incr / 2]
 	.endif
+	.ifeqs	"\d", "0"
+		st.ab	\d, [\s, \incr / 2]
+	.endif
 .endm
 
 .macro LD64.ab d, s, incr
diff --git a/arch/arc/include/asm/entry.h b/arch/arc/include/asm/entry.h
index fcdd59d77f42..1bc9f730e1e2 100644
--- a/arch/arc/include/asm/entry.h
+++ b/arch/arc/include/asm/entry.h
@@ -7,6 +7,8 @@
 #ifndef __ASM_ARC_ENTRY_H
 #define __ASM_ARC_ENTRY_H
 
+#include <asm/asm-offsets.h>
+#include <asm/assembler.h>
 #include <asm/unistd.h>		/* For NR_syscalls defination */
 #include <asm/arcregs.h>
 #include <asm/ptrace.h>
diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
index 9152782444b5..17b5426d4ca4 100644
--- a/arch/arc/kernel/head.S
+++ b/arch/arc/kernel/head.S
@@ -121,13 +121,19 @@ ENTRY(stext)
 #endif
 
 	; Clear BSS before updating any globals
-	; XXX: use ZOL here
 	mov	r5, __bss_start
 	sub	r6, __bss_stop, r5
+#ifndef CONFIG_ARC_LACKS_ZOL
 	lsr.f	lp_count, r6, 2
 	lpnz	1f
 	st.ab   0, [r5, 4]
 1:
+#else
+	lsr	r6, r6, 3
+1:
+	ST64.ab	0, r5, 8
+	DBNZR	r6, 1b
+#endif
 
 	; Uboot - kernel ABI
 	;    r0 = [0] No uboot interaction, [1] cmdline in r2, [2] DTB in r2
diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S
index 529ae50f9fe2..00aeb89bd169 100644
--- a/arch/arc/kernel/vmlinux.lds.S
+++ b/arch/arc/kernel/vmlinux.lds.S
@@ -107,7 +107,7 @@ SECTIONS
 
 	_edata = .;
 
-	BSS_SECTION(4, 4, 4)
+	BSS_SECTION(8, 8, 8)
 
 #ifdef CONFIG_ARC_DW2_UNWIND
 	. = ALIGN(PAGE_SIZE);
-- 
2.25.1




More information about the linux-snps-arc mailing list