-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To facilitate platform abstraction, split requests.rs into: - kernel/src/sev/caa.rs: implementation for the SVSM Calling Area - kernel/src/platform/snp_requests.rs: SEV-specific request processing No functional change intended. Signed-off-by: Peter Fang <[email protected]>
- Loading branch information
Showing
10 changed files
with
59 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
// | ||
// Copyright (c) 2022-2023 SUSE LLC | ||
// | ||
// Author: Joerg Roedel <[email protected]> | ||
|
||
const _: () = assert!(core::mem::size_of::<SvsmCaa>() == 8); | ||
|
||
/// The SVSM Calling Area (CAA) | ||
#[repr(C, packed)] | ||
#[derive(Debug, Clone, Copy)] | ||
pub struct SvsmCaa { | ||
pub call_pending: u8, | ||
mem_available: u8, | ||
pub no_eoi_required: u8, | ||
_rsvd: [u8; 5], | ||
} | ||
|
||
impl SvsmCaa { | ||
/// Returns a copy of the this CAA with the `call_pending` field cleared. | ||
#[inline] | ||
pub const fn serviced(self) -> Self { | ||
Self { | ||
call_pending: 0, | ||
..self | ||
} | ||
} | ||
|
||
/// Returns a copy of the this CAA with the `no_eoi_required` flag updated | ||
#[inline] | ||
pub const fn update_no_eoi_required(self, no_eoi_required: u8) -> Self { | ||
Self { | ||
no_eoi_required, | ||
..self | ||
} | ||
} | ||
|
||
/// A CAA with all of its fields set to zero. | ||
#[inline] | ||
pub const fn zeroed() -> Self { | ||
Self { | ||
call_pending: 0, | ||
mem_available: 0, | ||
no_eoi_required: 0, | ||
_rsvd: [0; 5], | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
// | ||
// Author: Joerg Roedel <[email protected]> | ||
|
||
pub mod caa; | ||
pub mod ghcb; | ||
pub mod hv_doorbell; | ||
pub mod msr_protocol; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters