From patchwork Sat Jul 8 13:48:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shanker Donthineni X-Patchwork-Id: 9831477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7D914602BC for ; Sat, 8 Jul 2017 13:48:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D82B28174 for ; Sat, 8 Jul 2017 13:48:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61FF2282EC; Sat, 8 Jul 2017 13:48:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EDE528174 for ; Sat, 8 Jul 2017 13:48:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752729AbdGHNsi (ORCPT ); Sat, 8 Jul 2017 09:48:38 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:59946 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752097AbdGHNsg (ORCPT ); Sat, 8 Jul 2017 09:48:36 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0976D600C5; Sat, 8 Jul 2017 13:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1499521716; bh=UTx94MeJw5C0CnvWpuuAom6vtrnWrUwh3VZ0GFjDQRI=; h=From:To:Cc:Subject:Date:From; b=SfOFU8zYN67oF5q8fdB2dILKc8t6QbatTnuxsFSTVce6UBY0YEG4jmxfce2XmUYEb VrejZ3JY25dV0ZHNz0BoJ/gkDUmK60j3GOdUUpjpjkXpTB+HtttOY85bi0HG8olvW1 aYejZo7BfHoXtoOx9JL1YLEfyd1KpduTjq7U+Bpo= Received: from shankerd-ubuntu.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: shankerd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9B2E0600C5; Sat, 8 Jul 2017 13:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1499521715; bh=UTx94MeJw5C0CnvWpuuAom6vtrnWrUwh3VZ0GFjDQRI=; h=From:To:Cc:Subject:Date:From; b=oBcTRuzSZ3e0inRvQq0dpG4whhwqi95zL9iG7HnAOjEpeAitejG7Lp3ilVjtXL/e6 iuOPRj2kW5RVDw21z5Zyx4VZ53afvjmRhfZNV4mlat3/Np/b6+SrpvIcmqaEES6BV/ c0CTYjMHrhKdv1bocOTyaJ6ZUKIN439kBPAhWSvw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9B2E0600C5 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=shankerd@codeaurora.org From: Shanker Donthineni To: Marc Zyngier , Christoffer Dall Cc: linux-kernel , linux-arm-kernel , kvmarm , kvm , Eric Auger , Vikram Sethi , Andre Przywara , Shanker Donthineni Subject: [PATCH] KVM: arm/arm64: Fix bug in advertising KVM_CAP_MSI_DEVID capability Date: Sat, 8 Jul 2017 08:48:30 -0500 Message-Id: <1499521710-27494-1-git-send-email-shankerd@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;