Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752740AbdGIV0b (ORCPT ); Sun, 9 Jul 2017 17:26:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43884 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752596AbdGIV03 (ORCPT ); Sun, 9 Jul 2017 17:26:29 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D12273DD47 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=eric.auger@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D12273DD47 Subject: Re: [PATCH] KVM: arm/arm64: Fix bug in advertising KVM_CAP_MSI_DEVID capability To: Shanker Donthineni , Marc Zyngier , Christoffer Dall References: <1499521710-27494-1-git-send-email-shankerd@codeaurora.org> Cc: kvm , Vikram Sethi , Andre Przywara , linux-kernel , kvmarm , linux-arm-kernel From: Auger Eric Message-ID: <37e9a495-e6e0-9d74-a205-3f8291edd3bb@redhat.com> Date: Sun, 9 Jul 2017 23:26:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1499521710-27494-1-git-send-email-shankerd@codeaurora.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 09 Jul 2017 21:26:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1850 Lines: 55 Hi, On 08/07/2017 15:48, Shanker Donthineni wrote: > Commit 0e4e82f154e3 ("KVM: arm64: vgic-its: Enable ITS emulation as > a virtual MSI controller") tried to advertise KVM_CAP_MSI_DEVID, but > the code logic was not updating the dist->msis_require_devid field > correctly. If hypervisor tool creates the ITS device after VGIC > initialization then we don't advertise KVM_CAP_MSI_DEVID capability. > > Update the field msis_require_devid to true inside vgic_its_create() > to fix the issue. > > Fixes: 0e4e82f154e3 ("vgic-its: Enable ITS emulation as a virtual MSI controller") > Signed-off-by: Shanker Donthineni Reviewed-by: Eric Auger In QEMU the capability is not checked as "kvm_msi_use_devid" is directly set in the ITS device :-( Thanks Eric > --- > virt/kvm/arm/vgic/vgic-init.c | 3 --- > virt/kvm/arm/vgic/vgic-its.c | 1 + > 2 files changed, 1 insertion(+), 3 deletions(-) > > diff --git a/virt/kvm/arm/vgic/vgic-init.c b/virt/kvm/arm/vgic/vgic-init.c > index 3a0b899..5801261 100644 > --- a/virt/kvm/arm/vgic/vgic-init.c > +++ b/virt/kvm/arm/vgic/vgic-init.c > @@ -285,9 +285,6 @@ int vgic_init(struct kvm *kvm) > if (ret) > goto out; > > - if (vgic_has_its(kvm)) > - dist->msis_require_devid = true; > - > kvm_for_each_vcpu(i, vcpu, kvm) > kvm_vgic_vcpu_enable(vcpu); > > diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c > index 2dff288..aa6b68d 100644 > --- a/virt/kvm/arm/vgic/vgic-its.c > +++ b/virt/kvm/arm/vgic/vgic-its.c > @@ -1598,6 +1598,7 @@ static int vgic_its_create(struct kvm_device *dev, u32 type) > INIT_LIST_HEAD(&its->device_list); > INIT_LIST_HEAD(&its->collection_list); > > + dev->kvm->arch.vgic.msis_require_devid = true; > dev->kvm->arch.vgic.has_its = true; > its->enabled = false; > its->dev = dev; >