From patchwork Tue May 9 08:56:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9717353 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 2854B60365 for ; Tue, 9 May 2017 08:58:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B1A328389 for ; Tue, 9 May 2017 08:58:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D612283FD; Tue, 9 May 2017 08:58:36 +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 99B6228389 for ; Tue, 9 May 2017 08:58:35 +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=uGpv67gEIYFWHC8aSHAT9T+PEiy8bjPCQg3reLPWSOY=; b=A4Ufw9MoOdilIf2mdUORotjoqh IPbzSahkT8RibCJjFcW8r+2TU2F7pV1bG3Z24qtxUN5QAcF3Y6RiyoJ8PALE9FPq5brXcVVk2Wnd/ QvsicmANT0DMRUKkp7W3hVp6iM+NSGoccmXt69pIATyek0lVpTr2r5+4c9RVOQjOnOqIxQ8xaWvWM UxhCAVUeRuqzOCZIkBpq6sQ+4SV/YjS2cWVqBOibdnB9MVe5CicOGWg6dGz0rVbKkd0w+8d6CT0U7 qbEsQuilPMzI7wPmH1lFESiwoY87R6lHrJVhHR4BngdS2CTfYEeXFE6/aK6CHCGL+fdB5GZSY9nQn NkKjAEww==; 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 1d80yY-0004S4-Rb; Tue, 09 May 2017 08:58:34 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d80wx-0002Jt-5m for linux-arm-kernel@lists.infradead.org; Tue, 09 May 2017 08:56:59 +0000 Received: by mail-wm0-x230.google.com with SMTP id 142so92908257wma.1 for ; Tue, 09 May 2017 01:56:34 -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=A4J4CVGR6Fm/qU6L4jCnyzn0rO/Adn+EPIv6B1uWCpM=; b=gkCNgpdV+uFXXhcwgV7M127SEvUrFUAwAvt7j7fNzidKH9EKuYnyaZVk/PW30HwkFq cHcPctq1FzTlhygG0d7buimwn/yE2jpjYTB4cVQMltFFaBDxOCRVG///vpAikXkdQ4AO KAVFtBU8pRrlMq8QIdRhdl5Ess+u/aexq/5NU= 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=A4J4CVGR6Fm/qU6L4jCnyzn0rO/Adn+EPIv6B1uWCpM=; b=Y/LbxhdO4q9Szk9cFHKHljMc7kUfD9ObJpGac0UP6vpodzYKJDpCWtFy4DCCCtLVSi isVENUFYzOHVXOWdUGmOhdU9os8Oqhu50z1e9Wv0yZflOC6nhsCpzY0D8AB1WcD64Dqx 2V8GTors/jopREk6JGp8JCg1JwVUUwLpfOA2VvZARVziUWfxDAtmAD6I6tHfGON1d+6p 0tf6QuECauhDoCoNZkYLIG6dbemeBNMQhfjSviGcMd7hMEm6fNbcyiruOJLyGLHfTygj HM7xamfzwJMG8Ow44ydTIxfHfjdtaRyqNRMn3c3zoUQwgK8aHzWPI+3MBI4pX+2rr52N d1DQ== X-Gm-Message-State: AN3rC/4qFGZaje3XQtvlz4catyQBbCrQOONpchstr/WEvkOsOMaSYf8r koVVP06T3bdvxeNW X-Received: by 10.80.145.174 with SMTP id g43mr19786993eda.179.1494320193326; Tue, 09 May 2017 01:56:33 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id f40sm8376265edb.7.2017.05.09.01.56.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 May 2017 01:56:32 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 10/11] KVM: arm/arm64: Don't call map_resources when restoring ITS tables Date: Tue, 9 May 2017 10:56:17 +0200 Message-Id: <20170509085618.28311-11-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170509085618.28311-1-cdall@linaro.org> References: <20170509085618.28311-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170509_015655_929709_9EC450C6 X-CRM114-Status: GOOD ( 12.28 ) 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: Marc Zyngier , Eric Auger , kvm@vger.kernel.org, Christoffer Dall 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 The only reason we called kvm_vgic_map_resources() when restoring the ITS tables was because we wanted to have the KVM iodevs registered in the KVM IO bus framework at the time when the ITS was restored such that a restored and active device can inject MSIs prior to otherwise calling kvm_vgic_map_resources() from the first run of a VCPU. Since we now register the KVM iodevs for the redestributors and ITS as soon as possible (when setting the base addresses), we no longer need this call and kvm_vgic_map_resources() is again called only when first running a VCPU. Signed-off-by: Christoffer Dall Reviewed-by: Eric Auger --- virt/kvm/arm/vgic/vgic-its.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index 89acaef..9aeaff0 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -2308,20 +2308,12 @@ static int vgic_its_restore_tables_v0(struct vgic_its *its) goto out; ret = vgic_its_restore_device_tables(its); - out: unlock_all_vcpus(kvm); mutex_unlock(&its->its_lock); mutex_unlock(&kvm->lock); - if (ret) - return ret; - - /* - * On restore path, MSI injections can happen before the - * first VCPU run so let's complete the GIC init here. - */ - return kvm_vgic_map_resources(its->dev->kvm); + return ret; } static int vgic_its_commit_v0(struct vgic_its *its)