Skip to content

Commit

Permalink
Merge pull request #493 from msft-jlange/platform_start_cpu
Browse files Browse the repository at this point in the history
platform: move AP page table construction into common code
  • Loading branch information
joergroedel authored Oct 23, 2024
2 parents 445e751 + 40cebea commit 711fe78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 711fe78

Please sign in to comment.