Skip to content

Commit

Permalink
Add X2APIC KVM Capability
Browse files Browse the repository at this point in the history
Enables the KVM_CAP_X2APIC_API capability to be in line with the KVM
selftests for TDX[0].

[0] https://lore.kernel.org/all/[email protected]/T/#m1e11e4ba2fb56d702fc5980dbd184a81845f869c

Signed-off-by: Jake Correnti <[email protected]>
  • Loading branch information
jakecorrenti committed Dec 13, 2024
1 parent 8d15423 commit 1d31a76
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/launch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ impl TdxVm {
cap.args[0] = 24;
vm_fd.enable_cap(&cap).unwrap();

cap.cap = kvm_bindings::KVM_CAP_X2APIC_API;
cap.args[0] = (1 << 0) | (1 << 1);
vm_fd.enable_cap(&cap).unwrap();

Ok(Self { fd: vm_fd })
}

Expand Down

0 comments on commit 1d31a76

Please sign in to comment.