arm64: initial support for CCA in specification and parser#106
arm64: initial support for CCA in specification and parser#106jiong-microsoft wants to merge 4 commits intomicrosoft:mainfrom
Conversation
This PR extends 'igvm_def' and 'igvm' crates to support ARM64 CCA.
igvm_def:
- New IgvmPlatformType::CCA and associated IGVM_CCA_PLATFORM_VERSION.
- New CcaPolicy to be used with IGVM_VHS_GUEST_POLICY.
- CCA VpContext follows the convention used by VbsVPContext: a fixed header
followed by a list of registers, this gives flexibility on configuring
registers' initial value.
igvm:
- updated a few places to recognize the new CCA platform
Signed-off-by: Ionut Mihalcea <ionut.mihalcea@arm.com>
Signed-off-by: Jiong Wang <b-jiongwang@microsoft.com>
Use fixed structure type for VPContext
|
@jiong-microsoft please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
chris-oo
left a comment
There was a problem hiding this comment.
Is it possible to have more links to the corresponding ARM specification for each header?
| /// reset values. | ||
| #[repr(C)] | ||
| #[derive(Copy, Clone, Debug, IntoBytes, Immutable, KnownLayout, FromBytes, PartialEq, Eq)] | ||
| pub struct IgvmVpContextAArch64Cca { |
There was a problem hiding this comment.
To confirm, in the CCA spec these are the only registers that can be set and are measured? Is it possible to include a link to the spec in the header definition?
There was a problem hiding this comment.
Yes, x0 ~ x7, pc are the only registers contribute to RIM (realm initial measurement), but there is also another 64-bit flags contribute to RIM which we should adds, I will update the PR. The comment will contain links to RMM doc, unfortunately there is permanent doc link, so I can only mention the section number but guess is enough for locating the spec
/// Format of [IGVM_VHS_VP_CONTEXT] file data for a native ARM64 CCA image.
///
/// The VP Context corresponds to the REC (Realm Execution Context) in CCA.
/// Therefore, the fields listed below match those defined in the RMM
/// specification, section "B4.6.69 RmiRecParams type".
///
/// These include the general-purpose registers x0–x7, the PC register,
/// and a 64-bit flags field. All of these fields contribute to the
/// RIM (Realm Initial Measurement).
///
/// One exception is mpidr, which is not included here because it is
/// determined by the host and does not need to be specified in the
/// IGVM file.
///
/// Any registers not explicitly specified here are initialized to their
/// architectural reset values.
igvm_defs/src/lib.rs
Outdated
| pub debug_allowed: u8, | ||
| /// Hash algorithm to measure the initial state of the Realm. | ||
| #[bits(8)] | ||
| pub hash_algorithm: u8, |
There was a problem hiding this comment.
could this be an open_enum type instead?
igvm_defs/src/lib.rs
Outdated
| pub reserved: u64, | ||
| } | ||
|
|
||
| /// The Arm CCA policy used in [`IGVM_VHS_GUEST_POLICY::policy`]. |
There was a problem hiding this comment.
We are trying to move away from this overloaded guest policy header and back to a single header per-platform for each architectural state. I'll post a PR later today/tomorrow you can see what I think we should do instead.
- Add RMM spec section link in comments - Add 'flags' in VPContext for Cca to align with RMM REC def - Use enum as field types
This PR extends 'igvm_def' and 'igvm' crates to support ARM64 CCA.
igvm_def:
igvm: