Julius Werner submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Julius Werner: Looks good to me, approved
libpayload: Move back the ttb_buffer section

Moving it into the .ttb_buffer section will accidentally set the LOAD
flag. So, move it back to .bss.ttb_buffer section to prevent the binary
size bloating.

BUG=b:248610274
TEST=Make sure the device is still bootable with this change.
BRANCH=none

Cq-Depend: chromium:5173448
Change-Id: I9bb08878dd4be01d9ed3f96933f774dd6296f76e
Signed-off-by: Yi Chou <yich@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79800
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M payloads/libpayload/arch/arm64/libpayload.ldscript
M payloads/libpayload/arch/arm64/mmu.c
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/payloads/libpayload/arch/arm64/libpayload.ldscript b/payloads/libpayload/arch/arm64/libpayload.ldscript
index c9881f7..4042e45 100644
--- a/payloads/libpayload/arch/arm64/libpayload.ldscript
+++ b/payloads/libpayload/arch/arm64/libpayload.ldscript
@@ -62,8 +62,6 @@
}

.bss : {
- *(.ttb_buffer)
-
_bss = .;
*(.sbss)
*(.sbss.*)
diff --git a/payloads/libpayload/arch/arm64/mmu.c b/payloads/libpayload/arch/arm64/mmu.c
index 5865b1b..9fc227d 100644
--- a/payloads/libpayload/arch/arm64/mmu.c
+++ b/payloads/libpayload/arch/arm64/mmu.c
@@ -41,8 +41,11 @@
static uint64_t *xlat_addr;

static int free_idx;
-static uint8_t ttb_buffer[TTB_DEFAULT_SIZE] __aligned(GRANULE_SIZE)
- __attribute__((__section__(".ttb_buffer")));
+
+/* We refer to this in the linker script for ChormeOS's depthcharge payload
+ * and to please not change the name without discussing with us.
+ * Please contact: jwerner@chromium.org or yich@chromium.org */
+static uint8_t ttb_buffer[TTB_DEFAULT_SIZE] __aligned(GRANULE_SIZE);

static const char * const tag_to_string[] = {
[TYPE_NORMAL_MEM] = "normal",

To view, visit change 79800. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I9bb08878dd4be01d9ed3f96933f774dd6296f76e
Gerrit-Change-Number: 79800
Gerrit-PatchSet: 6
Gerrit-Owner: Yi Chou <yich@google.com>
Gerrit-Reviewer: Julius Werner <jwerner@chromium.org>
Gerrit-Reviewer: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Yidi Lin <yidilin@google.com>
Gerrit-MessageType: merged