From: Cam Macdonell <cam@cs.ualberta.ca>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [Qemu-devel] Re: [PATCH v3 0/2] Inter-VM shared memory PCI device
Date: Thu, 25 Mar 2010 12:17:56 -0600 [thread overview]
Message-ID: <8286e4ee1003251117o74486dck813a47cee54b2d6d@mail.gmail.com> (raw)
In-Reply-To: <4BABA1F4.3000801@redhat.com>
On Thu, Mar 25, 2010 at 11:48 AM, Avi Kivity <avi@redhat.com> wrote:
> On 03/25/2010 07:35 PM, Cam Macdonell wrote:
>>
>>> Ah, I see. You adjusted for the different behaviours in the driver.
>>>
>>> Still I recommend dropping the status register: this allows single-msi
>>> and
>>> PIRQ to behave the same way. Also it is racy, if two guests signal a
>>> third,
>>> they will overwrite each other's status.
>>>
>>
>> With shared interrupts with PIRQ without a status register how does a
>> device know it generated the interrupt?
>>
>
> Right, you need a status register. Just don't add any more information,
> since MSI cannot carry any data.
Right.
>
>>> Eventfd values are a counter, not a register. A read() on the other side
>>> returns the sum of all write()s (or eventfd_signal()s). In the context
>>> of
>>> irqfd it just means the number of interrupts we coalesced.
>>>
>>> Multivalue was considered at one time for a different need and rejected.
>>> Really, to solve the race you need a queue, and that can only be done in
>>> the shared memory segment using locked instructions.
>>>
>>
>> I had a hunch it was probably considered. That explains why irqfd
>> doesn't have a datamatch field. I guess supporting multiple MSI
>> vectors with one doorbell per guest isn't possible if one 1 bit of
>> information can be communicated.
>>
>
> Actually you can have one doorbell supporting multiple vectors and guests,
> simply divide the data value into two bit fields, one for the vector and one
> for the guest. A single write gets both values into the host, which can
> then use datamatch to trigger the correct eventfd (which is wired to an
> irqfd in another guest).
At 4-bits per guest, a single write is then limited to 8 guests (with
32-bit registers), we could got to 64-bit.
>
>> So, ioeventfd/irqfd restricts MSI to 1 vector between guests. Should
>> multi-MSI even be supported then in the non-ioeventfd/irq case?
>> Otherwise ioeventfd/irqfd become more than an implementation detail.
>>
>
> I lost you. Please re-explain.
An irqfd can only trigger a single vector in a guest. Right now I
only have one eventfd per guest. So ioeventfd/irqfd restricts the
current implementation to a single vector that a guest can trigger.
Without irqfd, eventfds can be used like registers a write the number
of the vector they want to trigger, but as you point out it is racy.
So, supporting multiple vectors via irqfd requires multiple eventfds
for each guest (one per vector). a total of (# of guests) X (# of
vectors) are required. If we're limited to 8 or 16 guests that's not
too bad, but since the server opens them all we're restricted to 1024,
but that's a pretty high ceiling for this purpose.
>
>
>
> --
> Do not meddle in the internals of kernels, for they are subtle and quick to
> panic.
>
>
next prev parent reply other threads:[~2010-03-25 18:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-25 6:08 [Qemu-devel] [PATCH v3 0/2] Inter-VM shared memory PCI device Cam Macdonell
2010-03-25 6:08 ` [Qemu-devel] [PATCH v3 1/2] Support adding a file to qemu's ram allocation Cam Macdonell
2010-03-25 6:08 ` [Qemu-devel] [PATCH v3 2/2] Inter-VM shared memory PCI device Cam Macdonell
2010-03-25 9:04 ` [Qemu-devel] Re: [PATCH v3 0/2] " Avi Kivity
2010-03-25 9:21 ` Michael S. Tsirkin
2010-03-25 16:11 ` Cam Macdonell
2010-03-25 9:26 ` Markus Armbruster
2010-03-25 9:37 ` Avi Kivity
2010-03-25 16:50 ` Cam Macdonell
2010-03-25 17:02 ` Avi Kivity
2010-03-25 17:35 ` Cam Macdonell
2010-03-25 17:48 ` Avi Kivity
2010-03-25 18:17 ` Cam Macdonell [this message]
2010-03-25 21:10 ` Avi Kivity
2010-03-25 23:05 ` Cam Macdonell
2010-03-26 15:56 ` Avi Kivity
2010-03-26 1:32 ` Jamie Lokier
2010-03-26 15:52 ` Cam Macdonell
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=8286e4ee1003251117o74486dck813a47cee54b2d6d@mail.gmail.com \
--to=cam@cs.ualberta.ca \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.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).