Skip to content

Commit d4145a5

Browse files
committed
enable
1 parent 1083b3e commit d4145a5

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

openhcl/hcl/src/ioctl.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2132,6 +2132,8 @@ impl<'a, T: Backing<'a>> ProcessorRunner<'a, T> {
21322132
| HvX64RegisterName::VsmVpSecureConfigVtl0
21332133
| HvX64RegisterName::VsmVpSecureConfigVtl1
21342134
| HvX64RegisterName::CrInterceptControl
2135+
| HvX64RegisterName::SevAvicGpa
2136+
| HvX64RegisterName::GuestVsmPartitionConfig
21352137
)
21362138
));
21372139
self.set_vp_registers_hvcall_inner(vtl, &registers)

openhcl/virt_mshv_vtl/src/processor/snp/mod.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -463,13 +463,8 @@ impl BackingPrivate for SnpBacked {
463463
.set_vp_registers_hvcall(Vtl::Vtl0, values)
464464
.expect("set_vp_registers hypercall for direct overlays should succeed");
465465

466-
let offload = if this.shared.secure_avic {
467-
false // TODO: FLIP THIS
468-
} else {
469-
false
470-
};
471-
472466
// Enable APIC offload if supported for VTL 0.
467+
let offload = this.shared.secure_avic;
473468
this.set_apic_offload(GuestVtl::Vtl0, offload);
474469
if offload {
475470
this.backing.cvm.lapics[GuestVtl::Vtl0]
@@ -638,7 +633,7 @@ impl BackingPrivate for SnpBacked {
638633
impl UhProcessor<'_, SnpBacked> {
639634
fn set_apic_offload(&mut self, vtl: GuestVtl, offload: bool) {
640635
assert!(vtl == GuestVtl::Vtl0);
641-
tracing::debug!(offload, "Setting APIC offload");
636+
tracing::info!(offload, "Setting APIC offload");
642637
// Share the common architectural parts with TDX.
643638
if offload {
644639
// TODO: Load the emulated state into the hardware.
@@ -1110,6 +1105,10 @@ impl UhProcessor<'_, SnpBacked> {
11101105
msr: u32,
11111106
is_write: bool,
11121107
) {
1108+
if msr == x86defs::X86X_AMD_MSR_SECURE_AVIC_CONTROL {
1109+
unimplemented!("secure avic msr access");
1110+
}
1111+
11131112
if is_write && self.cvm_try_protect_msr_write(entered_from_vtl, msr) {
11141113
return;
11151114
}
@@ -1394,8 +1393,6 @@ impl UhProcessor<'_, SnpBacked> {
13941393
} else {
13951394
&mut self.backing.exit_stats[entered_from_vtl].msr_read
13961395
}
1397-
1398-
// TODO: HAndle Secure AVIC MSR access?
13991396
}
14001397

14011398
SevExitCode::IOIO => {

vm/x86/x86defs/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ pub const X86X_AMD_MSR_NB_CFG: u32 = 0xC001001F;
275275
pub const X86X_AMD_MSR_VM_CR: u32 = 0xC0010114;
276276
pub const X86X_AMD_MSR_GHCB: u32 = 0xC0010130;
277277
pub const X86X_AMD_MSR_SEV: u32 = 0xC0010131;
278+
pub const X86X_AMD_MSR_SECURE_AVIC_CONTROL: u32 = 0xc0010138;
278279
pub const X86X_AMD_MSR_OSVW_ID_LENGTH: u32 = 0xc0010140;
279280
pub const X86X_AMD_MSR_OSVW_ID_STATUS: u32 = 0xc0010141;
280281
pub const X86X_AMD_MSR_DE_CFG: u32 = 0xc0011029;

0 commit comments

Comments
 (0)