Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753112AbbGBHxN (ORCPT ); Thu, 2 Jul 2015 03:53:13 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:9704 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750943AbbGBHxF (ORCPT ); Thu, 2 Jul 2015 03:53:05 -0400 X-AuditID: cbfec7f5-f794b6d000001495-cf-5594eddec1b7 From: Pavel Fedin To: "'Eric Auger'" , eric.auger@st.com, linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, christoffer.dall@linaro.org, andre.przywara@arm.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, patches@linaro.org, pbonzini@redhat.com References: <1435592237-17924-1-git-send-email-eric.auger@linaro.org> <1435592237-17924-8-git-send-email-eric.auger@linaro.org> In-reply-to: <1435592237-17924-8-git-send-email-eric.auger@linaro.org> Subject: RE: [PATCH 7/7] KVM: arm: implement kvm_set_msi by gsi direct mapping Date: Thu, 02 Jul 2015 10:53:01 +0300 Message-id: <015501d0b49c$1f1349c0$5d39dd40$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQIj+X5s5FdAGWwAOFAf7dE3NOV/zwF13PvTnRWVa2A= Content-language: ru X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLIsWRmVeSWpSXmKPExsVy+t/xq7r33k4JNXizW9JixbyfjBYvXv9j tJi/5QyrxdXNZ5ks5kwttPh46ji7xabH11gtLu+aw2bx984/Nosph7+wWOzf9o/Vgdtjzbw1 jB53ru1h8zi/aQ2zx+Yl9R7v911l83j6Yy+zx+dNcgHsUVw2Kak5mWWpRfp2CVwZk88lFlwV qti5bRJbA+Nm/i5GTg4JAROJSXMes0PYYhIX7q1n62Lk4hASWMoo8aHnBguE851R4vKBiYwg VWwC6hKnv34AS4gIPGWUaFrXyAKSYBbwlLj6fTFURyOjRP+KQ2BzOQXcJI7dO8UGYgsL+Eks 7HsO1sAioCox49YvZhCbV8BSYtrLrUwQtqDEj8n3oIZqSazfeZwJwpaX2LzmLTPErQoSO86+ BrtIRMBKovVaOytEjYjEtH/3mCcwCs1CMmoWklGzkIyahaRlASPLKkbR1NLkguKk9FwjveLE 3OLSvHS95PzcTYyQSPu6g3HpMatDjAIcjEo8vCtqpoQKsSaWFVfmHmKU4GBWEuFd/xIoxJuS WFmVWpQfX1Sak1p8iFGag0VJnHfmrvchQgLpiSWp2ampBalFMFkmDk6pBsbZraKlU2+rZK00 Ws2QOe/zSr9fWyv7Bdr/zv444+DC7a8vCF6R2RojU/nZQkJHI9m1S/Xotxc8JlnPp1x+ILco ca5Fge7Ky5ecNARv33evZA1X3hzXbSu7XaIhL2miyNe8pTasFpO8fv/YufuSzUHTWfGvjWo2 bdFuYVsSv7ns65pljx/277qqxFKckWioxVxUnAgAInOeELACAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2567 Lines: 73 Hello! > -----Original Message----- > From: kvm-owner@vger.kernel.org [mailto:kvm-owner@vger.kernel.org] On Behalf Of Eric Auger > Sent: Monday, June 29, 2015 6:37 PM > To: eric.auger@st.com; eric.auger@linaro.org; linux-arm-kernel@lists.infradead.org; > marc.zyngier@arm.com; christoffer.dall@linaro.org; andre.przywara@arm.com; > kvmarm@lists.cs.columbia.edu; kvm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org; patches@linaro.org; p.fedin@samsung.com; pbonzini@redhat.com > Subject: [PATCH 7/7] KVM: arm: implement kvm_set_msi by gsi direct mapping > > If the ITS modality is not available, let's simply support MSI > injection by transforming the MSI.data into an SPI ID. > > This becomes possible to use KVM_SIGNAL_MSI ioctl for arm too. > > Signed-off-by: Eric Auger > --- > arch/arm/kvm/Kconfig | 1 + > virt/kvm/arm/vgic.c | 5 +++++ > 2 files changed, 6 insertions(+) > > diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig > index 151e710..0f58baf 100644 > --- a/arch/arm/kvm/Kconfig > +++ b/arch/arm/kvm/Kconfig > @@ -31,6 +31,7 @@ config KVM > select KVM_VFIO > select HAVE_KVM_EVENTFD > select HAVE_KVM_IRQFD > + select HAVE_KVM_MSI > select HAVE_KVM_IRQCHIP > select HAVE_KVM_IRQ_ROUTING > depends on ARM_VIRT_EXT && ARM_LPAE && ARM_ARCH_TIMER > diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c > index 0b4c48c..b3c10dc 100644 > --- a/virt/kvm/arm/vgic.c > +++ b/virt/kvm/arm/vgic.c > @@ -2314,6 +2314,11 @@ int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e, > return kvm->arch.vgic.vm_ops.inject_msi(kvm, &msi); > else > return -ENODEV; > + case KVM_IRQ_ROUTING_MSI: > + if (kvm->arch.vgic.vm_ops.inject_msi) > + return -EINVAL; > + else > + return kvm_vgic_inject_irq(kvm, 0, e->msi.data, level); Given API change i suggest (using KVM_MSI_VALID_DEVID flag), we could get rid of all these if()'s here. Just forward all parameters to vGIC implementation code and let it do its checks. > default: > return -EINVAL; > } > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/