From owner-svn-src-head@freebsd.org Thu Oct 6 03:32:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B20E5AF7682; Thu, 6 Oct 2016 03:32:31 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89FE01EEC; Thu, 6 Oct 2016 03:32:31 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u963WUPL062747; Thu, 6 Oct 2016 03:32:30 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u963WUgm062741; Thu, 6 Oct 2016 03:32:30 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201610060332.u963WUgm062741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 6 Oct 2016 03:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306751 - in head/sys/boot: efi/boot1 efi/loader i386/gptzfsboot i386/zfsboot userboot/zfs zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 03:32:31 -0000 Author: allanjude Date: Thu Oct 6 03:32:30 2016 New Revision: 306751 URL: https://svnweb.freebsd.org/changeset/base/306751 Log: Disable loop unrolling in skein for sys/boot When tsoome@ added skein support to the ZFS boot code and zfsloader, it resulted in an explosion in code size, running close to a number of limits. The default for the C version of skein is to unroll all loops for skein-256 and 512 Disabling the loop unrolling saves 20-28kb from each binary boot1.efi gptzfsboot loader.efi userboot.so zfsloader Reviewed by: emaste, tsoome Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D7826 Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/userboot/zfs/Makefile head/sys/boot/zfs/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Thu Oct 6 03:20:47 2016 (r306750) +++ head/sys/boot/efi/boot1/Makefile Thu Oct 6 03:32:30 2016 (r306751) @@ -28,6 +28,8 @@ SRCS= boot1.c self_reloc.c start.S ufs_m .if ${MK_ZFS} != "no" SRCS+= zfs_module.c SRCS+= skein.c skein_block.c +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 .PATH: ${.CURDIR}/../../../crypto/skein .endif Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Thu Oct 6 03:20:47 2016 (r306750) +++ head/sys/boot/efi/loader/Makefile Thu Oct 6 03:32:30 2016 (r306751) @@ -25,6 +25,8 @@ SRCS= autoload.c \ SRCS+= zfs.c .PATH: ${.CURDIR}/../../zfs SRCS+= skein.c skein_block.c +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 .PATH: ${.CURDIR}/../../../crypto/skein # Disable warnings that are currently incompatible with the zfs boot code Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Thu Oct 6 03:20:47 2016 (r306750) +++ head/sys/boot/i386/gptzfsboot/Makefile Thu Oct 6 03:32:30 2016 (r306751) @@ -36,6 +36,9 @@ CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline -Wno-tentative-definition-incomplete-type -Wno-pointer-sign +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 + .if !defined(LOADER_NO_GELI_SUPPORT) CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${.CURDIR}/../../geli Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Thu Oct 6 03:20:47 2016 (r306750) +++ head/sys/boot/i386/zfsboot/Makefile Thu Oct 6 03:32:30 2016 (r306751) @@ -35,6 +35,8 @@ CFLAGS= -DBOOTPROG=\"zfsboot\" \ -Winline CFLAGS.gcc+= --param max-inline-insns-single=100 +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 LD_FLAGS=${LD_FLAGS_BIN} Modified: head/sys/boot/userboot/zfs/Makefile ============================================================================== --- head/sys/boot/userboot/zfs/Makefile Thu Oct 6 03:20:47 2016 (r306750) +++ head/sys/boot/userboot/zfs/Makefile Thu Oct 6 03:32:30 2016 (r306751) @@ -8,6 +8,9 @@ INTERNALLIB= SRCS+= zfs.c skein.c skein_block.c +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 + CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Thu Oct 6 03:20:47 2016 (r306750) +++ head/sys/boot/zfs/Makefile Thu Oct 6 03:32:30 2016 (r306751) @@ -6,6 +6,8 @@ INTERNALLIB= SRCS+= zfs.c SRCS+= skein.c skein_block.c +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 .PATH: ${.CURDIR}/../../crypto/skein CFLAGS+= -DBOOTPROG=\"zfsloader\"