linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Steve Rutherford <srutherford@google.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 2/2] KVM: x86: fix edge EOI and IOAPIC reconfig race
Date: Wed, 7 Oct 2015 17:01:29 +0200	[thread overview]
Message-ID: <20151007150128.GC4508@potion.brq.redhat.com> (raw)
In-Reply-To: <5614E5FC.7060207@redhat.com>

2015-10-07 11:29+0200, Paolo Bonzini:
> On 13/08/2015 15:46, Radim Krčmář wrote:
>> +	if (kvm_x86_ops->sync_pir_to_irr(vcpu))
>> +		kvm_make_request(KVM_REQ_EVENT, vcpu);
>> +
> 
> The call to sync_pir_to_irr belongs more in vcpu_scan_ioapic, I think.

Will do so in v2.

> More importantly, I think that KVM_REQ_EVENT is a latent bug for
> kvm_vcpu_ioctl_get_lapic as well, so the call to kvm_make_request should
> go in vmx_sync_pir_to_irr or in a new kvm_sync_pir_to_irr wrapper.

True, thanks.  I'll make the request in kvm_apic_update_irr (unless
you'd prefer to have it in new kvm_sync_pir_to_irr).

>> +			    (e->fields.trig_mode == IOAPIC_EDGE_TRIG &&
>> +			     kvm_apic_pending_eoi(vcpu, e->fields.vector)))
> 
> Should we test again here that kvm_irq_has_notifier(ioapic->kvm,
> KVM_IRQCHIP_IOAPIC, index), to avoid unnecessarily marking other
> edge-triggered interrupts?

Other edge-triggered interrupts are skipped by a previous condition:

  if (e->fields.trig_mode == IOAPIC_LEVEL_TRIG ||
      kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC, index) ||
      index == RTC_GSI)
         [we're here]

I think it is ok to ignore level-triggered RTC, but we do want to
include edge-triggered.

      reply	other threads:[~2015-10-07 15:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 13:46 [PATCH 0/2] KVM: x86: fix edge EOI and IOAPIC reconfig race Radim Krčmář
2015-08-13 13:46 ` [PATCH 1/2] KVM: x86: return bool from x86_ops.sync_pir_to_irr Radim Krčmář
2015-08-13 13:46 ` [PATCH 2/2] KVM: x86: fix edge EOI and IOAPIC reconfig race Radim Krčmář
2015-08-13 14:53   ` Paolo Bonzini
2015-08-14  8:38     ` Radim Krčmář
2015-08-15  0:00       ` Paolo Bonzini
2015-10-06 20:33         ` Radim Krčmář
2015-10-07  9:31           ` Paolo Bonzini
2015-10-07 15:05             ` Radim Krčmář
2015-10-07  9:29   ` Paolo Bonzini
2015-10-07 15:01     ` Radim Krčmář [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=20151007150128.GC4508@potion.brq.redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=srutherford@google.com \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).