From nobody Fri May 3 11:32:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490689024739279.9563285212985; Tue, 28 Mar 2017 01:17:04 -0700 (PDT) Received: from localhost ([::1]:51470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csmJL-0003GQ-Ht for importer@patchew.org; Tue, 28 Mar 2017 04:17:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csmGr-0001iJ-9P for qemu-devel@nongnu.org; Tue, 28 Mar 2017 04:14:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csmGm-0001E7-EW for qemu-devel@nongnu.org; Tue, 28 Mar 2017 04:14:29 -0400 Received: from ozlabs.ru ([107.173.13.209]:33698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csmGm-0001D4-8N; Tue, 28 Mar 2017 04:14:24 -0400 Received: from vpl2.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 03C6A3A60016; Tue, 28 Mar 2017 04:13:56 -0400 (EDT) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Tue, 28 Mar 2017 19:13:49 +1100 Message-Id: <20170328081349.18734-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 107.173.13.209 Subject: [Qemu-devel] [PATCH qemu] spapr_pci: Warn when RAM page size is not enabled in IOMMU page mask 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: Alexey Kardashevskiy , qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If a page size used by QEMU is not enabled in the PHB IOMMU page mask, in-kernel acceleration of TCE handling won't be enabled and performance might be slower than expected. This prints a warning if system page size is not enabled. This should print a warning if huge pages are enabled but sphb.pgsz still uses the default value of 4K|64K. Signed-off-by: Alexey Kardashevskiy --- This follow-up for "exec, spapr_pci: Advertise huge IOMMU pages". Instead of silently changing PHB properties+behaviour for better performance if huge pages are detected, this simply warns the user if IOMMU page mask needs to be adjusted. Since the user chooses huge pages in the first place, the user can also supply additional page masks as well. --- hw/ppc/spapr_pci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 98c52e411f..097ebdd51d 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1771,6 +1771,12 @@ static void spapr_phb_realize(DeviceState *dev, Erro= r **errp) } =20 /* DMA setup */ + if ((sphb->page_size_mask & qemu_getrampagesize()) =3D=3D 0) { + error_report("System page size 0x%lx is not enabled in page_size_m= ask " + "(0x%"PRIx64"). Performance may be slow", + qemu_getrampagesize(), sphb->page_size_mask); + } + for (i =3D 0; i < windows_supported; ++i) { tcet =3D spapr_tce_new_table(DEVICE(sphb), sphb->dma_liobn[i]); if (!tcet) { --=20 2.11.0