All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Mattson <jmattson@google.com>
To: Liran Alon <liran.alon@oracle.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"kvm list" <kvm@vger.kernel.org>,
	"Wanpeng Li" <wanpeng.li@hotmail.com>,
	"Idan Brown" <idan.brown@oracle.com>,
	"Krish Sadhukhan" <krish.sadhukhan@oracle.com>
Subject: Re: [PATCH v2 1/8] KVM: VMX: No need to clear pending NMI/interrupt on inject realmode interrupt
Date: Fri, 1 Dec 2017 15:45:01 -0800	[thread overview]
Message-ID: <CALMp9eS_SmnN2ENTcNWQ-1i_nvJJrp-c_Xx4eRAozLj6C1fdiw@mail.gmail.com> (raw)
In-Reply-To: <1511278211-12257-2-git-send-email-liran.alon@oracle.com>

Reviewed-by: Jim Mattson <jmattson@google.com>

On Tue, Nov 21, 2017 at 7:30 AM, Liran Alon <liran.alon@oracle.com> wrote:
> kvm_inject_realmode_interrupt() is called from one of the injection
> functions which writes event-injection to VMCS: vmx_queue_exception(),
> vmx_inject_irq() and vmx_inject_nmi().
>
> All these functions are called just to cause an event-injection to
> guest. They are not responsible of manipulating the event-pending
> flag. The only purpose of kvm_inject_realmode_interrupt() should be
> to emulate real-mode interrupt-injection.
>
> This was also incorrect when called from vmx_queue_exception().
>
> Signed-off-by: Liran Alon <liran.alon@oracle.com>
> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
> Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
> Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
> ---
>  arch/x86/kvm/x86.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 34c85aa2e2d1..c85fc4406a7d 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -5411,11 +5411,6 @@ int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip)
>         kvm_rip_write(vcpu, ctxt->eip);
>         kvm_set_rflags(vcpu, ctxt->eflags);
>
> -       if (irq == NMI_VECTOR)
> -               vcpu->arch.nmi_pending = 0;
> -       else
> -               vcpu->arch.interrupt.pending = false;
> -
>         return EMULATE_DONE;
>  }
>  EXPORT_SYMBOL_GPL(kvm_inject_realmode_interrupt);
> --
> 1.9.1
>

  reply	other threads:[~2017-12-01 23:45 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 15:30 [PATCH v2 0/8] KVM: Fix multiple issues in handling pending/injected events Liran Alon
2017-11-21 15:30 ` [PATCH v2 1/8] KVM: VMX: No need to clear pending NMI/interrupt on inject realmode interrupt Liran Alon
2017-12-01 23:45   ` Jim Mattson [this message]
2017-12-02  0:19     ` Liran Alon
2017-11-21 15:30 ` [PATCH v2 2/8] KVM: x86: Rename interrupt.pending to interrupt.injected Liran Alon
2017-11-28 17:02   ` Jim Mattson
2017-11-21 15:30 ` [PATCH v2 3/8] KVM: x86: set/get_events ioctl should consider only injected exceptions Liran Alon
2017-11-22 20:25   ` Radim Krčmář
2017-11-23 18:20     ` Liran Alon
2017-11-22 21:00   ` Jim Mattson
2017-11-23 18:45     ` Liran Alon
2017-11-23 23:05       ` Paolo Bonzini
2017-11-27 17:26       ` Jim Mattson
2017-11-27 18:30         ` Liran Alon
2017-11-21 15:30 ` [PATCH v2 4/8] KVM: x86: Warn if userspace overrides existing injected exception/interrupt Liran Alon
2017-11-22 20:34   ` Radim Krčmář
2017-11-22 22:27     ` Liran Alon
2017-11-21 15:30 ` [PATCH v2 5/8] Revert "kvm: nVMX: Disallow userspace-injected exceptions in guest mode" Liran Alon
2017-11-21 15:30 ` [PATCH v2 6/8] KVM: x86: Fix misleading comments on handling pending exceptions Liran Alon
2017-11-21 15:30 ` [PATCH v2 7/8] KVM: nVMX: Require immediate-exit when event reinjected to L2 and L1 event pending Liran Alon
2017-11-27 20:48   ` Jim Mattson
2017-11-27 22:42     ` Liran Alon
2017-11-28  4:55       ` Jim Mattson
2017-11-28 11:14         ` Paolo Bonzini
2017-11-28 13:59           ` Liran Alon
2017-11-28 11:36         ` Liran Alon
2017-11-28  6:39   ` Jim Mattson
2017-11-28 18:26     ` Jim Mattson
2017-11-28 19:45       ` Liran Alon
2017-11-28 21:04         ` Jim Mattson
2017-11-28 19:33     ` Liran Alon
2017-11-21 15:30 ` [PATCH v2 8/8] KVM: nVMX: Optimization: Dont set KVM_REQ_EVENT when VMExit with nested_run_pending Liran Alon

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=CALMp9eS_SmnN2ENTcNWQ-1i_nvJJrp-c_Xx4eRAozLj6C1fdiw@mail.gmail.com \
    --to=jmattson@google.com \
    --cc=idan.brown@oracle.com \
    --cc=krish.sadhukhan@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=liran.alon@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=wanpeng.li@hotmail.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.