Conversation
|
@femiatl Could you please resolve the conflicts such that CI can work on this PR. |
5d880ea to
54e3a52
Compare
VTL0 sends data to the secure kernel during and after initial boot. Use the new attributes parameter to extend load_kdata, allowing it to process data after boot and use the improved format for sending data from VTL0. Small, simple data buffers like certificates can be sent efficiently with the same APIs used for larger aggregated data like module info. The new data format is leveraged to reduce the size of the kernel string table passed from ~10MB (all of rodata) to ~250KB. The validate_module and validate_kexec APIs are extended to use the new attributes.
54e3a52 to
d4626b2
Compare
|
🤖 SemverChecks 🤖 Click for details |
|
It seems that this change is based on new ABI to simplify data transfer. Good idea! As @tgopinath-microsoft noted in #652, this cannot be merged yet. One overall feedback or requested change: This PR needs some detailed comments to explain new ABI and data structures. Also, some functions are with old comments (e.g., these functions no longer get |
| @@ -254,12 +256,14 @@ pub fn mshv_vsm_end_of_boot() -> i64 { | |||
|
|
|||
| /// VSM function for protecting certain memory ranges (e.g., kernel text, data, heap). | |||
| /// `pa` and `nranges` specify a memory area containing the information about the memory ranges to protect. | |||
There was a problem hiding this comment.
nranges is no longer used.
There was a problem hiding this comment.
I updated the function parameter name, as well as the documentation for the changed functions
| /// `pa` and `nranges` specify a memory area containing the information about the memory ranges to protect. | ||
| pub fn mshv_vsm_protect_memory(pa: u64, nranges: u64) -> Result<i64, VsmError> { | ||
| pub fn mshv_vsm_protect_memory(pa: u64, va: u64, attr: u64) -> Result<i64, VsmError> { | ||
| if attr == 0 { |
There was a problem hiding this comment.
Fine for now, but breaking ABI change like this should be gracefully handled in the future.
There was a problem hiding this comment.
Agreed. Let me update the PR with some doc for breaking API as well
| } | ||
| } | ||
| let attr = HekiDataAttr::from_bytes(attr.to_le_bytes()); | ||
| let data_type = attr.dtype_or_err().unwrap_or(HekiKdataType::Unknown); |
There was a problem hiding this comment.
If this is unknown data, better to return an error here.
There was a problem hiding this comment.
Do we want to remove the Unknown option from the kdata enum as well? Otherwise we still have to handle it in a match somewhere
VTL0 sends data to the secure kernel during and after initial boot. Use the new attributes parameter to extend load_kdata, allowing it to process data after boot and use the improved format for sending data from VTL0. Small, simple data buffers like certificates can be sent efficiently with the same APIs used for larger aggregated data like module info.
The new data format is leveraged to reduce the size of the kernel string table passed from ~10MB (all of rodata) to ~250KB.
The validate_module and validate_kexec APIs are extended to use the new attributes.