-
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.
svsm: Enable CET on the target processor
The method of configuring SSP/MSR_S_CET via the VMSA only works on SNP and is not applicable to any other platform. Enabling CET and configuring the shadow stack on the target processor is a technique that will work correctly on all platforms. Signed-off-by: Jon Lange <[email protected]>
- Loading branch information
1 parent
f0ffc76
commit c99743a
Showing
5 changed files
with
18 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,11 @@ | |
// Author: Joerg Roedel <[email protected]> | ||
|
||
use crate::acpi::tables::ACPICPUInfo; | ||
use crate::address::Address; | ||
use crate::cpu::percpu::{this_cpu, this_cpu_shared, PerCpu}; | ||
use crate::cpu::shadow_stack::{is_cet_ss_supported, SCetFlags, MODE_64BIT, S_CET}; | ||
use crate::cpu::sse::sse_init; | ||
use crate::enable_shadow_stacks; | ||
use crate::error::SvsmError; | ||
use crate::platform::SvsmPlatform; | ||
use crate::platform::SVSM_PLATFORM; | ||
|
@@ -39,11 +42,17 @@ pub fn start_secondary_cpus(platform: &dyn SvsmPlatform, cpus: &[ACPICPUInfo]) { | |
|
||
#[no_mangle] | ||
fn start_ap() { | ||
this_cpu() | ||
let percpu = this_cpu(); | ||
|
||
if is_cet_ss_supported() { | ||
enable_shadow_stacks!(percpu); | ||
} | ||
|
||
percpu | ||
.setup_on_cpu(&**SVSM_PLATFORM) | ||
.expect("setup_on_cpu() failed"); | ||
|
||
this_cpu() | ||
percpu | ||
.setup_idle_task(ap_request_loop) | ||
.expect("Failed to allocated idle task for AP"); | ||
|
||
|
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