From nobody Wed Nov 5 08:43:20 2025 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.zohomail.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 1504112783751912.1525158955277; Wed, 30 Aug 2017 10:06:23 -0700 (PDT) Received: from localhost ([::1]:51680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn6RY-00059w-OL for importer@patchew.org; Wed, 30 Aug 2017 13:06:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn6FU-0001tf-Jv for qemu-devel@nongnu.org; Wed, 30 Aug 2017 12:53:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dn6FQ-0005C6-Mf for qemu-devel@nongnu.org; Wed, 30 Aug 2017 12:53:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44310) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dn6FQ-0005Br-D8 for qemu-devel@nongnu.org; Wed, 30 Aug 2017 12:53:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 41BB24A6E6; Wed, 30 Aug 2017 16:53:47 +0000 (UTC) Received: from localhost (ovpn-116-210.ams2.redhat.com [10.36.116.210]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 045A35D722; Wed, 30 Aug 2017 16:53:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 41BB24A6E6 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Wed, 30 Aug 2017 18:52:20 +0200 Message-Id: <20170830165252.13421-13-cohuck@redhat.com> In-Reply-To: <20170830165252.13421-1-cohuck@redhat.com> References: <20170830165252.13421-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 30 Aug 2017 16:53:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/44] configure: enable --s390-pgste linker option 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: thuth@redhat.com, david@redhat.com, Cornelia Huck , agraf@suse.de, Christian Ehrhardt , qemu-devel@nongnu.org, borntraeger@de.ibm.com, Dan Horak , rth@twiddle.net 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" From: Christian Borntraeger KVM guests on s390 need a different page table layout than normal processes (2kb page table + 2kb page status extensions vs 2kb page table only). As of today this has to be enabled via the vm.allocate_pgste sysctl. Newer kernels (>=3D 4.12) on s390 check for an S390_PGSTE program header and enable the pgste page table extensions in that case. This makes the vm.allocate_pgste sysctl unnecessary. We enable this program header for the s390 system emulation (qemu-system-s390x) if we build on s390 - for s390 system emulation - the linker supports --s390-pgste (binutils >=3D 2.29) - KVM is enabled This will allow distributions to disable the global vm.allocate_pgste sysctl, which will improve the page table allocation for non KVM processes as only 2kb chunks are necessary. Cc: Christian Ehrhardt Cc: Alexander Graf Cc: Dan Horak Cc: David Hildenbrand Signed-off-by: Christian Borntraeger Acked-by: Janosch Frank Reviewed-by: Thomas Huth Message-Id: <1503483383-199649-1-git-send-email-borntraeger@de.ibm.com> Reviewed-by: David Hildenbrand Signed-off-by: Cornelia Huck --- configure | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/configure b/configure index dd73cce62f..fb7e34a901 100755 --- a/configure +++ b/configure @@ -240,6 +240,11 @@ supported_target() { return 1 } =20 + +ld_has() { + $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1 +} + # default parameters source_path=3D$(dirname "$0") cpu=3D"" @@ -5043,7 +5048,7 @@ fi # Use ASLR, no-SEH and DEP if available if test "$mingw32" =3D "yes" ; then for flag in --dynamicbase --no-seh --nxcompat; do - if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ;= then + if ld_has $flag ; then LDFLAGS=3D"-Wl,$flag $LDFLAGS" fi done @@ -6522,6 +6527,20 @@ if test "$target_linux_user" =3D "yes" -o "$target_b= sd_user" =3D "yes" ; then ldflags=3D"$ldflags $textseg_ldflags" fi =20 +# Newer kernels on s390 check for an S390_PGSTE program header and +# enable the pgste page table extensions in that case. This makes +# the vm.allocate_pgste sysctl unnecessary. We enable this program +# header if +# - we build on s390x +# - we build the system emulation for s390x (qemu-system-s390x) +# - KVM is enabled +# - the linker supports --s390-pgste +if test "$TARGET_ARCH" =3D "s390x" -a "$target_softmmu" =3D "yes" -a "$AR= CH" =3D "s390x" -a "$kvm" =3D "yes"; then + if ld_has --s390-pgste ; then + ldflags=3D"-Wl,--s390-pgste $ldflags" + fi +fi + echo "LDFLAGS+=3D$ldflags" >> $config_target_mak echo "QEMU_CFLAGS+=3D$cflags" >> $config_target_mak =20 --=20 2.13.5