Hi David,

I hit a Windows VBS boot failure involving hv_divert_dt_write() when OVMF
was executing in SMM.

The helper was diverting firmware descriptor-table writes into the VTL
register-intercept path. The failure trace showed a reflected #GP being
delivered in an SMM context with IDT base and limit both zero, followed
by a triple fault and guest reset.

Excluding SMM from this helper lets those firmware descriptor-table
updates proceed normally, without changing interception for ordinary
VTL0 execution:

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5884,7 +5884,7 @@ static bool hv_divert_dt_write(struct x86_emulate_ctxt 
*ctxt, u32 hv_reg,
        struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
 
        if (!hv_vcpu || vcpu->plane_level || is_guest_mode(vcpu) ||
-           !(hv_vcpu->reg_intercept_control & ctl_bit))
+           is_smm(vcpu) || !(hv_vcpu->reg_intercept_control & ctl_bit))
                return false;
 
        hv_vcpu->reg_intercept.reg = hv_reg;

The context above includes the is_guest_mode() check added later in the
series by patch 50.

With this and the accompanying integration/QEMU fixes, msinfo32 reports
VBS running. This was an integrated v7.3-based tree, not a test of patch
23 in isolation.

Thanks,
Sriram

Reply via email to