Patch Set 13:

Patch Set 13:

It would require some linker script wrapping to achieve it, but I think it would be nice to be able to tag such structures with, let's call it CAR_PERSIST, and they would magically get migrated all the way to CBMEM. I think Julius insisted such symbols must resolve at build-time, so we would need to find a way to lock the symbol locations inside CAR, across the stages, while other sections (.bss) can grow and shrink.

That sounds nice, but how to make sure that the symbols in (I assume you have a new region for it in which CAR_PERSISTS goes?) the new region are the same across pre-ram stages? That would somehow require to use some of the bootblock symbols in verstage and romstage. Sounds a bit hacky to do 'nm' and parse output into something to be included by memlayout.ld of romstage & ramstage?

That's the question to solve. Ramstage and postcar would not be involved. Maybe one could use objcopy to mirror a complete section from romstage.elf into bootblock.elf, and linker scripts would not need to change at all. Just throwing out ideas, I have no clue :)

We need a proper data section before we can migrate things automatically. Currently, we support .bss (0 values) but not initialized objects that are writable. Once you have that it is certainly possible to relocate the objects. But even then it can be complicated in that you need everyone to utilize pointers to objects where the pointers live in the correct location. Otherwise you'll have address references in your instruction stream. That will break for xip programs since you can't modify the instructions as they are read only.

View Change

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I71bbe1b776cbc74468a6218b315894602b6152ba
Gerrit-Change-Number: 36291
Gerrit-PatchSet: 13
Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Aaron Durbin <adurbin@chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Julius Werner <jwerner@chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Kyösti Mälkki <kyosti.malkki@gmail.com>
Gerrit-Comment-Date: Tue, 29 Oct 2019 21:52:30 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment