git: f1bc3750cf9a - main - arm64: Use store-pair to zero the kernel bss

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Wed, 21 Aug 2024 10:19:35 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=f1bc3750cf9a6623b0c0861984ef2a8ac966a4e3

commit f1bc3750cf9a6623b0c0861984ef2a8ac966a4e3
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-08-20 17:14:28 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-08-21 10:16:10 +0000

    arm64: Use store-pair to zero the kernel bss
    
    While this won't be noticed by most users the time to zero the bss
    while using instruction tracing in the Arm FVP models (simulators) is
    noticeable.
    
    Reduce this time by using a store-pair instruction to double the size
    of memory we zero on each iteration of the loop.
    
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D42733
---
 sys/arm64/arm64/locore.S | 2 +-
 sys/conf/ldscript.arm64  | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S
index b71e02538716..ae1a005fd68f 100644
--- a/sys/arm64/arm64/locore.S
+++ b/sys/arm64/arm64/locore.S
@@ -111,7 +111,7 @@ virtdone:
 	ldr	x15, .Lbss
 	ldr	x14, .Lend
 1:
-	str	xzr, [x15], #8
+	stp	xzr, xzr, [x15], #16
 	cmp	x15, x14
 	b.lo	1b
 
diff --git a/sys/conf/ldscript.arm64 b/sys/conf/ldscript.arm64
index ea52a3128527..32af035105d0 100644
--- a/sys/conf/ldscript.arm64
+++ b/sys/conf/ldscript.arm64
@@ -121,6 +121,7 @@ SECTIONS
   .sdata     : { *(.sdata) }
   _edata  =  .;
   PROVIDE (edata = .);
+  . = ALIGN(16);
   __bss_start = .;
   .sbss      : { *(.sbss) *(.scommon) }
   .bss       :
@@ -128,7 +129,7 @@ SECTIONS
    *(.dynbss)
    *(.bss)
    *(COMMON)
-   . = ALIGN(8);
+   . = ALIGN(16);
    __bss_end = .;
    /* A section for the initial page table, it doesn't need to be in the
       kernel file, however unlike normal .bss entries should not be zeroed