-
Notifications
You must be signed in to change notification settings - Fork 55
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
td-layout: load payload image into physical memory space #675
td-layout: load payload image into physical memory space #675
Conversation
b72f137
to
d39abbb
Compare
Firmware volume header has limitation on the size of the data inside which needs to be smaller than maximum value of u24 (0xffffff). To lift the restriction, FV header is removed for payload images as it is not mandatory. Signed-off-by: Jiaqi Gao <[email protected]>
At runtime, if td-shim image is not loaded into memory 1:1, the metadata offset at firmware_end - 0x20 will be invalid because it is the offset from the beginning of the image. The value inside the OVMF GUID table is the offset from the end of the image which is not changed after loading into memory. Signed-off-by: Jiaqi Gao <[email protected]>
| FREE | (0x1000) 4 KB | ||
+----------------------------------------+ <- 0x82000 | ||
| PAYLOAD | (0xC2D000) 12.18 MB | ||
| FREE | (0x0) 0 B |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this?
td-layout/src/memslice.rs
Outdated
@@ -39,7 +39,7 @@ impl SliceType { | |||
match self { | |||
SliceType::Config => "Config", | |||
SliceType::TdHob => "TdHob", | |||
SliceType::ShimPayload => "ShimPayload", | |||
SliceType::PayloadImage => "PayloadImage", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change this?
@@ -4,7 +4,7 @@ | |||
"TempStack": "0x020000", | |||
"TempHeap": "0x020000", | |||
"Metadata": "0x001000", | |||
"Payload": "0xC2D000", | |||
"Payload": "0xC2E000", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need to enlarge for load into physical memory?
0x984a, | ||
0x4798, | ||
[0x86, 0x5e, 0x46, 0x85, 0xa7, 0xbf, 0x8e, 0xc2], | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need this?
The old implementation loads the payload image into ROM space which limited the size of the payload to be smaller than 16MiB. The previous layout 1:1 maps the image to the ROM space. As we move payload to physical memory space, ROM layout and image layout will be different in td-layout-config tool. The default image config is adjusted to generate a 16MiB image by default. Signed-off-by: Jiaqi Gao <[email protected]>
Payload image is loaded into physical memory space so the functions under memslice are updated and the metadata is updated. Signed-off-by: Jiaqi Gao <[email protected]>
d39abbb
to
1b71a3c
Compare
The old implementation loads the payload image into ROM space which limited the size of the payload to be smaller than 16MiB.
td-layout-config
tool.Related issue: #665