All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>
Cc: kvm <kvm@vger.kernel.org>, "Sironi, Filippo" <sironi@amazon.de>,
	"Raslan, KarimAllah" <karahmed@amazon.de>,
	Matt Gingell <gingell@google.com>,
	Steve Rutherford <srutherford@google.com>,
	liran@amazon.com
Subject: Re: [PATCH] kvm/x86: Fix simultaneous ExtINT and lapic interrupt handling with APICv
Date: Thu, 26 Nov 2020 19:07:12 +0000	[thread overview]
Message-ID: <059dfef7aa8eb32aa8348a7ad1a06509f2abf2bb.camel@infradead.org> (raw)
In-Reply-To: <e71a7296-810a-cb73-8d34-cd96391750eb@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

On Thu, 2020-11-26 at 19:00 +0100, Paolo Bonzini wrote:
>   static int kvm_vcpu_ready_for_interrupt_injection(struct kvm_vcpu
> *vcpu)
>   {
> +       WARN_ON(pic_in_kernel(vcpu->kvm));
> +

But what if I *want* to inject Xen event channel interrupts while the
actual PIC is in the kernel? :)

Not that I'll have to once the kernel is fixed and I can enable my
shiny new userspace PIC/PIT/IOAPIC code, I suppose.... 

>         return kvm_arch_interrupt_allowed(vcpu) &&
> -               !kvm_cpu_has_interrupt(vcpu) &&
>                 !kvm_event_needs_reinjection(vcpu) &&
> -               kvm_cpu_accept_dm_intr(vcpu);
> +               (!lapic_in_kernel(vcpu)
> +                || (kvm_apic_accept_pic_intr(vcpu)
> +                    && !pending_userspace_extint(v));
>   }
> 

I'll give this version a spin...


static int kvm_vcpu_ready_for_interrupt_injection(struct kvm_vcpu *vcpu)
{
	return kvm_arch_interrupt_allowed(vcpu) &&
		!kvm_event_needs_reinjection(vcpu) &&
		(!lapic_in_kernel(vcpu)
		 || (kvm_apic_accept_pic_intr(vcpu)
		     && vcpu->arch.pending_external_vector == -1));
}

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5174 bytes --]

  reply	other threads:[~2020-11-26 19:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 13:03 [RFC] Further hack request_interrupt_window handling to work around kvm_cpu_has_interrupt() nesting breakage David Woodhouse
2020-11-25 15:10 ` [RFC PATCH] Fix split-irqchip vs interrupt injection window request David Woodhouse
2020-11-25 21:19   ` Sean Christopherson
2020-11-26 11:10     ` David Woodhouse
2020-11-26 12:05       ` [PATCH] kvm/x86: Fix simultaneous ExtINT and lapic interrupt handling with APICv David Woodhouse
2020-11-26 18:00         ` Paolo Bonzini
2020-11-26 19:07           ` David Woodhouse [this message]
2020-11-26 17:29       ` [RFC PATCH] Fix split-irqchip vs interrupt injection window request David Woodhouse
2020-11-26 17:59         ` Paolo Bonzini
2020-11-26 21:48           ` David Woodhouse
2020-11-27  4:37             ` Paolo Bonzini

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=059dfef7aa8eb32aa8348a7ad1a06509f2abf2bb.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=gingell@google.com \
    --cc=karahmed@amazon.de \
    --cc=kvm@vger.kernel.org \
    --cc=liran@amazon.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=sironi@amazon.de \
    --cc=srutherford@google.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.