From: Arnd Bergmann <arnd@arndb.de>
To: Cam Macdonell <cam@cs.ualberta.ca>
Cc: Avi Kivity <avi@redhat.com>, qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [PATCH] Inter-VM shared memory PCI device
Date: Tue, 9 Mar 2010 13:49:50 +0100 [thread overview]
Message-ID: <201003091349.51344.arnd@arndb.de> (raw)
In-Reply-To: <8286e4ee1003080957v9bb4837x187cebb8477348c2@mail.gmail.com>
On Monday 08 March 2010, Cam Macdonell wrote:
> enum ivshmem_registers {
> IntrMask = 0,
> IntrStatus = 2,
> Doorbell = 4,
> IVPosition = 6,
> IVLiveList = 8
> };
>
> The first two registers are the interrupt mask and status registers.
> Interrupts are triggered when a message is received on the guest's eventfd from
> another VM. Writing to the 'Doorbell' register is how synchronization messages
> are sent to other VMs.
>
> The IVPosition register is read-only and reports the guest's ID number. The
> IVLiveList register is also read-only and reports a bit vector of currently
> live VM IDs.
>
> The Doorbell register is 16-bits, but is treated as two 8-bit values. The
> upper 8-bits are used for the destination VM ID. The lower 8-bits are the
> value which will be written to the destination VM and what the guest status
> register will be set to when the interrupt is trigger is the destination guest.
> A value of 255 in the upper 8-bits will trigger a broadcast where the message
> will be sent to all other guests.
This means you have at least two intercepts for each message:
1. Sender writes to doorbell
2. Receiver gets interrupted
With optionally two more intercepts in order to avoid interrupting the
receiver every time:
3. Receiver masks interrupt in order to process data
4. Receiver unmasks interrupt when it's done and status is no longer pending
I believe you can do much better than this, you combine status and mask
bits, making this level triggered, and move to a bitmask of all guests:
In order to send an interrupt to another guest, the sender first checks
the bit for the receiver. If it's '1', no need for any intercept, the
receiver will come back anyway. If it's zero, write a '1' bit, which
gets OR'd into the bitmask by the host. The receiver gets interrupted
at a raising edge and just leaves the bit on, until it's done processing,
then turns the bit off by writing a '1' into its own location in the mask.
Arnd
next prev parent reply other threads:[~2010-03-09 12:49 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-05 23:52 [PATCH] Support adding a file to qemu's ram allocation Cam Macdonell
2010-03-05 23:52 ` [PATCH] Inter-VM shared memory PCI device Cam Macdonell
2010-03-07 22:53 ` [Qemu-devel] " Paul Brook
2010-03-08 1:45 ` Jamie Lokier
2010-03-08 9:48 ` Alexander Graf
2010-03-08 9:54 ` Jamie Lokier
2010-03-08 10:57 ` Alexander Graf
2010-03-09 21:41 ` Anthony Liguori
2010-03-08 13:04 ` Paul Brook
2010-03-09 19:00 ` Jamie Lokier
2010-03-08 9:52 ` Avi Kivity
2010-03-08 13:03 ` Paul Brook
2010-03-08 13:16 ` Avi Kivity
2010-03-09 20:11 ` Jamie Lokier
2010-03-09 21:44 ` Anthony Liguori
2010-03-10 9:25 ` Avi Kivity
2010-03-10 17:13 ` [Qemu-devel] " Anthony Liguori
2010-03-10 17:30 ` Avi Kivity
2010-03-10 17:41 ` Paul Brook
2010-03-11 6:33 ` Avi Kivity
2010-03-11 12:21 ` Paul Brook
2010-03-09 20:12 ` Jamie Lokier
2010-03-10 0:03 ` Paul Brook
2010-03-10 4:38 ` Cam Macdonell
2010-03-10 9:29 ` Avi Kivity
2010-03-10 11:13 ` [Qemu-devel] " Paul Brook
2010-03-11 3:10 ` Jamie Lokier
2010-03-11 4:37 ` Nick Piggin
2010-03-11 14:38 ` malc
2010-03-08 9:56 ` Avi Kivity
2010-03-08 17:57 ` Cam Macdonell
2010-03-09 10:29 ` Avi Kivity
[not found] ` <8286e4ee1003090724m1ef0b571g8b705a24e36e1753@mail.gmail.com>
2010-03-09 15:27 ` Cam Macdonell
2010-03-09 17:28 ` Avi Kivity
2010-03-09 17:34 ` Anthony Liguori
2010-03-09 18:34 ` Cam Macdonell
2010-03-10 9:21 ` Avi Kivity
2010-03-10 16:36 ` Cam Macdonell
2010-03-11 6:49 ` Avi Kivity
2010-03-09 12:49 ` Arnd Bergmann [this message]
2010-03-09 13:03 ` Avi Kivity
2010-03-09 16:44 ` Cam Macdonell
2010-03-10 14:04 ` Arnd Bergmann
2010-03-11 6:50 ` Avi Kivity
2010-03-11 12:57 ` Arnd Bergmann
2010-03-11 13:07 ` Avi Kivity
2010-03-11 14:32 ` Arnd Bergmann
2010-03-08 9:53 ` [PATCH] Support adding a file to qemu's ram allocation Avi Kivity
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=201003091349.51344.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=avi@redhat.com \
--cc=cam@cs.ualberta.ca \
--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