Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47971 )
Change subject: arch/x86: Top-align .text in bootblock ......................................................................
arch/x86: Top-align .text in bootblock
Change-Id: I64325bd633e1104853cfb928c7f801d94ff3045a Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/Kconfig M src/arch/x86/bootblock.ld 2 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/47971/1
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index f4ddd20..1ec0390 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -184,6 +184,9 @@ hex default 0x10000
+config FIXED_BOOTBLOCK_SIZE + bool + # Default address romstage is to be linked at config ROMSTAGE_ADDR hex diff --git a/src/arch/x86/bootblock.ld b/src/arch/x86/bootblock.ld index bb22413..52bccfc 100644 --- a/src/arch/x86/bootblock.ld +++ b/src/arch/x86/bootblock.ld @@ -14,6 +14,11 @@ SECTIONS { . = _ebootblock - CONFIG_C_ENV_BOOTBLOCK_SIZE;
+#if !CONFIG(FIXED_BOOTBLOCK_SIZE) + . = BOOTBLOCK_TOP - PROGRAM_SZ; + . = ALIGN(16); +#endif + _bootblock = .;
INCLUDE "bootblock/lib/program.ld" @@ -32,6 +37,7 @@ * may cause the total size of a section to change when the start * address gets applied. */ + PROGRAM_SZ = SIZEOF(.text) + 32; EARLYASM_SZ = SIZEOF(.init) + (CONFIG(SIPI_VECTOR_IN_ROM) ? 4096 : 16);
. = ID_SECTION;
Hello build bot (Jenkins), Julius Werner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47971
to look at the new patch set (#2).
Change subject: arch/x86: Top-align .text in bootblock ......................................................................
arch/x86: Top-align .text in bootblock
Change-Id: I64325bd633e1104853cfb928c7f801d94ff3045a Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/Kconfig M src/arch/x86/bootblock.ld 2 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/47971/2
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47971 )
Change subject: arch/x86: Top-align .text in bootblock ......................................................................
Patch Set 2: Code-Review+2
Hello build bot (Jenkins), Julius Werner, Arthur Heymans,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47971
to look at the new patch set (#6).
Change subject: arch/x86: Top-align .text in bootblock ......................................................................
arch/x86: Top-align .text in bootblock
Change-Id: I64325bd633e1104853cfb928c7f801d94ff3045a Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/Kconfig M src/arch/x86/bootblock.ld 2 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/47971/6
Hello build bot (Jenkins), Julius Werner, Arthur Heymans,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47971
to look at the new patch set (#7).
Change subject: arch/x86: Top-align .text in bootblock ......................................................................
arch/x86: Top-align .text in bootblock
Change-Id: I64325bd633e1104853cfb928c7f801d94ff3045a Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/Kconfig M src/arch/x86/bootblock.ld 2 files changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/47971/7
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47971 )
Change subject: arch/x86: Top-align .text in bootblock ......................................................................
Patch Set 8: Code-Review+2
Attention is currently required from: Kyösti Mälkki. Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47971 )
Change subject: arch/x86: Top-align .text in bootblock ......................................................................
Patch Set 10: -Code-Review
(1 comment)
File src/arch/x86/bootblock.ld:
https://review.coreboot.org/c/coreboot/+/47971/comment/f2d41f08_7025dc92 PS10, Line 17: #if !CONFIG(FIXED_BOOTBLOCK_SIZE) : . = BOOTBLOCK_TOP - PROGRAM_SZ; : . = ALIGN(16); : #endif This soverrides the 'sanity check' on the bootblock size, that it remains below CONFIG_C_ENV_BOOTBLOCK_SIZE (as required on some platforms: Intel/APL, Qemu/i440fx)
Hello build bot (Jenkins), Julius Werner, Arthur Heymans,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47971
to look at the new patch set (#11).
Change subject: arch/x86: Top-align .text in bootblock ......................................................................
arch/x86: Top-align .text in bootblock
Move .text section closer to .init. This reduces the size of the flat bootblock binary and footprint in CBFS.
Change-Id: I64325bd633e1104853cfb928c7f801d94ff3045a Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/Kconfig M src/arch/x86/bootblock.ld 2 files changed, 18 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/47971/11
Attention is currently required from: Kyösti Mälkki. Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47971 )
Change subject: arch/x86: Top-align .text in bootblock ......................................................................
Patch Set 11: Code-Review+2
(1 comment)
File src/arch/x86/bootblock.ld:
https://review.coreboot.org/c/coreboot/+/47971/comment/25f89ec7_3431de66 PS10, Line 17: #if !CONFIG(FIXED_BOOTBLOCK_SIZE) : . = BOOTBLOCK_TOP - PROGRAM_SZ; : . = ALIGN(16); : #endif
This soverrides the 'sanity check' on the bootblock size, that it remains below CONFIG_C_ENV_BOOTBLO […]
Done
Kyösti Mälkki has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47971 )
Change subject: arch/x86: Top-align .text in bootblock ......................................................................
arch/x86: Top-align .text in bootblock
Move .text section closer to .init. This reduces the size of the flat bootblock binary and footprint in CBFS.
Change-Id: I64325bd633e1104853cfb928c7f801d94ff3045a Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/47971 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/x86/Kconfig M src/arch/x86/bootblock.ld 2 files changed, 18 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index 4de8c96..943bb91 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -191,6 +191,9 @@ hex default 0x10000
+config FIXED_BOOTBLOCK_SIZE + bool + # Default address romstage is to be linked at config ROMSTAGE_ADDR hex diff --git a/src/arch/x86/bootblock.ld b/src/arch/x86/bootblock.ld index 6595262..3cd0900 100644 --- a/src/arch/x86/bootblock.ld +++ b/src/arch/x86/bootblock.ld @@ -12,12 +12,25 @@ #endif
SECTIONS { + +#if CONFIG(FIXED_BOOTBLOCK_SIZE) . = _ebootblock - CONFIG_C_ENV_BOOTBLOCK_SIZE; +#else + . = BOOTBLOCK_TOP - PROGRAM_SZ; + . = ALIGN(16); +#endif
_bootblock = .;
INCLUDE "bootblock/lib/program.ld"
+ /* + * Allocation reserves extra space here. Alignment requirements + * may cause the total size of a section to change when the start + * address gets applied. + */ + PROGRAM_SZ = SIZEOF(.text) + 512; + . = MIN(_ID_SECTION, _FIT_POINTER) - EARLYASM_SZ; . = CONFIG(SIPI_VECTOR_IN_ROM) ? ALIGN(4096) : ALIGN(16); BOOTBLOCK_TOP = .; @@ -66,3 +79,5 @@ _bogus1 = ASSERT(_bootblock & 0x80000000, "_bootblock too low, invalid ld script"); _bogus2 = ASSERT(_start16bit & 0x80000000, "_start16bit too low, invalid ld script"); _bogus3 = ASSERT(_start16bit >= 0xffff0000, "_start16bit too low. Please report."); +_bogus4 = ASSERT(_ebootblock - _bootblock <= CONFIG_C_ENV_BOOTBLOCK_SIZE, + "_bootblock too low, increase C_ENV_BOOTBLOCK_SIZE");