From patchwork Mon May 8 12:49:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9716173 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 AF3436035D for ; Mon, 8 May 2017 12:50:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABD6E1FF21 for ; Mon, 8 May 2017 12:50:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F97422B39; Mon, 8 May 2017 12:50:07 +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 2C40C1FF21 for ; Mon, 8 May 2017 12:50:07 +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=Cp7dUHsOna97DxBgWs9r7MYcdyBTUk5O+wgrxxMQfsU=; b=kajdMHmJATPKwTwODA0l6/n/KV Ff70Sd+o8YfDhc8uAGFXcyAyIFWq0ZYrSW3PHvdm9oNXb7G7L6O6YOODGBGe1TJw+o56/j3bYQwyO 2kVWJ06ZQJIxWll8zWRXq236USPWmNGb9dksMN1uVBs5RREjC/hVRHhOacVEm6h2u7eKk2lfC8Y5K F3BY39dWUqF+8FrOB0aH+nRRLK9SqLTrAhYJ77YR5jYICQlwtNa/XmMvccVWGgXVFObkXJSQgWm/L wiQMCYKK8PwQTEadcxMr2w/6ko+K0qQW1Rw3PR8gePN3JvjnqgwPlxEc3GKX9E8RRNz472lDF4/tq fDHSFttg==; 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 1d7i74-0001Jc-JU; Mon, 08 May 2017 12:50:06 +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 1d7i71-0000U7-IJ for linux-arm-kernel@lists.infradead.org; Mon, 08 May 2017 12:50:05 +0000 Received: by mail-wm0-x230.google.com with SMTP id n198so16865132wmg.0 for ; Mon, 08 May 2017 05:49:43 -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=VOk9onnldEePDRqIWLs9nd4G+IPELo1CoYfTdpq51d4=; b=cg+1VTAvAhzzoqrMozu6A4h2+L2hglYFV4V0+1ko1QtThAa1sP/1EiFJjD+VAc50iK hFJEx24LZx1PT9uG+BzZcoiaZyafzg1RY0rinyUZBnPU54XoaAc8YKpB6k59ocUkfH8X CeeaumS1EFohamotO2gt4HKpMomCYLZBdSeAo= 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=VOk9onnldEePDRqIWLs9nd4G+IPELo1CoYfTdpq51d4=; b=OUen2Gq4RhqaDvqphHYNM6A0EHzlE+oECR9rQd7xZ9iKl77Jj6gN6N8g5VRee2iwNK vfwkQgMx9N3cEz7A45oKBW4PdpYpuxbHYNyvBEZ74MqHEW5WgPBg1ldLWQK7mPBeO8KD 17E1MbD75q7c3/Vm1WBrNeI55gj8RaDDfNwGTGnNROMxehAfQrDpk1eTXeBJjJL1/KZb S1OEcD1LnSr0uGA04DumPQlxwb5BwTV/waJAza0SvxlrOLcKpgYIpKJtozEa6kT4s01Q eHxS/zcyNrcqJDeI+Xbq/amPer5phU1mHAiiqRXMEdoJoFcDeCRgP6Q7cb2BvapJyPta gP6g== X-Gm-Message-State: AN3rC/62VqxtJ63rewjKFzQgvb2EVS/wKeACRBvigqFrs5ierbZS85Fk yovwT7sgEYF+pb7/ X-Received: by 10.80.178.131 with SMTP id p3mr43999014edd.96.1494247781872; Mon, 08 May 2017 05:49:41 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id j50sm4193577eda.44.2017.05.08.05.49.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 May 2017 05:49:41 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH 9/8] KVM: arm/arm64: Don't call map_resources when restoring ITS tables Date: Mon, 8 May 2017 14:49:32 +0200 Message-Id: <20170508124932.28399-1-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170508115454.5075-1-cdall@linaro.org> References: <20170508115454.5075-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170508_055003_770010_ADB7F0EB X-CRM114-Status: GOOD ( 12.50 ) 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 --- Forgot to include this when posting the series, which was the whole point of the iodev rework in the first place. Apologies about the confusing 9/8 subject thing. 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 00f2990..9b67621 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -2316,20 +2316,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)