Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3633207imu; Mon, 28 Jan 2019 08:10:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN6h+Or/HPMGcpp5EGYiZsV1CQjpDoXBbOdyMvDPS5HjdJOSlvXZUo4oFe2VvqQZuiha6BSm X-Received: by 2002:a63:3287:: with SMTP id y129mr20395478pgy.337.1548691802374; Mon, 28 Jan 2019 08:10:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691802; cv=none; d=google.com; s=arc-20160816; b=YEaRwzFbaABhzOb+rk90co/kBOJAuEY4T52Skf3Yv3ncaQ2ehnD0StXOs19AOlFH8P JbzzdY/XgvqcEcAEkm9gsEhc57Rww+7BUcIQLcJC49YP+kgJ6UXGkelseleJV3rY3Yb4 aXNRhZ6zFznjToApp95sbAcUP3CL5N58xJesKOeJkD7rlX+i63GP0onUg5RY5qPHDZSf Q27dnfGqB333COKojFopWMIbMpsvIxP6tzGe3O11Qlb+Bqxrt2p7FLupg8ZoKLB+72mf fih7HENu3vA3d6NFUbvL6VVHjGLmG0T4Qrj3M7tIdj9ykBXxSU7GtxKGYdW7qblad0M2 gAIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uLx95LufN6++seuHYiG52ZpuiIx3Dgp2S6D3KeLRQF4=; b=cbdztqfBt0TncuPOnOXE9ydEh9uVimMrwAmSfyHaDzRkGnRAN4YDciJNqJ2DDZuusO jPOVXs/HsbW9yetEncSyuiAAThtzFi/6dYG+BgCoToRTp14pmuzGzhWRBc5RjIGZK0Yv jjlL6tz0DaCYBMfApwcnlbVaBxuC1sIm+M2diRT94y612LkFhKC/mUhNt9mZVq4dVvuJ Dg1ziwu/8kMmwDdjYPdNGMCjXiz6QisluXu5DpiTiKHcH8lbbCh28f+ku34EUrWGAarr 0uFWc57oSH4aI6cQgIJrpIFkfiZvhGZ2xAbDPBJ0mcWSjdIQRoj3vPfYv4pqjJIUnNCF z35g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=APs4goYU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bb4si33259272plb.322.2019.01.28.08.09.45; Mon, 28 Jan 2019 08:10:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=APs4goYU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732468AbfA1QIp (ORCPT + 99 others); Mon, 28 Jan 2019 11:08:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:60838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732461AbfA1QIo (ORCPT ); Mon, 28 Jan 2019 11:08:44 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A51E720989; Mon, 28 Jan 2019 16:08:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691723; bh=JDDUV0KKYNt7q1gDb0bK78KXVMEp4pemqksnRIQr3OE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=APs4goYU60Atqh5WP+p1GnqCxiFhOmSptjbLjJhEdpOa2XVow/aqWZgPD9/mzPLHb 3uF928RQsAjccBbeV5AHnTB8EYGGfi8nhEuFWjto+sXgve62OpeBC/RIT8Rz3xHCZY a3kDS9Ntn+uq9+8Ny00eJYqC4K5eG1E1tDMfounk= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexey Kardashevskiy , Michael Ellerman , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 4.19 197/258] powerpc/powernv/ioda: Allocate indirect TCE levels of cached userspace addresses on demand Date: Mon, 28 Jan 2019 10:58:23 -0500 Message-Id: <20190128155924.51521-197-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexey Kardashevskiy [ Upstream commit bdbf649efe21173cae63b4b71db84176420f9039 ] The powernv platform maintains 2 TCE tables for VFIO - a hardware TCE table and a table with userspace addresses; the latter is used for marking pages dirty when corresponging TCEs are unmapped from the hardware table. a68bd1267b72 ("powerpc/powernv/ioda: Allocate indirect TCE levels on demand") enabled on-demand allocation of the hardware table, however it missed the other table so it has still been fully allocated at the boot time. This fixes the issue by allocating a single level, just like we do for the hardware table. Fixes: a68bd1267b72 ("powerpc/powernv/ioda: Allocate indirect TCE levels on demand") Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/platforms/powernv/pci-ioda-tce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda-tce.c b/arch/powerpc/platforms/powernv/pci-ioda-tce.c index fe9691040f54..7639b2168755 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda-tce.c +++ b/arch/powerpc/platforms/powernv/pci-ioda-tce.c @@ -299,7 +299,7 @@ long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset, if (alloc_userspace_copy) { offset = 0; uas = pnv_pci_ioda2_table_do_alloc_pages(nid, level_shift, - levels, tce_table_size, &offset, + tmplevels, tce_table_size, &offset, &total_allocated_uas); if (!uas) goto free_tces_exit; -- 2.19.1