Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platform: move AP page table construction into common code #493

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions kernel/src/cpu/smp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ use crate::utils::immut_after_init::immut_after_init_set_multithreaded;
fn start_cpu(platform: &dyn SvsmPlatform, apic_id: u32) -> Result<(), SvsmError> {
let start_rip: u64 = (start_ap as *const u8) as u64;
let percpu = PerCpu::alloc(apic_id)?;
let pgtable = this_cpu().get_pgtable().clone_shared()?;
percpu.setup(platform, pgtable)?;
platform.start_cpu(percpu, start_rip)?;

let percpu_shared = percpu.shared();
Expand Down
2 changes: 0 additions & 2 deletions kernel/src/platform/snp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ impl SvsmPlatform for SnpPlatform {
}

fn start_cpu(&self, cpu: &PerCpu, start_rip: u64) -> Result<(), SvsmError> {
let pgtable = this_cpu().get_pgtable().clone_shared()?;
cpu.setup(self, pgtable)?;
let (vmsa_pa, sev_features) = cpu.alloc_svsm_vmsa(*VTOM as u64, start_rip)?;

current_ghcb().ap_create(vmsa_pa, cpu.get_apic_id().into(), 0, sev_features)
Expand Down
Loading