Re: [PATCH 1/2] KVM: x86: clear stale x86_emulate_ctxt->intercept value

From: Sean Christopherson
Date: Tue Mar 03 2020 - 10:42:53 EST


On Tue, Mar 03, 2020 at 03:33:15PM +0100, Vitaly Kuznetsov wrote:
> Commit c44b4c6ab80e ("KVM: emulate: clean up initializations in
> init_decode_cache") reduced the number of fields cleared by
> init_decode_cache() claiming that they are being cleared elsewhere,
> 'intercept', however, seems to be left uncleared in some cases.
>
> The issue I'm observing manifests itself as following:
> after commit 07721feee46b ("KVM: nVMX: Don't emulate instructions in guest
> mode") Hyper-V guests on KVM stopped booting with:
>
> kvm_nested_vmexit: rip fffff802987d6169 reason EPT_VIOLATION info1 181
> info2 0 int_info 0 int_info_err 0
> kvm_page_fault: address febd0000 error_code 181
> kvm_emulate_insn: 0:fffff802987d6169: f3 a5
> kvm_emulate_insn: 0:fffff802987d6169: f3 a5 FAIL
> kvm_inj_exception: #UD (0x0)
>
> Fixes: c44b4c6ab80e ("KVM: emulate: clean up initializations in init_decode_cache")
> Fixes: 07721feee46b ("KVM: nVMX: Don't emulate instructions in guest mode")
> Cc: stable@xxxxxxxxxxxxxxx
> Suggested-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
> ---

Reviewed-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>