Re: [RFC] x86: Add .data section support for pre-RAM stages

"Compostella, Jeremy" <[email protected]>
Newsgroups gmane.linux.bios
Organization Intel Corporation - 2200 Mission College Blvd. Santa Clara, CA 95052. USA
Message-ID <[email protected]>
Hi,

Any feedback on this topic ?

I made some significant changes and made sure to cover all the cases
we identified including non-XIP stages. Cf. <https://review.coreboot.org/q/topic:x86-pre-ram-data-section>

Thanks,
Jeremy

"Compostella, Jeremy" <[email protected]> writes:
> Dear coreboot community,
>
> I am looking for feedback on the following topic.
>
> x86 Pre-memory stages do not support the `.data' section and as a result
> developers are required to include runtime initialization code instead
> of relying on C global variable definition.
>
> To illustrate the impact of this lack of .data section support, here
> are two limitations I personally ran into:
> 1. The inclusion of libgfxinit in romstage last year has required some
>    changes in libgfxinit to ensure data is initialized at runtime. In
>    addition, we had to manually map some .data symbols in the _bss
>    region.
> 2. CBFS cache is currently not supported in pre-memory stages and
>    enabling it would require to add an initialization function and
>    find a generic spot to call it.
>
> Instead of going though these workarounds and as it was suggested on
> [[RFC] VGA Text mode in romstage] last year, I believe we could add
> support for a `.data' section. I have been working on a solution for
> eXecute-In-Place (XIP) pre-memory stages (`bootblock', `verstage' and
> `romstage') which deliver good results
> (cf. <https://review.coreboot.org/c/coreboot/+/77289>).
>
> In short this patch:
> 1. creates a new ELF segment to hold the `.data' section
> 2. creates a `.data' section with its Virtual Memory Address (VMA)
>    within Cache-as-RAM (CAR) boundaries and its Load Memory Address
>    (LMA) following the .text section (at `_etext').
>
> cbfstools is also updated:
> - To process this new segment and `.data' section
> - To place the .data section content right after the
>   code (cf. `parse_elf_to_xip_stage' function)
>
> At the moment, this patch makes cbfstool detects the presence of the
> segment automatically and assume this is a "data" segment. But we
> could add a new parameter to make this new behavior less automatic if
> you think this would be better.
>
> This patch also adds a piece of assembly code (or C-code for
> bootblock) to copy the `.data' section content to Cache-As-RAM at
> runtime.
>
> Regards,
_______________________________________________
coreboot mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.