Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2756304imj; Mon, 11 Feb 2019 08:02:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IY8d8sfo9rjNKxXZrsH+xoAt3KQoD5L90IBM4r4LPnyYi23gxj/3NKvWpGsiQ80YiMkm5c2 X-Received: by 2002:a65:4807:: with SMTP id h7mr17378855pgs.15.1549900929916; Mon, 11 Feb 2019 08:02:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900929; cv=none; d=google.com; s=arc-20160816; b=RXLHo9GCri3WtsDKkJCnv/BTlyvOZeEhU4shYLLR8IJUI4SMM61OgJTIUlTLtiifKE widvzcPRWXg2asZXjM++S0RLOzbI9Vheo1qxs4hhY+vXeMF5bh0wnHRXtksfiNnAVoyC eBP2RTZMvAvOljt+/LRxSyZMyOBVahHjQItHLqTYH74QIrayvyPWRurDxP3dHki3mp4/ XgWL0UhOpAYqeKZLcW7TwRlvb1oWlpYvesx/F5lgvpouynskFVgkbFmJcAh6GYXVrnfi g/QvorGxdmF4R5A8xkUTn7i+yk2T2lfHjgGLWjGtbR2LWaRUZvHztcZxpQbvk9GMWPbl T8Zg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4LQXiNAgvIXxN6tNdiSySfnaz2L7D3qNLIrNylZTXGM=; b=ca36284AFzDx+n7YFTMBQgT6BDNxmX5rV8HXkWNGucKwrcLEPsxyvDbQYJoAUnTgU7 qHBU1ONmHLhhtQaPz3xLrY/FxmYl2ZfV8PJ1YH4aPSEzZ0ppUaXqLOe0lyExVk9icrrE lJ1VSO2yt4VEYE66+cN71yxbIH4nMXkGTt59JDJOlFnxCMsmCnvGZhuE89iO2/ttxpnT 6wE5a4RDzB+dvxcOUdLuKS4XIEBREY6IJEzdSrl+e50D/2x68p6Al/3nfKZo2g5YXPZ0 VdrqaZBmwXLgBA6KzYwRZgCihWQeZUdmYSWcH+Q9nKjlvVgTyZGnjW6ClmEghZ3T/iJP zSpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JQglVNMq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23si6360677pls.236.2019.02.11.08.01.51; Mon, 11 Feb 2019 08:02:09 -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=JQglVNMq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387397AbfBKQAn (ORCPT + 99 others); Mon, 11 Feb 2019 11:00:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:38480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730299AbfBKObb (ORCPT ); Mon, 11 Feb 2019 09:31:31 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 03B1120675; Mon, 11 Feb 2019 14:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895491; bh=eVSrLyBNHN/ekAFuXPZeX6v0b2Mx5XNx46IeyAT7Jfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JQglVNMq9SQyPhgUafl5BVmNbRo4JqZ6nQaxEaR22Ob3/qmmDwhqMJVDEG/jtBgCU qiLmEEBXA5ej+6Si7wiXBjITrxmgfdipAXg2xD7KdxvCm+r06m4nMOc7ZLIv76xsPK wmLVS3x4ZrTak+oQU8Ok4TckqvUVh0c6XzncPogA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Kardashevskiy , David Gibson , Michael Ellerman , Sasha Levin Subject: [PATCH 4.20 223/352] powerpc/powernv/ioda: Allocate indirect TCE levels of cached userspace addresses on demand Date: Mon, 11 Feb 2019 15:17:30 +0100 Message-Id: <20190211141901.424947442@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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