From: Sriram Nambakam <[email protected]>

Windows VBS boot fails when OVMF executes in SMM. The
hv_divert_dt_write() helper was diverting firmware descriptor-table
writes into the VTL register-intercept path. The failure trace showed a
reflected #GP delivered in an SMM context with IDT base and limit both
zero, followed by a triple fault and guest reset.

Exclude SMM from this helper so those firmware descriptor-table updates
proceed normally, without changing interception for ordinary VTL0
execution.

[dwmw2: applied from the mail; subject ours.]
Link: 
https://lore.kernel.org/all/[email protected]/
Not-signed-off-by: Sriram Nambakam <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
---
 arch/x86/kvm/x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 27317077f519..4ad8be64166f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5939,7 +5939,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;
-- 
2.50.1


Reply via email to