All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: Nikita Leshenko <nikita.leshchenko@oracle.com>
Cc: kvm <kvm@vger.kernel.org>, Paolo Bonzini <pbonzini@redhat.com>,
	Radim Krcmar <rkrcmar@redhat.com>,
	idan.brown@oracle.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH 2/5] KVM: x86: ioapic: Don't fire level irq when Remote IRR set
Date: Mon, 6 Nov 2017 10:50:49 +0800	[thread overview]
Message-ID: <CANRm+CwWxrbons7DQ-s8c1BWtpnB_JcEMmAXZTyKpOQv3BDO0Q@mail.gmail.com> (raw)
In-Reply-To: <20171105135233.34572-3-nikita.leshchenko@oracle.com>

2017-11-05 21:52 GMT+08:00 Nikita Leshenko <nikita.leshchenko@oracle.com>:
> Avoid firing a level-triggered interrupt that has the Remote IRR bit set,
> because that means that some CPU is already processing it. The Remote
> IRR bit will be cleared after an EOI and the interrupt will refire
> if the irq line is still asserted.
>
> This behavior is aligned with QEMU's IOAPIC implementation that was
> introduced by commit f99b86b94987
> ("x86: ioapic: ignore level irq during processing") in QEMU.
>
> Signed-off-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
> Reviewed-by: Liran Alon <liran.alon@oracle.com>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>

> ---
>  arch/x86/kvm/ioapic.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
> index ae0a7dc318b2..5c9231139243 100644
> --- a/arch/x86/kvm/ioapic.c
> +++ b/arch/x86/kvm/ioapic.c
> @@ -323,7 +323,9 @@ static int ioapic_service(struct kvm_ioapic *ioapic, int irq, bool line_status)
>         struct kvm_lapic_irq irqe;
>         int ret;
>
> -       if (entry->fields.mask)
> +       if (entry->fields.mask ||
> +           (entry->fields.trig_mode == IOAPIC_LEVEL_TRIG &&
> +           entry->fields.remote_irr))
>                 return -1;
>
>         ioapic_debug("dest=%x dest_mode=%x delivery_mode=%x "
> --
> 2.13.3
>

  reply	other threads:[~2017-11-06  2:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-05 13:52 [PATCH 0/5] KVM: x86: Various IOAPIC improvements Nikita Leshenko
2017-11-05 13:52 ` [PATCH 1/5] KVM: x86: ioapic: Fix level-triggered EOI and IOAPIC reconfigure race Nikita Leshenko
2017-11-06  2:00   ` Wanpeng Li
2017-11-06 13:53     ` Nikita Leshchenko
2017-11-06 14:05       ` Paolo Bonzini
2017-11-07  8:13         ` Nikita Leshchenko
2017-11-07 10:18           ` Paolo Bonzini
2017-11-07 23:09             ` Steve Rutherford
2017-11-05 13:52 ` [PATCH 2/5] KVM: x86: ioapic: Don't fire level irq when Remote IRR set Nikita Leshenko
2017-11-06  2:50   ` Wanpeng Li [this message]
2017-11-05 13:52 ` [PATCH 3/5] KVM: x86: ioapic: Remove redundant check for Remote IRR in ioapic_set_irq Nikita Leshenko
2017-11-06  3:16   ` Wanpeng Li
2017-11-05 13:52 ` [PATCH 4/5] KVM: x86: ioapic: Clear Remote IRR when entry is switched to edge-triggered Nikita Leshenko
2017-11-06  3:30   ` Wanpeng Li
2017-11-08  0:16     ` Steve Rutherford
2017-11-08  9:52       ` Nikita Leshchenko
2017-11-08 21:24         ` Steve Rutherford
2017-11-08 21:25           ` Steve Rutherford
2017-11-05 13:52 ` [PATCH 5/5] KVM: x86: ioapic: Preserve read-only values in the redirection table Nikita Leshenko
2017-11-06  3:20   ` Wanpeng Li
2017-11-08  0:18     ` Steve Rutherford
2017-11-10 21:42 ` [PATCH 0/5] KVM: x86: Various IOAPIC improvements Radim Krčmář

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=CANRm+CwWxrbons7DQ-s8c1BWtpnB_JcEMmAXZTyKpOQv3BDO0Q@mail.gmail.com \
    --to=kernellwp@gmail.com \
    --cc=idan.brown@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=nikita.leshchenko@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.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.