Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relocate FVs to claim extra space from ME region. #26

Open
persmule opened this issue May 31, 2018 · 5 comments
Open

Relocate FVs to claim extra space from ME region. #26

persmule opened this issue May 31, 2018 · 5 comments

Comments

@persmule
Copy link

With me_cleaner, a lot of ROM space (several MiB) could be freed from ME region and potentially used by BIOS region instead.

Is it possible to relocate FVs (especially the DXE FV) inside the enlarged BIOS region to claim these space? And if possible, how to do that?

I have investigated a lot about the build process of EDK2, only to find there should be an FDF to record all the FVs' offset and size, but failed to find how the FDF is built to binary and stored in the resulted FD image.

@vejmarie
Copy link
Contributor

vejmarie commented May 31, 2018 via email

@persmule
Copy link
Author

persmule commented May 31, 2018

@vejmarie Thank you very much, but I have a bit more questions:

  1. Does PEI already know where DXE FV should be when its own FV are generated, or the FV layout is corrected when constructing FD?

  2. Does FV layout used by PEI and/or DXE initially come from FDF? If so, how is the layout coded into PEI and/or DXE modules? e.g. via auto-generated source files containing global variables?

@vejmarie
Copy link
Contributor

vejmarie commented May 31, 2018 via email

@osresearch
Copy link
Contributor

Jean-Marie is correct (with one minor correction -- SecCore jumps into PeiCore, which eventually hands control to DxeCore). On most platforms these addresses and lengths seem to be hard coded into the PEI core for some reason, rather than scanning the ROM for them. These are typically stored in "compile time constant PCD" values, so they end up scattered throughout the various modules. On some platforms (like the MinPlatform MtOlympus) the PEI FV is not actually known at compile time, so there is a post-build step that binary patch the seccore to find it. Yeah...

I'm working on replacing the Linux BDS patch with a separate DXE module that does the minimum BDS stuff, as well as allowing us to add in new firmware volumes, remap the SPI flash as necessary and retrieve kernel command line parameters from the UEFI nvram store. https://github.com/osresearch/linuxboot/blob/bds/dxe/linuxboot.c

@JulienVdG
Copy link
Contributor

I polished that work in here : #40
note that I'm not using me_cleaner but just resizing the me region to it's actual use of flash space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants