Comment 5 for bug 1996071

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2022-11-10 10:24 EDT-------
(In reply to comment #8)
> In the focal master-next tree file 'vmlinux.lds.S' is at a different
> location: 'arch/s390/boot/compressed/' instead of 'arch/s390/boot/'
> and the context is also slightly different.
>
> Would you please have a look at the attached backport for focal and confirm
> that it's correct?
> Since it has this add. block:
> "
> . = ALIGN(256);
> .bss : {
> _bss = . ;
> *(.bss)
> *(.bss.*)
> *(COMMON)
> . = ALIGN(8); /* For convenience during zeroing */
> _ebss = .;
> }
> "

The sb_trailer block needs to move to before the .bss definition, and replaces the ALIGN(256) line. Otherwise kernel image sizes will be unnecessarily increased by the size of the discarded bss section. It should look something like this:

_compressed_start = .;
*(.vmlinux.bin.compressed)
_compressed_end = .;
- FILL(0xff);
- . = ALIGN(4096);
}
- . = ALIGN(256);
+
+#define SB_TRAILER_SIZE 32
+ /* Trailer needed for Secure Boot */
+ . += SB_TRAILER_SIZE; /* make sure .sb.trailer does not overwrite the previous section */
+ . = ALIGN(4096) - SB_TRAILER_SIZE;
+ .sb.trailer : {
+ QUAD(0)
+ QUAD(0)
+ QUAD(0)
+ QUAD(0x000000207a49504c)
+ }
+
.bss : {
_bss = . ;
*(.bss)

> Looks like we commented in parallel.
> Yes, backport will be helpful.

Ok, will try to work on that.