Skip to content

Commit 35facfb

Browse files
jiong-microsoftJiong Wang (Arm Ltd)
andauthored
arm64: add CCA policy and VP context support (#106)
Add Arm CCA as a supported AArch64 isolation platform and define the corresponding IGVM policy and VP context wire formats. Introduce IGVM_VHT_CCA_POLICY, IGVM_VHS_CCA_POLICY, CCA policy attribute bits, hash algorithm and LFA policy enums, and the AArch64 CCA VP context structure. Add parser, serializer, merge-mask fixup, and validation support for CCA policy headers, including reserved-field checks, ones/zeroes mask conflict detection, and validation that CCA policy compatibility masks refer to CCA platform headers. Add AArch64 CCA VP context directive handling and round-trip tests for CCA IGVM files. Expose the new CCA definitions through cbindgen and add the C API error mapping for invalid CCA policy compatibility masks. --------- Co-authored-by: Jiong Wang (Arm Ltd) <b-jionwang@microsoft.com>
1 parent a706b19 commit 35facfb

5 files changed

Lines changed: 490 additions & 8 deletions

File tree

igvm/src/c_api.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub enum IgvmResult {
6060
IGVMAPI_UNSUPPORTED_PAGE_SIZE = -25,
6161
IGVMAPI_INVALID_FIXED_HEADER_ARCH = -26,
6262
IGVMAPI_MERGE_REVISION = -27,
63+
IGVMAPI_INVALID_CCA_POLICY_COMPATIBILITY_MASK = -28,
6364
}
6465

6566
type IgvmHandle = i32;
@@ -164,6 +165,9 @@ fn translate_error(error: Error) -> IgvmResult {
164165
Error::UnsupportedPageSize(_) => IgvmResult::IGVMAPI_UNSUPPORTED_PAGE_SIZE,
165166
Error::InvalidFixedHeaderArch(_) => IgvmResult::IGVMAPI_INVALID_FIXED_HEADER_ARCH,
166167
Error::MergeRevision => IgvmResult::IGVMAPI_MERGE_REVISION,
168+
Error::InvalidCcaPolicyCompatibilityMask(_) => {
169+
IgvmResult::IGVMAPI_INVALID_CCA_POLICY_COMPATIBILITY_MASK
170+
}
167171
}
168172
}
169173

0 commit comments

Comments
 (0)