Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Dec 2020 13:14:48 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 166ceb6fd18b - More the arm64 early page tables and stack to .bss
Message-ID:  <202012231314.0BNDEmiw047719@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by andrew:

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

commit 166ceb6fd18ba315b66c8b712e04f9ded3b31277
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2020-12-23 08:05:21 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2020-12-23 13:10:23 +0000

    More the arm64 early page tables and stack to .bss
    
    This removes 806k from the kernel ELF file that is only needed while
    the kernel is running, not in the static file.
    
    Sponsored by:   Innovate UK
---
 sys/arm64/arm64/locore.S | 12 +++++++-----
 sys/conf/ldscript.arm64  |  7 ++++++-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S
index 6f8d007b2efa..6735ffe8900b 100644
--- a/sys/arm64/arm64/locore.S
+++ b/sys/arm64/arm64/locore.S
@@ -189,7 +189,7 @@ virtdone:
 .Lbss:
 	.quad	__bss_start
 .Lend:
-	.quad	_end
+	.quad	__bss_end
 
 #ifdef SMP
 /*
@@ -780,8 +780,12 @@ sctlr_clear:
 abort:
 	b abort
 
-	//.section .init_pagetable
-	.align 12 /* 4KiB aligned */
+	.align 3
+init_pt_va:
+	.quad pagetable		/* XXX: Keep page tables VA */
+
+	.section .init_pagetable, "aw", %nobits
+	.align PAGE_SHIFT
 	/*
 	 * 6 initial tables (in the following order):
 	 *           L2 for kernel (High addresses)
@@ -813,8 +817,6 @@ el2_pagetable:
 	.space	PAGE_SIZE
 
 	.globl init_pt_va
-init_pt_va:
-	.quad pagetable		/* XXX: Keep page tables VA */
 
 	.align	4
 initstack:
diff --git a/sys/conf/ldscript.arm64 b/sys/conf/ldscript.arm64
index 36af34589db9..3c4b77034725 100644
--- a/sys/conf/ldscript.arm64
+++ b/sys/conf/ldscript.arm64
@@ -112,8 +112,13 @@ SECTIONS
    *(.dynbss)
    *(.bss)
    *(COMMON)
+   . = ALIGN(8);
+   __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
+      out as we use it before the .bss section is cleared. */
+   *(.init_pagetable)
   }
-  . = ALIGN(8);
   _end = . ;
   PROVIDE (end = .);
   /* Stabs debugging sections.  */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012231314.0BNDEmiw047719>