From patchwork Tue Sep 5 14:52:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9939153 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 8020960350 for ; Tue, 5 Sep 2017 14:52:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71C3A2897B for ; Tue, 5 Sep 2017 14:52:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6647A28995; Tue, 5 Sep 2017 14:52:25 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham 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 5CC682897B for ; Tue, 5 Sep 2017 14:52:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751967AbdIEOwW (ORCPT ); Tue, 5 Sep 2017 10:52:22 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:38119 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbdIEOwS (ORCPT ); Tue, 5 Sep 2017 10:52:18 -0400 Received: by mail-wm0-f41.google.com with SMTP id 187so20371702wmn.1 for ; Tue, 05 Sep 2017 07:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=C5mcrcSYz1JszUCrY5rd4ytVwD04XUEXna1B0/tl3Ww=; b=S7KpyGHcSXhyPIx3y3e6ltGj/augHWXYXlWPeNlZigojr/bBSLPy6ivms4QO2SO74U KLVkkRoLVNsi/fZOsk+1X5809e2L9jsJnB/R4dFNuwKioDen0pP/Om4hXXodrgtGKaEK NgnAXGX6FvOsk/N+avZApum6KOtoqV9BH9Rj4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=C5mcrcSYz1JszUCrY5rd4ytVwD04XUEXna1B0/tl3Ww=; b=MvqzJYUv3Pi5BrniHhBSbdo0CPBWvsxhrivuV01uwPkRuIuTnvRSaGM4nTCJtzaavg GF3dPym9UbjUsUXkHhbyY/8wF3RfEAsIRkwsaJ39lKOWTV7bG3X6tzas74J5RBWBmonT /AQR1VvXTPw4sPoLweEixQ1jTxbp1oZxD15lxT0HGd2NyFOtw31nO9CiMqOuoM1Jyy6+ u82lTKv9uNpyBiU/SGk+hDyM+14xM1c2m01iF2O7ObgP+AfqcaaMEXlqWgFLVGMsqpXM p5tE8Kw0QiKXHUR+/vfIHjuElP++K+15etLQIcj6fonog3zZ3SzkQB36oe+MfYZvCGe2 62rg== X-Gm-Message-State: AHPjjUj8ev6B1ri88G533ojLEQqGDBco+SI/jhXqzeM29sbP0uVryNhJ mQL7vKr/4AwAGb2D X-Google-Smtp-Source: ADKCNb7ZVt8BKCltBRGEy9n0az30aHEzfGJiP6X+D4lF9wYDi680V8J6Ezc0GWQFlFJCedvLB5PxbA== X-Received: by 10.80.143.67 with SMTP id 61mr3446553edy.290.1504623136567; Tue, 05 Sep 2017 07:52:16 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id a28sm293809edc.14.2017.09.05.07.52.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Sep 2017 07:52:15 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Shanker Donthineni , stable@vger.kernel.org Subject: [PULL 1/8] KVM: arm/arm64: Fix bug in advertising KVM_CAP_MSI_DEVID capability Date: Tue, 5 Sep 2017 16:52:00 +0200 Message-Id: <20170905145207.18447-2-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170905145207.18447-1-cdall@linaro.org> References: <20170905145207.18447-1-cdall@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shanker Donthineni 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. Cc: stable@vger.kernel.org Fixes: 0e4e82f154e3 ("vgic-its: Enable ITS emulation as a virtual MSI controller") Signed-off-by: Shanker Donthineni Signed-off-by: Marc Zyngier --- 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;