All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: p.fedin@samsung.com (Pavel Fedin)
To: linux-arm-kernel@lists.infradead.org
Subject: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)
Date: Wed, 10 Jun 2015 18:30:13 +0300	[thread overview]
Message-ID: <05da01d0a392$58bf5030$0a3df090$@samsung.com> (raw)
In-Reply-To: <557842A0.9070503@linaro.org>

 Hi!

> indeed in newly added qemu kvm-all.c kvm_arch_msi_data_to_gsi we could
> call a new ioctl that translates the data + deviceid? into an LPI and
> program irqfd with that LPI. This is done once when setting irqfd up.
> This also means extending irqfd support to lpi injection, gsi being the
> LPI index if gsi >= 8192. in that case we continue using
> kvm_gsi_direct_mapping and gsi still is an IRQ index.

 This is exactly what i have done in my kernel + qemu. I have added a new KVM capability
and then in qemu i do this:
--- cut ---
    if (kvm_gsi_kernel_mapping()) {
        struct kvm_msi msi;

        msi.address_lo = (uint32_t)msg.address;
        msi.address_hi = msg.address >> 32;
        msi.data = le32_to_cpu(msg.data);
        memset(msi.pad, 0, sizeof(msi.pad));

        if (dev) {
            msi.devid = (pci_bus_num(dev->bus) << 8) | dev->devfn;
            msi.flags = KVM_MSI_VALID_DEVID;
        } else {
            msi.devid = 0;
            msi.flags = 0;
        }

        return kvm_vm_ioctl(s, KVM_TRANSLATE_MSI, &msi);
    }
--- cut ---
 KVM_TRANSLATE_MSI returns an LPI number. This seemed to be the simplest and fastest thing
to do.
 If someone is interested, i could prepare an RFC patch series for this, which would apply
on top of Andre's ITS implementation.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

WARNING: multiple messages have this Message-ID (diff)
From: Pavel Fedin <p.fedin@samsung.com>
To: 'Eric Auger' <eric.auger@linaro.org>,
	'Marc Zyngier' <marc.zyngier@arm.com>,
	'Andre Przywara' <Andre.Przywara@arm.com>,
	christoffer.dall@linaro.org
Cc: kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org
Subject: RE: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)
Date: Wed, 10 Jun 2015 18:30:13 +0300	[thread overview]
Message-ID: <05da01d0a392$58bf5030$0a3df090$@samsung.com> (raw)
In-Reply-To: <557842A0.9070503@linaro.org>

 Hi!

> indeed in newly added qemu kvm-all.c kvm_arch_msi_data_to_gsi we could
> call a new ioctl that translates the data + deviceid? into an LPI and
> program irqfd with that LPI. This is done once when setting irqfd up.
> This also means extending irqfd support to lpi injection, gsi being the
> LPI index if gsi >= 8192. in that case we continue using
> kvm_gsi_direct_mapping and gsi still is an IRQ index.

 This is exactly what i have done in my kernel + qemu. I have added a new KVM capability
and then in qemu i do this:
--- cut ---
    if (kvm_gsi_kernel_mapping()) {
        struct kvm_msi msi;

        msi.address_lo = (uint32_t)msg.address;
        msi.address_hi = msg.address >> 32;
        msi.data = le32_to_cpu(msg.data);
        memset(msi.pad, 0, sizeof(msi.pad));

        if (dev) {
            msi.devid = (pci_bus_num(dev->bus) << 8) | dev->devfn;
            msi.flags = KVM_MSI_VALID_DEVID;
        } else {
            msi.devid = 0;
            msi.flags = 0;
        }

        return kvm_vm_ioctl(s, KVM_TRANSLATE_MSI, &msi);
    }
--- cut ---
 KVM_TRANSLATE_MSI returns an LPI number. This seemed to be the simplest and fastest thing
to do.
 If someone is interested, i could prepare an RFC patch series for this, which would apply
on top of Andre's ITS implementation.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

  reply	other threads:[~2015-06-10 15:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10  8:31 IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation) Pavel Fedin
2015-06-10  8:31 ` Pavel Fedin
2015-06-10 13:58 ` Eric Auger
2015-06-10 13:58   ` Eric Auger
2015-06-10 15:30   ` Pavel Fedin [this message]
2015-06-10 15:30     ` Pavel Fedin
2015-06-17  9:21     ` Pavel Fedin
2015-06-17  9:34       ` Marc Zyngier
2015-06-17 10:00         ` Pavel Fedin
2015-06-17 11:02       ` Andre Przywara
2015-06-17 11:46         ` Pavel Fedin
2015-06-18  6:35           ` Eric Auger
2015-06-18 14:19             ` Pavel Fedin
2015-06-10 15:38   ` Pavel Fedin
2015-06-10 15:38     ` Pavel Fedin

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='05da01d0a392$58bf5030$0a3df090$@samsung.com' \
    --to=p.fedin@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.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.