From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: Re: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation) Date: Wed, 17 Jun 2015 10:34:34 +0100 Message-ID: <55813F2A.9060102@arm.com> References: <042601d0a357$d3cec4d0$7b6c4e70$@samsung.com> <557842A0.9070503@linaro.org> <05da01d0a392$58bf5030$0a3df090$@samsung.com> <011601d0a8de$f75b8280$e6128780$@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" To: Pavel Fedin , 'Eric Auger' , Andre Przywara , "christoffer.dall@linaro.org" Return-path: Received: from foss.arm.com ([217.140.101.70]:38856 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752520AbbFQJeh (ORCPT ); Wed, 17 Jun 2015 05:34:37 -0400 In-Reply-To: <011601d0a8de$f75b8280$e6128780$@samsung.com> Sender: kvm-owner@vger.kernel.org List-ID: On 17/06/15 10:21, Pavel Fedin wrote: > PING! > The discussion has suddenly stopped... What is our status? Is ITS v2 patch being > developed, or what? And do we have some conclusion on irqfd ? Hmmm. You may not have noticed it, but we're actually all are quite busy at the moment (hint, we're at -rc8, and the next merge window is about to open). As for the state of the ITS, it is still in review, and I expect Andre will post an updated series after the merge window. As for your irqfd proposal, see below: > Kind regards, > Pavel Fedin > Expert Engineer > Samsung Electronics Research center Russia > > >> -----Original Message----- >> From: kvm-owner@vger.kernel.org [mailto:kvm-owner@vger.kernel.org] On Behalf Of Pavel >> Fedin >> Sent: Wednesday, June 10, 2015 6:30 PM >> To: 'Eric Auger'; 'Marc Zyngier'; 'Andre Przywara'; 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) >> >> 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. This feels just wrong. The LPI number is under complete control of the guest, and can be changed at any time. You can never rely on it to be stable. Thanks, M. -- Jazz is not dead. It just smells funny...