-
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 shim: support large payload #694
base: main
Are you sure you want to change the base?
td shim: support large payload #694
Conversation
82d4a0c
to
cd57a3a
Compare
+----------------------------------------+ <- 0x40000 | ||
| MAILBOX | (0x1000) 4 KB | ||
| MAILBOX | (0x1000) 4 kB |
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 KB to kB?
Update the `td-layout` with `td-layout-config`. Signed-off-by: Jiaqi Gao <jiaqi.gao@intel.com>
cd57a3a
to
e21e8dc
Compare
td-shim/src/bin/td-shim/shim_info.rs
Outdated
@@ -35,7 +37,8 @@ impl BootTimeStatic { | |||
// Validate the metadata and get the basic infomation from | |||
// it if any | |||
pub fn new() -> Option<Self> { | |||
let metadata_offset = unsafe { *((u32::MAX - TDX_METADATA_OFFSET + 1) as *const u32) }; | |||
let metadata_offset = unsafe { *((u32::MAX - TDX_METADATA_OFFSET + 1) as *const u32) } | |||
- TD_SHIM_LARGE_PAYLOAD_SIZE; |
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.
will this overflow?
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.
Added the checked_sub
to prevent potential overflow, thanks
The metadata offset at the `end - 0x20`of image is the offset of the metadata from the beginning of the file, so subtract the large payload size when calculating metadata offset. Signed-off-by: Jiaqi Gao <jiaqi.gao@intel.com>
As upstream qemu does not support TDVF `payload` section type, try both `Payload` and `LargePayload` region to find the firmware volume that payload image may be packaged in. Signed-off-by: Jiaqi Gao <jiaqi.gao@intel.com>
e21e8dc
to
2d5a36e
Compare
The metadata offset at the
end - 0x20
of image is the offset of themetadata from the beginning of the file, so subtract the large payload
size when calculating metadata offset.
As upstream qemu does not support TDVF
payload
section type, try bothPayload
andLargePayload
region to find the firmware volume thatpayload image may be packaged in.