From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH v3 5/5] KVM: Allow host IRQ sharing for passed-through PCI 2.3 devices
Date: Wed, 03 Nov 2010 18:45:22 +0100 [thread overview]
Message-ID: <4CD19FB2.9030804@siemens.com> (raw)
In-Reply-To: <20101103173717.GC17089@redhat.com>
Am 03.11.2010 18:37, Michael S. Tsirkin wrote:
> On Wed, Nov 03, 2010 at 06:27:50PM +0100, Jan Kiszka wrote:
>> Am 03.11.2010 16:57, Alex Williamson wrote:
>>> On Wed, 2010-11-03 at 10:43 +0200, Michael S. Tsirkin wrote:
>>>> On Wed, Nov 03, 2010 at 09:11:16AM +0100, Jan Kiszka wrote:
>>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>>
>>>>> PCI 2.3 allows to generically disable IRQ sources at device level. This
>>>>> enables us to share IRQs of such devices between on the host side when
>>>>> passing them to a guest. This feature is optional, user space has to
>>>>> request it explicitly.
>>>>>
>>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>>>
>>>>
>>>> I just realized something.
>>>> With this patch, if guest ever looks at
>>>> interrupt disable bit, it will go crazy as that bit goes on/off by
>>>> itself. I guess we could have an ioctl to set/clear the bit on
>>>> device, and have qemu call that on config write into command/status
>>>> register.
>>>>
>>>> There's also something I don't completely unerstand with current code:
>>>> how does interrupt sharing work? E.g. can assigned and emulated
>>>> devices share an interrupt?
>>>
>>> I've been pondering this with VFIO too. There it seems to work, even
>>> when I enable irqfd. The VFIO kernel/qemu driver needs to filter EOIs
>>> based on whether the interrupt was actually asserted by the device, but
>>> I think we're likely relying somewhat on interrupts being reasserted to
>>> help us keep everything serviced.
>>
>> I don't think this filtering exists. The ack notifier that is fired on
>> EOI matches the GSI, hitting anyone who is registered.
>> I think the problem is that, while user space properly or's the input of
>> all PCI devices on a IRQ line (e.g. in piix3_set_irq), kernel-side users
>> apparently prefer to mess directly with the irqchip. Unless I'm missing
>> something, that is long broken.
>>
>> Jan
>
> Well we do check host_irq_disabled. I think this is why it's there.
Probably. As an optimization. Once we force user space to inform the
kernel about INTx masking, we can restore this also for PCI 2.3.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2010-11-03 17:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1288771873.git.jan.kiszka@web.de>
[not found] ` <628f014fb1efb8e2208db03d13198ba301a3a34c.1288771873.git.jan.kiszka@web.de>
[not found] ` <20101103082921.GD6772@redhat.com>
[not found] ` <4CD123B8.8080607@web.de>
2010-11-03 9:10 ` [PATCH v3 5/5] KVM: Allow host IRQ sharing for passed-through PCI 2.3 devices Michael S. Tsirkin
2010-11-03 9:18 ` Jan Kiszka
[not found] ` <20101103084320.GF6772@redhat.com>
[not found] ` <4CD1227E.9020908@web.de>
2010-11-03 9:05 ` Michael S. Tsirkin
2010-11-03 9:15 ` Jan Kiszka
2010-11-03 9:18 ` Michael S. Tsirkin
2010-11-03 15:57 ` Alex Williamson
2010-11-03 17:27 ` Jan Kiszka
2010-11-03 17:35 ` Jan Kiszka
2010-11-03 17:42 ` Michael S. Tsirkin
2010-11-03 17:37 ` Michael S. Tsirkin
2010-11-03 17:45 ` Jan Kiszka [this message]
[not found] ` <128511f28870098dbd57bdaa081dd30ac2af70df.1288771873.git.jan.kiszka@web.de>
2010-11-03 22:13 ` [PATCH v3 2/5] KVM: Switch assigned device IRQ forwarding to threaded handler Marcelo Tosatti
2010-11-03 22:32 ` Jan Kiszka
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=4CD19FB2.9030804@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@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.