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: 9939169 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 C761660350 for ; Tue, 5 Sep 2017 14:53:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8A6E2897B for ; Tue, 5 Sep 2017 14:53:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC8A52899B; Tue, 5 Sep 2017 14:53:05 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED 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 351742897B for ; Tue, 5 Sep 2017 14:53:05 +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:References: In-Reply-To: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:List-Owner; bh=waJx9PUwooVCUQ5278O4Q6SQ0LWhkttpqrN547hElWk=; b=ZQwPqWxwp9j7C9dwB6h4FlBFQO oHeoCRkHxdiAWBfbFXAp7NT5yiI1t8wbY8YWILz7KjJIJHw0Zvwzn2wQqf5cAtX9SUxGAeMWrxjjs +DBJOzHUQ1e2HhAWV9qU7XOvU4q/e7Mo7bqfyAiPaBkErUE/azEhuFaS2iFBt2a8ckOzB1MdC1vaS 3p83WUiQxwh4AGnGdYWhu9fq6YNg4oCc2R8l8aYYIFgAmskkEeboiE/izfI8S+JHSfvBaBl0ijYaI 6kFyfPzTI6P0J9I5xnPKmRFAUqRpuNNIxYLtCpE+8h7DsWobG2R5hK8OlXB0WDvueiMzP7Qq44hQx 9oT0qpEw==; 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 1dpFDo-0007uh-0D; Tue, 05 Sep 2017 14:53:00 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dpFDS-0007Z4-8b for linux-arm-kernel@lists.infradead.org; Tue, 05 Sep 2017 14:52:40 +0000 Received: by mail-wm0-x22f.google.com with SMTP id u26so20488312wma.0 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=GAOSWrncJLjfyCv8O3hCUDUMXLetS3CVdN9ZdU+yZghY03aParyoDITA1FsyiTHQct tSUf9kz9myfS+E9AoRJ3FOXGasAI6re7m1ANc1nKBjv8uPCJKagjc9WhGiIg12XJvN5c yPhX/5KmQp4XN9vHW19kOJW6+flTbGbyCkeUaCQS+p9I9X8us1JVpxb+uVtT9njr+K92 etB5hiMNoFgWc/zMOOUhyItd2ef4o26XHbpX4Vlz1TjNt0oKcF2cKAllMa9Zoaz7S64y jO38AeGtBf2M0h+zMnVvd4SxAERn2KX1TYS8GIctvYHjDcXxpW9QFuFzNRxSmuwMwYU2 p5CQ== X-Gm-Message-State: AHPjjUiP71JzA0ZwUcJPNnB199FmI6AlFieWIkVT1EtGNsJuWWpODo/B tX92CN8B+p4y5v4aXFAXvQ== 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?= 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170905_075238_469077_E1BA7032 X-CRM114-Status: GOOD ( 10.80 ) 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@vger.kernel.org, Marc Zyngier , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Shanker Donthineni 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 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;