public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Jan Kiszka <jan.kiszka@web.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kvm <kvm@vger.kernel.org>, Tom Lyon <pugs@cisco.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH 5/5] KVM: Allow host IRQ sharing for passed-through PCI 2.3 devices
Date: Mon, 06 Dec 2010 18:40:40 +0200	[thread overview]
Message-ID: <4CFD1208.4070600@redhat.com> (raw)
In-Reply-To: <4CFD108F.5000200@siemens.com>

On 12/06/2010 06:34 PM, Jan Kiszka wrote:
> >
> >  What's the protocol for doing this?  I suppose userspace has to disable
> >  interrupts, ioctl(SET_INTX_MASK, masked), ..., ioctl(SET_INTX_MASK,
> >  unmasked), enable interrupts?
>
> Userspace just has to synchronize against itself - what it already does:
> qemu_mutex, and masking/unmasking is synchronous /wrt the the executing
> VCPU. Otherwise, masking/unmasking is naturally racy, also in Real Life.
> The guest resolves the remaining races.

I meant when qemu sets INTX_MASK and the kernel clears it immediately 
afterwards because the two are not synchronized.  I guess that won't 
happen in practice because playing with INTX_MASK is very rare.


> >
> >  Isn't there a race window between the two operations?
> >
> >  Maybe we should give the kernel full ownership of that bit.
>
> I think this is what VFIO does and is surely cleaner than this approach.
> But it's not possible with the existing interface (sysfs + KVM ioctls) -
> or can you restrict the sysfs access to the config space in such details?

I'm sure you can, not sure it's worth it.  Can the situation be 
exploited?  what if userspace lies?

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-12-06 16:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03 23:37 [PATCH 0/5] KVM&genirq: Enable adaptive IRQ sharing for passed-through devices Jan Kiszka
2010-12-03 23:37 ` [PATCH 1/5] genirq: Pass descriptor to __free_irq Jan Kiszka
2010-12-03 23:37 ` [PATCH 2/5] genirq: Introduce interrupt sharing notifier Jan Kiszka
2010-12-03 23:37 ` [PATCH 3/5] KVM: Split up MSI-X assigned device IRQ handler Jan Kiszka
2010-12-03 23:37 ` [PATCH 4/5] KVM: Clean up unneeded void pointer casts Jan Kiszka
2010-12-03 23:37 ` [PATCH 5/5] KVM: Allow host IRQ sharing for passed-through PCI 2.3 devices Jan Kiszka
2010-12-06 16:21   ` Avi Kivity
2010-12-06 16:34     ` Jan Kiszka
2010-12-06 16:40       ` Avi Kivity [this message]
2010-12-06 16:46         ` Jan Kiszka
2010-12-06 17:01           ` Avi Kivity
2010-12-06 17:11             ` Jan Kiszka
2010-12-04 10:37 ` [PATCH 0/5] KVM&genirq: Enable adaptive IRQ sharing for passed-through devices Thomas Gleixner
2010-12-04 11:34   ` Jan Kiszka
2010-12-04 14:41     ` Thomas Gleixner
2010-12-04 14:54       ` Jan Kiszka
2010-12-04 16:10         ` Thomas Gleixner

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=4CFD1208.4070600@redhat.com \
    --to=avi@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pugs@cisco.com \
    --cc=tglx@linutronix.de \
    /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