Skip to content

Commit 9b9deed

Browse files
committed
protocols: Advertise support for attestation protocol
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 <dovmurik@linux.ibm.com>
1 parent 8882de4 commit 9b9deed

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/protocols/core.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ impl VersionInfo {
4242
funcs!(max, u32);
4343
}
4444

45-
static PROTOCOL_INFO: [VersionInfo; 1] = [VersionInfo { min: 1, max: 1 }];
45+
static PROTOCOL_INFO: [VersionInfo; 2] = [
46+
VersionInfo { min: 1, max: 1 },
47+
VersionInfo { min: 1, max: 1 },
48+
];
4649

4750
pub enum ProtocolId {
4851
ProtocolId0,
52+
ProtocolId1,
4953

5054
MaxProtocolId,
5155
}

src/protocols/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ pub use crate::protocols::services_manifest::*;
2020

2121
/// 0
2222
pub const SVSM_CORE_PROTOCOL: u32 = ProtocolId::ProtocolId0 as u32;
23+
/// 1
24+
pub const SVSM_ATTESTATION_PROTOCOL: u32 = ProtocolId::ProtocolId1 as u32;

src/svsm_request.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ unsafe fn handle_request(vmsa: *mut Vmsa) {
2828

2929
match protocol {
3030
SVSM_CORE_PROTOCOL => core_handle_request(callid, vmsa),
31+
SVSM_ATTESTATION_PROTOCOL => attestation_handle_request(callid, vmsa),
3132
_ => (*vmsa).set_rax(SVSM_ERR_UNSUPPORTED_PROTOCOL),
3233
}
3334
}

0 commit comments

Comments
 (0)