All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kvm <kvm@vger.kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>
Subject: Re: [PATCH v3 1/2] KVM: X86: Fix warning caused by stale emulation context
Date: Thu, 27 May 2021 23:46:56 +0000	[thread overview]
Message-ID: <YLAvcG59BgJ1i0+I@google.com> (raw)
In-Reply-To: <CANRm+CwL-uS3FPZxpW_cB=vdD4WKLRDPTpd4hsn57eWpKZ_CtQ@mail.gmail.com>

On Fri, May 28, 2021, Wanpeng Li wrote:
> How about this?

Yep, perfect!  Sorry about the squash confusion.

> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index bbc4e04..dba8077 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -7226,6 +7226,11 @@ static void init_emulate_ctxt(struct kvm_vcpu *vcpu)
>         BUILD_BUG_ON(HF_SMM_MASK != X86EMUL_SMM_MASK);
>         BUILD_BUG_ON(HF_SMM_INSIDE_NMI_MASK != X86EMUL_SMM_INSIDE_NMI_MASK);
> 
> +       ctxt->interruptibility = 0;
> +       ctxt->have_exception = false;
> +       ctxt->exception.vector = -1;
> +       ctxt->perm_ok = false;
> +
>         init_decode_cache(ctxt);
>         vcpu->arch.emulate_regs_need_sync_from_vcpu = false;
>  }
> @@ -7561,11 +7566,6 @@ int x86_decode_emulated_instruction(struct
> kvm_vcpu *vcpu, int emulation_type,
>             kvm_vcpu_check_breakpoint(vcpu, &r))
>                 return r;
> 
> -       ctxt->interruptibility = 0;
> -       ctxt->have_exception = false;
> -       ctxt->exception.vector = -1;
> -       ctxt->perm_ok = false;
> -
>         ctxt->ud = emulation_type & EMULTYPE_TRAP_UD;
> 
>         r = x86_decode_insn(ctxt, insn, insn_len);

      reply	other threads:[~2021-05-27 23:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27  5:01 [PATCH v3 1/2] KVM: X86: Fix warning caused by stale emulation context Wanpeng Li
2021-05-27  5:01 ` [PATCH v3 2/2] KVM: X86: Kill off ctxt->ud Wanpeng Li
2021-05-27 17:03 ` [PATCH v3 1/2] KVM: X86: Fix warning caused by stale emulation context Sean Christopherson
2021-05-27 22:53   ` Wanpeng Li
2021-05-27 23:03   ` Wanpeng Li
2021-05-27 23:46     ` Sean Christopherson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLAvcG59BgJ1i0+I@google.com \
    --to=seanjc@google.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.