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: 9831479 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 289B2602BC for ; Sat, 8 Jul 2017 13:49:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 182E528174 for ; Sat, 8 Jul 2017 13:49:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09E3E282EC; Sat, 8 Jul 2017 13:49:24 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 98C4628174 for ; Sat, 8 Jul 2017 13:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Tqtn47bvNq9/qiANCCJfEqizr7tcjGtHbs8205AdHRs=; b=ckd yQcjXinGQBtdjA206CA4vA+35wsurfWIFl48Ossw6wJwFE7DMaSzL8xmAYRnY5/Pu65xxISMrjpIz hOyVAhW5No9mdyFDVnnz+NJqAk1ew5/n4EjcwVSNeuf3C1Keg4zG3rCCIMs/+QmJJHR1lGsl4ZZso H839Y+CvP1VHPT0YblxPH/BDosdOoj0dRt5CvsZSKTRk1DCW5asFHAYVEB7k2JqM56Wms+sBDo0Oq J2jaPdyVpjhidKeusH3V3RqJvaBCuQEAtkXU8h3i05KnQOEe/lhZtUqVcN9yDY9nXdD90JQLMsJ8m xlObDEO6Hjq8ek+hie0A6+EgmSQLZTw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dTq6r-00064N-Di; Sat, 08 Jul 2017 13:49:21 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dTq6T-00061k-9E for linux-arm-kernel@lists.infradead.org; Sat, 08 Jul 2017 13:48:58 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2388D6073E; 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170708_064857_417494_2C19AA02 X-CRM114-Status: GOOD ( 10.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm , Vikram Sethi , Andre Przywara , linux-kernel , Eric Auger , Shanker Donthineni , kvmarm , linux-arm-kernel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;