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: 111688 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp5584805ybm; Tue, 5 Sep 2017 07:52:23 -0700 (PDT) X-Received: by 10.98.219.6 with SMTP id f6mr1658274pfg.59.1504623143639; Tue, 05 Sep 2017 07:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504623143; cv=none; d=google.com; s=arc-20160816; b=dh1q15keMQIEQfMLK6+p220P9fr8sLiRXOvY2OzbIBLcqfYyZQ9p9JX9iCS3k7aat1 WTNDFaGVUzJ/spVqGyLFHsD75GFdEl1FWdS89zilxvbRF2i7DO9bKETmfUq2uggEvIf0 MrDmdl3SnVGPT8rITRJedcWfAS+KTW+HTlDxSbKVkNWoiVWcMYgpLTcd8tNgNsAoplab EsqG3vvsW6UNLcmuZMx+8E4udoeuGLStMbx/QaRqeyvdEGGaPmNpCtz/QfWL4gw02WSs /8ISV/z+E2OTBaHqj4hmFcimgtZA/11pre4cMlToVOjZivqdYzotW2JDwQgHkTiiG3dO 23wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=C5mcrcSYz1JszUCrY5rd4ytVwD04XUEXna1B0/tl3Ww=; b=MyXZg5h3l8idNYYlPQ7IszA0cT09ALhGP7yK53Cu2W5lZFTbrRJOtei8b/dNoDYnVX QDX5sWPfrEf/ceya+C+ScaVGS94oKcbCnsmhJ4wAosfj3OemxrSLzXH0/ThkW5e6A24z OA5ZMQzCsA62yQY5/OIg+4TOzk15K3vN5Vvm0DWuOFszJED5Qv0ROMAPD9gFA9SgpMuc FMQwVtct1mPP36PieQaOG93wUn21WUOsMyHW66REC8DaeVTdiP4QvnhQmjUT7yDwlUDY mVM9OVwldwABceCWHmsVv20zDCp206MFRHbqZTc/l2q523x7jO9BlIPypz1Y+x6Lwx2z ws3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S7KpyGHc; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2si365197pgd.499.2017.09.05.07.52.23; Tue, 05 Sep 2017 07:52:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S7KpyGHc; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751969AbdIEOwW (ORCPT + 6 others); Tue, 5 Sep 2017 10:52:22 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:37806 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778AbdIEOwS (ORCPT ); Tue, 5 Sep 2017 10:52:18 -0400 Received: by mail-wm0-f53.google.com with SMTP id u26so20488310wma.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=ozyMjH1CBQ4fTgxuP6J2t/nIRN3C76HzoJmjMB4/+pSQ+vaSaN8W4ZDzWYmn55cytT HKm/WRl4fRvM8o6T7A0edhKvwZVuI2+9nhLWOe5xje1Lj6a6QD9ZOxnbllPT6PMJiZdv 0MrnUMelRrHDJS3EwwHF4t4OPr9aS2ZJxR0AaFHTDVz5sBpZVEokCzDiNrwik5MuQrGx vhzqoONr0Aeq0221pvefYLmNs67esfUTZx8oEDnVvzlhZvWlikhQrRnUPYmbcPdiyY52 qUWKNlTtYS2+dH5yXFNVb/6qxzmScC12Ta8PM+OJVAHbAy1lxrXjzgn3XuUGKD33VYmn 8rpA== X-Gm-Message-State: AHPjjUiy+NdlpSZZRzFcb/93VbrFtz1kjCZQZNpOUwwyE7oU/ye3py/k IXUzSLuMqUxampR0 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?b?UmFkaW0gS3LEjW3DocWZ?= 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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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(-) -- 2.9.0 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;