From patchwork Wed Feb 27 08:51:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 1048757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 448TwS4L7Jz9s2R for ; Wed, 27 Feb 2019 19:52:56 +1100 (AEDT) Received: from localhost ([127.0.0.1]:40355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyuxS-00045h-Hg for incoming@patchwork.ozlabs.org; Wed, 27 Feb 2019 03:52:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyuwf-00044g-Ct for qemu-devel@nongnu.org; Wed, 27 Feb 2019 03:52:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyuwe-0004CH-Ki for qemu-devel@nongnu.org; Wed, 27 Feb 2019 03:52:05 -0500 Received: from ozlabs.ru ([107.173.13.209]:35293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyuwe-0004BB-Eh; Wed, 27 Feb 2019 03:52:04 -0500 Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 42415AE807E8; Wed, 27 Feb 2019 03:52:00 -0500 (EST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Wed, 27 Feb 2019 19:51:46 +1100 Message-Id: <20190227085149.38596-4-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190227085149.38596-1-aik@ozlabs.ru> References: <20190227085149.38596-1-aik@ozlabs.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 107.173.13.209 Subject: [Qemu-devel] [PATCH qemu v3 3/6] vfio/spapr: Rename local systempagesize variable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Ricardo Ziviani , Alexey Kardashevskiy , Daniel Henrique Barboza , Alex Williamson , Sam Bobroff , Piotr Jaroszynski , qemu-ppc@nongnu.org, =?utf-8?q?Leonardo_Au?= =?utf-8?q?gusto_Guimar=C3=A3es_Garcia?= , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The "systempagesize" name suggests that it is the host system page size while it is the smallest page size of memory backing the guest RAM so let's rename it to stop confusion. This should cause no behavioral change. Signed-off-by: Alexey Kardashevskiy --- hw/vfio/spapr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c index 88437a7..57fe758 100644 --- a/hw/vfio/spapr.c +++ b/hw/vfio/spapr.c @@ -148,14 +148,14 @@ int vfio_spapr_create_window(VFIOContainer *container, uint64_t pagesize = memory_region_iommu_get_min_page_size(iommu_mr); unsigned entries, bits_total, bits_per_level, max_levels; struct vfio_iommu_spapr_tce_create create = { .argsz = sizeof(create) }; - long systempagesize = qemu_getrampagesize(); + long rampagesize = qemu_getrampagesize(); /* * The host might not support the guest supported IOMMU page size, * so we will use smaller physical IOMMU pages to back them. */ - if (pagesize > systempagesize) { - pagesize = systempagesize; + if (pagesize > rampagesize) { + pagesize = rampagesize; } pagesize = 1ULL << (63 - clz64(container->pgsizes & (pagesize | (pagesize - 1))));