Skip to content

Commit

Permalink
protocols: Advertise support for attestation protocol
Browse files Browse the repository at this point in the history
Handle attestation protocol requests in handle_request().

Make the CORE_QUERY_PROTOCOL return supported versions (1) of the
attestation protocol (1).

Signed-off-by: Dov Murik <[email protected]>
  • Loading branch information
dubek committed Apr 24, 2023
1 parent ecf96bc commit c93f563
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/protocols/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ impl VersionInfo {
funcs!(max, u32);
}

static PROTOCOL_INFO: [VersionInfo; 1] = [VersionInfo { min: 1, max: 1 }];
static PROTOCOL_INFO: [VersionInfo; 2] = [
VersionInfo { min: 1, max: 1 },
VersionInfo { min: 1, max: 1 },
];

pub enum ProtocolId {
ProtocolId0,
ProtocolId1,

MaxProtocolId,
}
Expand Down
2 changes: 2 additions & 0 deletions src/protocols/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ pub use crate::protocols::services_manifest::*;

/// 0
pub const SVSM_CORE_PROTOCOL: u32 = ProtocolId::ProtocolId0 as u32;
/// 1
pub const SVSM_ATTESTATION_PROTOCOL: u32 = ProtocolId::ProtocolId1 as u32;
1 change: 1 addition & 0 deletions src/svsm_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ unsafe fn handle_request(vmsa: *mut Vmsa) {

match protocol {
SVSM_CORE_PROTOCOL => core_handle_request(callid, vmsa),
SVSM_ATTESTATION_PROTOCOL => attestation_handle_request(callid, vmsa),
_ => (*vmsa).set_rax(SVSM_ERR_UNSUPPORTED_PROTOCOL),
}
}
Expand Down

0 comments on commit c93f563

Please sign in to comment.