From patchwork Tue May 9 10:45:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9717591 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 6F5B360237 for ; Tue, 9 May 2017 10:49:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6298E20683 for ; Tue, 9 May 2017 10:49:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56F74283F2; Tue, 9 May 2017 10:49:44 +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 E12E320683 for ; Tue, 9 May 2017 10:49:43 +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=A0Q3x1pqOlGZzd5V2nO8Z30XMf yElScPuTXqQngJ/HO8oemoP4obI5WFUO7/xUBEug3c4fIBb3339X+TW/kvbfGaSl6cnSfDUpd4XnA rOlrQj0ShneXiqnUmrIDaMKny3KQV6ASkW2QyPXpmakjf0GtX1xverluazmwCF52O2+/wjLFuFmdr 2L3TcypxceshDs4nshKLpYoEvZlSdmViG9qKy4QmqVPdW3GcndbPeG6TCqUzFrKY/7cKuxZ80Srz6 K2VcWzepPdhjQmNMPsg3T2NmjYiCIsqxsg7ZwhRnczBZkymoPtgxVPV/MSyxWChvLA0lX+4DuUswX 7DciMuxA==; 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 1d82i7-0007ef-Fl; Tue, 09 May 2017 10:49:43 +0000 Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d82ea-00033P-SK for linux-arm-kernel@lists.infradead.org; Tue, 09 May 2017 10:46:08 +0000 Received: by mail-qk0-x22b.google.com with SMTP id k74so75288370qke.1 for ; Tue, 09 May 2017 03:45:47 -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=FFBRjs/REu50j80h0PxLHtvtRqCtafraYzFXdcvGHf0RBL/lmn9SayzJM69EE7KPbO 41uT/9ree+/PqwKVlnTLt1ODcCk1ILOMsBQJnUJzT3RqXJerj3rway7cogZRWlxzyA8S Jl2VO5UN5NnWhU7WxPAi1NPbxLO0KsHfTtttc= 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=d0wjN7SDh0F8ceAcMp7f1qJ5MOe9CpgUFXubZsZcgjSjxZFYPSHB1KPiOhqUC0l13s oiv3C6Rjjsa663I7YTAXZMwhg/s+3NxTYeYP7BAuvEjWW19e9MwKUFUCZ83mn8+ZTICs +2pfs0ZFDeSW4N/1pmzQHWqlbwpx0CJxJA6afzPXNDNwY9UBFNUc3ApmI9/bbk9Wzhy8 AHMMXhhpRWzAo+PfQJWBNozMJGXZ34aw3vZo01zjdXgztioATU1Fk+dvcWlhWkBPEvNB hi5jPAc4phMSXbf443bjZvVyGDvsjzNwrHjDMnTWFSXwzhI/PtrqnJGNqIlKuJGi4PfG KZNA== X-Gm-Message-State: AN3rC/4oAx92tXgI+MKH6bKRDNJeuy904ocMP3/xVUkQwl5RI6ECAqle NgC2drmjv7QZqKks X-Received: by 10.80.163.213 with SMTP id t21mr17192678edb.158.1494326746983; Tue, 09 May 2017 03:45:46 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id o30sm2331510edc.42.2017.05.09.03.45.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 May 2017 03:45:46 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 36/37] KVM: arm/arm64: Don't call map_resources when restoring ITS tables Date: Tue, 9 May 2017 12:45:05 +0200 Message-Id: <20170509104506.30929-37-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170509104506.30929-1-cdall@linaro.org> References: <20170509104506.30929-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170509_034605_140670_C1B6EBED X-CRM114-Status: GOOD ( 11.64 ) 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: Christoffer Dall , kvm@vger.kernel.org, Marc Zyngier , Eric Auger , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org 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)