All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alexander Graf <agraf@suse.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Alexey Kardashevskiy <aik@ozlabs.ru>,
	qemu-devel@nongnu.org,
	Alex Williamson <alex.williamson@redhat.com>,
	qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH 2/3] KVM: add kvm_arch_irqchip_add_msi_route
Date: Sat, 22 Jun 2013 08:21:45 +1000	[thread overview]
Message-ID: <1371853305.3944.83.camel@pasglop> (raw)
In-Reply-To: <B9E9CCF1-0FCA-42BA-A5FA-C3438CAE0AC9@suse.de>

On Sat, 2013-06-22 at 00:12 +0200, Alexander Graf wrote:
> On 21.06.2013, at 23:54, Benjamin Herrenschmidt wrote:
> 
> > On Fri, 2013-06-21 at 15:46 +0200, Alexander Graf wrote:
> >> Not sure. We could just declare a "direct virq==irq" mode in which
> >> msi.data == virq == irq. No need for any translation then.
> > 
> > Maybe. Beware that MSI data is only 16-bit on the wire but we may
> not
> > care here.
> > 
> > One thing I'm not 100% certain of is how Alexey makes all that work
> with
> > VFIO since the MSI address/data in the device shall not be the qemu
> > "cooked up" ones, but the real HW ones (corresponding to a different
> > host interrupt).
> > 
> > How do that work ?
> 
> The real device address/data go to a normal host interrupt vector.

Right, I know that :-)

>  Once we hit such a vector, we need to find out that it's destined for
> the guest in real mode - no idea how you planned to do that - and then
> reinject it back into the guest with the virtual irq vector that you
> can find out by asking the irqfd hopefully.
> 
> It might make sense to implement it the easy way without real mode
> first, and then take it from there ;).

We have that already. That isn't my question.

How is the "configuration" done ?

On x86, I assume, the guest kernel directly whacks the MSI config space
and MSI-X BAR space using some address/data it cooks up which are *not*
the real ones needed in the HW right ?

So qemu seems to play tricks to intercept the MSI-X BAR, I swa that, but
how does it know what real value to put in the HW instead ?

In our case, the guest calls RTAS, which needs to configure "something"
in the device. What does it do ?

Does it call into VFIO which then does a pci_enable_msi[x] ? In that
case how do you deal with a guest for example prodding a single MSI-X
in the middle of the array ? This is not an interface supported by
pci_enable_msix ....

Cheers,
Ben.

  reply	other threads:[~2013-06-21 22:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21  9:22 [Qemu-devel] [PATCH 0/3] RFCv2 kvm irqfd: add directly mapped MSI IRQ support Alexey Kardashevskiy
2013-06-21  9:22 ` [Qemu-devel] [PATCH 1/3] spapr pci msi: rework Alexey Kardashevskiy
2013-06-21 10:31   ` Alexander Graf
2013-06-21 10:52     ` Alexey Kardashevskiy
2013-06-21 11:58       ` Anthony Liguori
2013-06-21 11:59         ` Alexander Graf
2013-06-21 12:09         ` Benjamin Herrenschmidt
2013-06-21 12:02     ` Benjamin Herrenschmidt
2013-06-21  9:22 ` [Qemu-devel] [PATCH 2/3] KVM: add kvm_arch_irqchip_add_msi_route Alexey Kardashevskiy
2013-06-21 10:33   ` Alexander Graf
2013-06-21 12:03     ` Benjamin Herrenschmidt
2013-06-21 12:05       ` Alexander Graf
2013-06-21 12:10         ` Benjamin Herrenschmidt
2013-06-21 13:46           ` Alexander Graf
2013-06-21 21:54             ` Benjamin Herrenschmidt
2013-06-21 22:12               ` Alexander Graf
2013-06-21 22:21                 ` Benjamin Herrenschmidt [this message]
2013-06-21 23:10                   ` Alex Williamson
2013-06-21 23:19                     ` Benjamin Herrenschmidt
2013-06-21  9:22 ` [Qemu-devel] [PATCH 3/3] KVM: PPC: enable irqfd Alexey Kardashevskiy
2013-06-21 17:52   ` Scott Wood
2013-06-22  1:12     ` Alexey Kardashevskiy

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=1371853305.3944.83.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 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.