td shim: support large payload#694
Open
gaojiaqi7 wants to merge 3 commits intoconfidential-containers:mainfrom
Open
td shim: support large payload#694gaojiaqi7 wants to merge 3 commits intoconfidential-containers:mainfrom
gaojiaqi7 wants to merge 3 commits intoconfidential-containers:mainfrom
Conversation
82d4a0c to
cd57a3a
Compare
jyao1
reviewed
May 20, 2024
| | CONFIG | (0x40000) 256 kB | ||
| +----------------------------------------+ <- 0x40000 | ||
| | MAILBOX | (0x1000) 4 KB | ||
| | MAILBOX | (0x1000) 4 kB |
Update the `td-layout` with `td-layout-config`. Signed-off-by: Jiaqi Gao <jiaqi.gao@intel.com>
cd57a3a to
e21e8dc
Compare
jyao1
reviewed
May 22, 2024
td-shim/src/bin/td-shim/shim_info.rs
Outdated
| 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; |
Member
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The metadata offset at the
end - 0x20of 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
payloadsection type, try bothPayloadandLargePayloadregion to find the firmware volume thatpayload image may be packaged in.