From owner-freebsd-ppc@freebsd.org Sun Nov 4 09:12:13 2018 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD07F10F9B30; Sun, 4 Nov 2018 09:12:13 +0000 (UTC) (envelope-from thomas.e.zander@googlemail.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1160980C1D; Sun, 4 Nov 2018 09:12:13 +0000 (UTC) (envelope-from thomas.e.zander@googlemail.com) Received: by mail-wr1-f52.google.com with SMTP id z16-v6so6178144wrv.2; Sun, 04 Nov 2018 01:12:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FlO6NYavZynJxK4Av5TqU25nXxZQoqq1D6aQtg2WgGU=; b=YT6btPAQE8GSv1mz7oKdy5wsJqUy9nh/mIvPsDhlxErtbnsbtSvlU1x49rTI5BGtio 82WFLIdTLKNnSqaadZozk0aJoWi04WrCOPOVfvAIH8pu3DYvJz65dKbMRKUbTttzzrXj DCKXg0bVsECKkSqYgHlOTSGCzdYTHUIitxBXC4JLecfMekscQ7z1AZLx3Zt5PpAxU0KE ilmRZASAiTFl8jJJI17BgezTagkHURf4/wZLpEhP8UnhZT5D3fS71Jcobwk7LLXFonzJ JhBGmuKIoLyRHuvdO0klcY+nZJGowOpAf6MFoRiHn5+5OSWatjANpYqUqKlqqoXfVELT vG8w== X-Gm-Message-State: AGRZ1gJogWQjmKVJF9ejmig1b57X6/3LRnjWSdTvBMEHPKqVbngjPDD0 KBq52XYsT7+l2zghFVLp6lSrHvzj8UyuH8Y84TI= X-Google-Smtp-Source: AJdET5di4CjIx48uGy+OqDyFkPwEjaLoRXI3e6OJkTG6X1uFES43cczeewQM6jig3bL8zL6Ns88ILdjskUKvEcVSQAk= X-Received: by 2002:adf:90af:: with SMTP id i44-v6mr14631438wri.77.1541322388386; Sun, 04 Nov 2018 01:06:28 -0800 (PST) MIME-Version: 1.0 References: <201708302332.v7UNWSVY073465@gw.catspoiler.org> <9B916738-394B-48B7-AA2E-6193F54760B3@dsl-only.net> <85B5ADE0-5573-4E04-8EC3-CB5751C035FF@dsl-only.net> <32379D16-A06E-4BE8-8FC5-C68A8B80E1D2@dsl-only.net> In-Reply-To: <32379D16-A06E-4BE8-8FC5-C68A8B80E1D2@dsl-only.net> From: Thomas Zander Date: Sun, 4 Nov 2018 10:06:16 +0100 Message-ID: Subject: Re: FYI: qemu-ppc64-static and qemu-ppc-static "live-hang" when I attempt use with poudriere; qemu-arm-static and qemu-aarch64-static work To: markmi@dsl-only.net Cc: Sean Bruno , Mark Linimon , truckman@freebsd.org, freebsd-toolchain@freebsd.org, FreeBSD Ports , freebsd-ppc@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1160980C1D X-Spamd-Result: default: False [-2.16 / 200.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.91)[-0.909,0]; RCVD_IN_DNSWL_NONE(0.00)[52.221.85.209.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(-1.24)[ipnet: 209.85.128.0/17(-4.59), asn: 15169(-1.56), country: US(-0.06)]; FORGED_SENDER(0.30)[riggs@freebsd.org,thomasezander@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[52.221.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[riggs@freebsd.org,thomasezander@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 09:12:14 -0000 On Fri, 1 Sep 2017 at 01:37, Mark Millard wrote: > [I show some of the target/ppc/translate.c source code > and related material this time. Not that I know enough > to patch it correctly.] This is still an issue, correct? I tried to create a powerpc poudriere jail on 11.2 earlier today, with the same results. Riggs From owner-freebsd-ppc@freebsd.org Sun Nov 4 09:19:52 2018 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78EF010F9F5E for ; Sun, 4 Nov 2018 09:19:52 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-29.consmr.mail.bf2.yahoo.com (sonic317-29.consmr.mail.bf2.yahoo.com [74.6.129.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 865E4811E0 for ; Sun, 4 Nov 2018 09:19:51 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: fzwbBy4VM1mssJa51QyPpJbdgfvirZkwVEU2epEOJEda6VgYTcQ2zdaGQCj_7DX pbnZGH4GChvb9k3a_cf0dzdIf9A9EPi7wyYqfSlp1CvO0CM5EzDKVW3cdeXYxXemQ1SFV6KJUOtM uhEFfgI3ccAxTvEI_xO.9ZymrCLF3Upfb4HLfRY3kwI.kuca._hjRrcQpJ46R3kX48w6zSq.Eelx tdwIcdJuHmUnQtR7xTo9xcNaJXxNzqb.3z3LDJ.L7Fu8hh1ROovcObRd4FxH_EzfxRmoqISgoljR _Brrj8XaRCojQerMN50zYNrb0lBDztZaRCX3FkI.T5CkUP6DJeEqQG6NeP8o2o369OJVR8mbnMJa 20_QL4XlwtF7c3wygBau9OH8wB5Zser.Adf7s1uORogHmBry9TcTCc5IB3KVLkwMliqssnUfLL5l SroTR6UFUMsWI1JOfSDzQ8vO3kCk_GrFnM9Z9ef02OBXmgrC_0okSik.gXBT_09W2wnqnahIOPG9 Ic4lKRIImbzaqx93OpGlVYNrwGaBN52miTUGc3A9MgQ.RphDYP6Nrf4XlAhOd6QjzcIbeQrt2l8m jXExYte1oWoXMG1kFxkzs6BzHxINe6sIzhJ7ceYeyqK8lyoAvmlRb6_lUcvRMi_5kDHrXA8EpEkN gvtMYKgYMj7yaNSTySrY7GSyvEN2niaUULE8paTo_piJJzK5xAHDXV6Kfoc0WmOA5CRtrYTeI5N1 V3p.evdH7ewjTKKo0a62YwqJqxzraOhn1iR.AjuBv4QF4oqgs5ayobNFov07BE5.VJ8_lJBxeazM ncwtN4IcC3N4Uv3c1Ibqh1QkgFM4vOnh8xFWutK.LsY.RWzrJNB22iVKmIF4g9PtsslePKsRla7n nkNUDoMWgkgV0Vbah4LCDIf9twezUNIf0Rq7G2wFtnJ7VWWqyhHA3kds1KmuSCk6IpsGM9PQR7P. UC4kRVMCd.5W5RxBqNyUN289GmvEyesqZLMVwGG71OdX1opI1bBJ8rOa.z8ttswhC6w9JEG.WjRa LKuYQIag4YwU_GvShE0VdgNZp0psMgkOT2VvBW_oDMIOXrQQrqA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.bf2.yahoo.com with HTTP; Sun, 4 Nov 2018 09:19:45 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp415.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID a4133d53b5a6c66a7d654b254588e59e; Sun, 04 Nov 2018 09:19:43 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: FYI: qemu-ppc64-static and qemu-ppc-static "live-hang" when I attempt use with poudriere; qemu-arm-static and qemu-aarch64-static work From: Mark Millard In-Reply-To: Date: Sun, 4 Nov 2018 01:19:40 -0800 Cc: truckman@freebsd.org, Sean Bruno , FreeBSD Toolchain , FreeBSD Ports , FreeBSD PowerPC ML Content-Transfer-Encoding: 7bit Message-Id: <88F122A8-5E87-4BB6-925D-E309E19590B2@yahoo.com> References: <201708302332.v7UNWSVY073465@gw.catspoiler.org> <9B916738-394B-48B7-AA2E-6193F54760B3@dsl-only.net> <85B5ADE0-5573-4E04-8EC3-CB5751C035FF@dsl-only.net> <32379D16-A06E-4BE8-8FC5-C68A8B80E1D2@dsl-only.net> To: Thomas Zander X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 865E4811E0 X-Spamd-Result: default: False [0.86 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_FROM(0.00)[yahoo.com]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.89)[0.892,0]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCVD_IN_DNSWL_NONE(0.00)[84.129.6.74.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[84.129.6.74.rep.mailspike.net : 127.0.0.17]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.48)[ipnet: 74.6.128.0/21(1.36), asn: 26101(1.09), country: US(-0.06)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 09:19:52 -0000 On 2018-Nov-4, at 1:06 AM, Thomas Zander wrote: > On Fri, 1 Sep 2017 at 01:37, Mark Millard wrote: > >> [I show some of the target/ppc/translate.c source code >> and related material this time. Not that I know enough >> to patch it correctly.] > > This is still an issue, correct? > I tried to create a powerpc poudriere jail on 11.2 earlier today, with > the same results. Last I looked into it: unchanged. Your result tends to confirm the status is unchanged. === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-ppc@freebsd.org Mon Nov 5 09:45:30 2018 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90AF710FDF7C; Mon, 5 Nov 2018 09:45:30 +0000 (UTC) (envelope-from pkubaj@anongoth.pl) Received: from mail.anongoth.pl (mail.anongoth.pl [46.248.190.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mail.anongoth.pl", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C907778B2; Mon, 5 Nov 2018 09:45:29 +0000 (UTC) (envelope-from pkubaj@anongoth.pl) Received: from anongoth.pl (unknown [10.8.0.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: pkubaj@anongoth.pl) by mail.anongoth.pl (Postfix) with ESMTPSA id 080E427967; Mon, 5 Nov 2018 10:45:17 +0100 (CET) Date: Mon, 5 Nov 2018 10:45:17 +0100 From: Piotr Kubaj To: freebsd-current@freebsd.org, freebsd-ppc@freebsd.org, freebsd-stable@freebsd.org, freebsd-fs@freebsd.org Subject: FreeBSD/powerpc64 (POWER9) with ZFS on / Message-ID: <20181105094517.GA42797@smtp.iq.pl> Mail-Followup-To: freebsd-current@freebsd.org, freebsd-ppc@freebsd.org, freebsd-stable@freebsd.org, freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 5C907778B2 X-Spamd-Result: default: False [-5.08 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[anongoth.pl]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:46.248.190.61]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[anongoth.pl:+]; DMARC_POLICY_ALLOW(-0.50)[anongoth.pl,reject]; MX_GOOD(-0.01)[mail.anongoth.pl]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.01)[country: PL(0.03)]; ASN(0.00)[asn:47544, ipnet:46.248.160.0/19, country:PL]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 09:45:30 -0000 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable ZFS is by default not available for partitioning in bsdinstall. We can, how= ever, use manual partitioning in shell to make ZFS partitions. But what if we want to do ZFS on /? This is currently not supported out-of-= the-box. The reason is that Petitboot, used on POWER9 to boot kernel, doesn= 't support loading modules (at least when booting FreeBSD). ZFS is by defau= lt distributed only as a module, to overcome licensing issues. There are two ways to boot ZFS on root with Petitboot: 1. We can use initramfs, which will load necessary modules. It's said to be= supported on FreeBSD/powerpc64, but no one knows how to create one for Fre= eBSD :) 2. We can actually compile a custom kernel with ZFS in it (not as a module)= =2E This the approach that I use. Unfortunately, I can't redistribute this = kernel, because of ZFS's license. I created a custom installation iso, whic= h uses my kernel with ZFS included. Here are the steps to do it (on an installed powerpc64 system, but should b= e possible on other architectures after redefining TARGET and TARGET_ARCH): 1. cd /usr/src/sys/powerpc/conf 2. cat << EOF > ZFS include GENERIC64 options ZFS EOF 3. cd ../../../ 3. make buildworld buildkernel KERNCONF=3DZFS 4. cd release 5. make release When it's done, there will be iso files in /usr/obj/usr/src/powerpc.powerpc= 64/release. You can use it to install ZFS on root. Note that you need a FAT32 partition to mount on /boot. This partition needs to have /boot/etc/kboot.conf file, with a line like: FreeBSD=3D'/kernel/kernel kernelname=3D/boot/kernel/kernel vfs.root.mountfr= om=3Dzfs:zroot/ROOT/default' You also need the appriopriate /etc/fstab: /dev/nda0p1 /boot msdosfs rw 2 2 Other than that, howto at https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot#Cre= ate_Partitions (from point 2., omit 1.) is totally ok to follow. Thanks to mmacy for informing me about this little trick with including ZFS= to kernel. --=20 _________________________________________=20 / It has been said that man is a rational \ | animal. All my life I have been | | searching for evidence which could | | support this. | | | \ -- Bertrand Russell / -----------------------------------------=20 \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || --zhXaljGHf11kAtnf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJkBAABCgBOFiEEycyIeNkkgohzsoorelmbhSCDnJ0FAlvgES0wFIAAAAAAFQAS cGthLWFkZHJlc3NAZ251cGcub3JncGt1YmFqQGFub25nb3RoLnBsAAoJEHpZm4Ug g5ydkKMP/0Xuk8dEY5/ZTu9Olokm4JRw2hXOzVvOhMQG4lJFUfDnAHStWkGEfiYT 4a/6OZJ27mp6g90Rt9vwaMCvD7cSIaVuUYQWDYZ2F0kXVdHzIJdTciFa+CBGEH82 cxirf+hO8sF87jionIhSo9U7U8UKQPYhYtUiH7OdTtFkCUlOIV7TbebdUrlSm90e 4Bf1Sy4g45V58Cn942kyvh8e+xs3lPs/v/lEvi/AoIv9jBkURp/8U8TIGn/Hp/t2 I84wvnRQvlj8oH5m8w6Uzxg9Xj9FFJXzJOcmc/sDpfcKOs+hZBIw1+FybI/Y+sdz yNU+QttBymFJWSDJVG1i5XcKj5WQWJCV4vYKofjI8KiHYgMq+IUnRXO0tWhqrnYB L0S+q8OBI7R7EjrOfETJqxmhouXmIyb5NOXXcA94QI40oMbeLIWCiPJps0tyW53V UCdj4VfdbBfZq8moKaLU5WDsBu5ggxAE4UOStFavDLfomH9CpfYoHgiyEsUEoK7a Nxx+i1+mImGwqGx/u5v8XO4eBWf6UEFR4DU+8rwTUH03QuEVXWApKg8gim7+bbc0 wolPNm1PODjqIjX/6oFKpYDBYWpYv5nJn66SFLGMAE8ecz0+fTPZhULgP7+QMoQp 51HtwiM0X1a8D+nu8W7XaGaGJ9UTzQEvQoytErTp4ZG56SqudOAR =UvqB -----END PGP SIGNATURE----- --zhXaljGHf11kAtnf-- From owner-freebsd-ppc@freebsd.org Mon Nov 5 10:23:56 2018 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DEC010FEF08; Mon, 5 Nov 2018 10:23:56 +0000 (UTC) (envelope-from instructionset@gmail.com) Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B3C97916D; Mon, 5 Nov 2018 10:23:55 +0000 (UTC) (envelope-from instructionset@gmail.com) Received: by mail-pl1-x62b.google.com with SMTP id c13-v6so4234718plz.13; Mon, 05 Nov 2018 02:23:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=taTkOU/h0+uB4Qxzojt9kZnoXGPpivSBvTNphgutLM4=; b=a1Mke/pULh2ETPK4kQ2OtCQ49LVEf+K+S/UGoh1BGcx26by1uc/Ikt5S+scFCIvFhB i5W2CQ1+dvAIJ++7Gl0fpgTPfwU1ICZUS5sN0OTIQ6TFlXGwhV2ID08phBLQiM6h0zE1 sIjedUatyT2V5mCEQT4DsB8CJuRrTfZ/PgDlhIyHxQNCR5e/kc3lls8iawWRz2XB4e2Q pGGE/6oZBBQJdFwb4AwQkkXUqCNVds3WcNrGByLHEVz7lboxNhLa4D3Duah/DGSwzWfk RMpnr1va5vkiQXey04w6IqFY0M73CeLjSWok8DEwyF1D55pxEwxvXevwSsQ8Sr22dCvb Yoeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=taTkOU/h0+uB4Qxzojt9kZnoXGPpivSBvTNphgutLM4=; b=YjZovXPLZTllJ5Fe+Q6XP4QAyutKztZSMfAiWM+W6Sdx0jpgQ6RwDKT+U3N3ze70U9 MuyWKhf4HzFZRqta0O+AGpblQu5DiueHmLvEJZDySjrocxpkwIm9en86Atcsb1C8FMFy PYIMfedCMkYMenQKi2MIgRIiMxgz9jZJ7Q0Q0bAvlSYbZvOlHiaXLDzJ8Y/dfosqdoaT CTgjK4GvZmbMD9WvlT/pdEFz89LOtFOIRbR/bc2kEy99809j979ke92waEVDFps/pkcS Fp8YMhSWAL/RnyJKzo5ke4iY4Y/YW+qPuwEQEju7EnOWu/SFuG3IM6OSroWIjTKBtwAA ++Ag== X-Gm-Message-State: AGRZ1gL4cUM12m2ksslFCGpkogh/rsP5PeWLDxlV9SgcSYVIK39YeSnC o5Nf4F4FKPXA72CdT0o9R0GehjcXmu/9eXMO9ISbOw== X-Google-Smtp-Source: AJdET5c2Ml9xsI0DMbUbLNAT5zJDorqLATC1tTu562j/HFMhnaZPQwdCpR+024fw0kyIt5XuwmDMM2UlaG+2qL+QSjY= X-Received: by 2002:a17:902:5e3:: with SMTP id f90-v6mr22077742plf.286.1541413434219; Mon, 05 Nov 2018 02:23:54 -0800 (PST) MIME-Version: 1.0 References: <20181105094517.GA42797@smtp.iq.pl> In-Reply-To: <20181105094517.GA42797@smtp.iq.pl> From: Bill Sorenson Date: Mon, 5 Nov 2018 04:23:45 -0600 Message-ID: Subject: Re: FreeBSD/powerpc64 (POWER9) with ZFS on / To: pkubaj@anongoth.pl, freebsd-current@freebsd.org, FreeBSD PowerPC ML , freebsd-stable@freebsd.org, freebsd-fs@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 9B3C97916D X-Spamd-Result: default: False [-3.26 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.947,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-0.32)[ipnet: 2607:f8b0::/32(-0.28), asn: 15169(-1.27), country: US(-0.06)]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[b.2.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 10:23:56 -0000 On Mon, Nov 5, 2018, 3:45 AM Piotr Kubaj via freebsd-ppc > ZFS is by default not available for partitioning in bsdinstall. We can, h= owever, use manual partitioning in shell to make ZFS partitions. > > But what if we want to do ZFS on /? This is currently not supported out-o= f-the-box. The reason is that Petitboot, used on POWER9 to boot kernel, doe= sn't support loading modules (at least when booting FreeBSD). ZFS is by def= ault distributed only as a module, to overcome licensing issues. > > There are two ways to boot ZFS on root with Petitboot: > 1. We can use initramfs, which will load necessary modules. It's said to = be supported on FreeBSD/powerpc64, but no one knows how to create one for F= reeBSD :) > 2. We can actually compile a custom kernel with ZFS in it (not as a modul= e). This the approach that I use. Unfortunately, I can't redistribute this = kernel, because of ZFS's license. I created a custom installation iso, whic= h uses my kernel with ZFS included. > > Here are the steps to do it (on an installed powerpc64 system, but should= be possible on other architectures after redefining TARGET and TARGET_ARCH= ): > 1. cd /usr/src/sys/powerpc/conf > 2. cat << EOF > ZFS > include GENERIC64 > options ZFS > EOF > 3. cd ../../../ > 3. make buildworld buildkernel KERNCONF=3DZFS > 4. cd release > 5. make release > > When it's done, there will be iso files in /usr/obj/usr/src/powerpc.power= pc64/release. > > You can use it to install ZFS on root. > > Note that you need a FAT32 partition to mount on /boot. > This partition needs to have /boot/etc/kboot.conf file, with a line like: > FreeBSD=3D'/kernel/kernel kernelname=3D/boot/kernel/kernel vfs.root.mount= from=3Dzfs:zroot/ROOT/default' > > You also need the appriopriate /etc/fstab: > /dev/nda0p1 /boot msdosfs rw 2 2 > > Other than that, howto at https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot#C= reate_Partitions (from point 2., omit 1.) is totally ok to follow. > > Thanks to mmacy for informing me about this little trick with including Z= FS to kernel. > > -- > _________________________________________ > / It has been said that man is a rational \ > | animal. All my life I have been | > | searching for evidence which could | > | support this. | > | | > \ -- Bertrand Russell / > ----------------------------------------- > \ ^__^ > \ (oo)\_______ > (__)\ )\/\ > ||----w | > || || I don't think there are any license issues distributing a FreeBSD kernel with ZFS statically linked like there are with Linux. For a long time it wasn't supported and ZFS will probably never be in GENERIC but a custom kernel with ZFS built in should be freely redistributable. I don't claim to be an expert on the license issues so if someone else has better information feel free correct me. -Bill Sorenson From owner-freebsd-ppc@freebsd.org Mon Nov 5 15:40:22 2018 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D6661104A9F for ; Mon, 5 Nov 2018 15:40:22 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (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 7769F83E3C for ; Mon, 5 Nov 2018 15:40:21 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (unknown [75.161.236.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id AB84C1AFBD8 for ; Mon, 5 Nov 2018 07:59:02 +0000 (UTC) Subject: Re: FreeBSD/powerpc64 (POWER9) with ZFS on / To: freebsd-ppc@freebsd.org References: <20181105094517.GA42797@smtp.iq.pl> From: Sean Bruno Openpgp: preference=signencrypt Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7WuB0IWhO7Z4yHENr8wFaNYwpod9i4egX2BugbrM8pOfhN2/qqdeG1L5LMtXw3yyAhABEB AAHNN1NlYW4gQnJ1bm8gKEZyZWVCU0QgRGV2ZWxvcGVyIEtleSkgPHNicnVub0BmcmVlYnNk Lm9yZz7CwJQEEwEKAD4WIQToxOn4gDUE4eP0ujS95PX+ibX8tgUCWT7RQQIbAwUJBaOagAUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAAKCRC95PX+ibX8ttKTCACFKzRc56EBAlVotq02EjZP SfX+unlk6AuPBzShxqRxeK+bGYVCigrYd1M8nnskv0dEiZ5iYeND9HIxbpEyopqgpVTibA7w gBXaZ7SOEhNX1wXwg14JrralfSmPFMYni+sWegPMX/zwfAsn1z4mG1Nn44Xqo3o7CfpkMPy6 M5Bow2IDzIhEYISLR+urxs74/aHU35PLtBSDtu18914SEMDdva27MARN8mbeCDbuJVfGCPWy YHuy2t+9u2Zn5Dd+t3sBXLM9gpeaMm+4x6TNPpESygbVdh4tDdjVZ9DK/bWFg0kMgfZoaq6J l0jNsQXrZV3bzYNFbVw04pFcvA2GIJ7xzsBNBFk+0UEBCADIXBmQOaKMHGbc9vwjhV4Oj5aZ DdhNedn12FVeTdOXJvuTOusgxS29lla0RenHGDsgD08UiFpasBXWq/E+BhQ19d+iRbLLR17O KKc1ZGefoVbLARLXD68J5j4XAyK+6k2KqBLlqzAEpHTzsksM9naARkVXiEVcrt6ciw0FSm8n kuK3gDKKe93XfzfP+TQdbvvzJc7Fa+appLbXz61TM1aikaQlda8bWubDegwXbuoJdB34xU1m yjr/N4o+raL0x7QrzdH+wwgrTTo+H4S2c1972Skt5K5tbxLowfHicRl23V8itVQr3sBtlX4+ 66q+Apm7+R36bUS/k+G45Sp6iPpxABEBAAHCwHwEGAEKACYWIQToxOn4gDUE4eP0ujS95PX+ ibX8tgUCWT7RQQIbDAUJBaOagAAKCRC95PX+ibX8trrIB/9Pljqt/JGamD9tx4dOVmxSyFg9 z2xzgklTLuDgS73MM120mM7ao9AQUeWiSle/H0UCK7xPOzC/aeUC4oygDQKAfkkNbCNTo3+A qDjBRA8qx0e9a/QjDL+RFgD4L5kLT4tToY8T8HaBp8h03LBfk510IaI8oL/Jg7vpM3PDtJMW tUi2H+yNFmL3NfM2oBToWKLFsoP54f/eeeImrNnrlLjLHPzqS+/9apgYqX2Jwiv3tHBc4FTO GuY8VvF7BpixJs8Pc2RUuCfSyodrp1YG1kRGlXAH0cqwwr0Zmk4+7dZvtVQMCl6kS6q1+84q JwtItxS2eXSEA4NO0sQ3BXUywANh Message-ID: Date: Mon, 5 Nov 2018 08:40:09 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20181105094517.GA42797@smtp.iq.pl> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9tuCLsdEEbDBwo12ljZy5PAa7jkkizNfN" X-Rspamd-Queue-Id: 7769F83E3C X-Spamd-Result: default: False [-3.09 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-0.93)[-0.927,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.06)[0.062,0]; HAS_ATTACHMENT(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; TO_DN_NONE(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_ONE(0.00)[1]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; DMARC_NA(0.00)[freebsd.org]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-0.01)[asn: 36236(-0.00), country: US(-0.06)]; ASN(0.00)[asn:36236, ipnet:199.102.76.0/22, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_DOM_EQ_FROM_DOM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2018 15:40:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9tuCLsdEEbDBwo12ljZy5PAa7jkkizNfN Content-Type: multipart/mixed; boundary="x10SLVl7ietar6SETNJjDAQdyGvKfCrjm"; protected-headers="v1" From: Sean Bruno To: freebsd-ppc@freebsd.org Message-ID: Subject: Re: FreeBSD/powerpc64 (POWER9) with ZFS on / References: <20181105094517.GA42797@smtp.iq.pl> In-Reply-To: <20181105094517.GA42797@smtp.iq.pl> --x10SLVl7ietar6SETNJjDAQdyGvKfCrjm Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/5/18 2:45 AM, Piotr Kubaj wrote: > ZFS is by default not available for partitioning in bsdinstall. We can,= > however, use manual partitioning in shell to make ZFS partitions. >=20 > But what if we want to do ZFS on /? This is currently not supported > out-of-the-box. The reason is that Petitboot, used on POWER9 to boot > kernel, doesn't support loading modules (at least when booting FreeBSD)= =2E > ZFS is by default distributed only as a module, to overcome licensing > issues. >=20 > There are two ways to boot ZFS on root with Petitboot: > 1. We can use initramfs, which will load necessary modules. It's said t= o > be supported on FreeBSD/powerpc64, but no one knows how to create one > for FreeBSD :) > 2. We can actually compile a custom kernel with ZFS in it (not as a > module). This the approach that I use. Unfortunately, I can't > redistribute this kernel, because of ZFS's license. I created a custom > installation iso, which uses my kernel with ZFS included. >=20 > Here are the steps to do it (on an installed powerpc64 system, but > should be possible on other architectures after redefining TARGET and > TARGET_ARCH): > 1. cd /usr/src/sys/powerpc/conf > 2. cat << EOF > ZFS > include GENERIC64 > options ZFS > EOF > 3. cd ../../../ > 3. make buildworld buildkernel KERNCONF=3DZFS > 4. cd release > 5. make release >=20 > When it's done, there will be iso files in > /usr/obj/usr/src/powerpc.powerpc64/release. >=20 > You can use it to install ZFS on root. >=20 > Note that you need a FAT32 partition to mount on /boot. > This partition needs to have /boot/etc/kboot.conf file, with a line lik= e: > FreeBSD=3D'/kernel/kernel kernelname=3D/boot/kernel/kernel > vfs.root.mountfrom=3Dzfs:zroot/ROOT/default' >=20 > You also need the appriopriate /etc/fstab: > /dev/nda0p1=C2=A0=C2=A0=C2=A0=C2=A0 /boot=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 msdosfs rw=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2 >=20 > Other than that, howto at > https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot#Create_Partitions (from > point 2., omit 1.) is totally ok to follow. >=20 > Thanks to mmacy for informing me about this little trick with including= > ZFS to kernel. >=20 I'd recommend adding a default to the kboot.conf so that your machine doesn't hang at petitboot forever. # cat /mnt/etc/kboot.conf default=3DFreeBSD_boot FreeBSD_boot=3D'/kernel/kernel vfs.root.mountfrom=3Dzfs:zroot kernelname=3D/kernel/kernel' The Power8 machines in the freebsd cluster use a statically built kernel with no modules. sean (trimmed cc list) --x10SLVl7ietar6SETNJjDAQdyGvKfCrjm-- --9tuCLsdEEbDBwo12ljZy5PAa7jkkizNfN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlvgZFlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LYZuAf/avKBLiMC/xVV10ukDwLpyrJ5tN20TtHTL9CfLfndSfKkCzmvu4FNKmD0 apWySGX8sX87pljWSFrm5nhCS99Srd/017fQfZkz7Vynut0vBJZem485gKP17AY5 FIVlMJ4LGUefjdKueZaVAPwUVI/yjVfqbuu9L/uwFIKlSgTQ+VuJos3sQp03SNdh SXXnA5MeE2+TwbTCVju/v459h/RfRgLGp+MvyOIX+MR3QNJz+aOQl1TWp6ZPNCBG 7xbsyXDuOTlAcV00sbAoB9YMWHq+ehdtdd2DZLCtcQE/1Pq0EplArnEKklpOTZNk I03g5BzuusDGN1QpyDfSMguL0Vcw1A== =Q/ma -----END PGP SIGNATURE----- --9tuCLsdEEbDBwo12ljZy5PAa7jkkizNfN-- From owner-freebsd-ppc@freebsd.org Fri Nov 9 05:01:11 2018 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F8A11124E4F for ; Fri, 9 Nov 2018 05:01:11 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-20.consmr.mail.ne1.yahoo.com (sonic306-20.consmr.mail.ne1.yahoo.com [66.163.189.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67B587E294 for ; Fri, 9 Nov 2018 05:01:10 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: iJD6eZcVM1lJOg4OQ3GleRg2NocMF.k1GT.sMrz3ovKXs3UjcrMTWLpZW7M3cCc iwPfl__NVJ0csL_MvtO3NZ5BRZvEkLgPvYQtlxIDJ.sRa2xQ9ootcJ9k6s7GQIlANcQv3MDPcgam WGvpKuO0816k2UtJPIDJfiy98DjMD3CI6dfm0nYohGSKkFDlKyMaYwc3ho9D8cysNSXc7EPW5mXe wBm0Pdclx4PlRHQI1DZ55CDMYPWvAIPZrZUsFswibfV3zCqpYaiAkEAd1ZEa3MnttawC4D0aO2rk uP2cDQf49pcj3PgdUlXR0qPoGLL_bECzW.c26SkHKcpBJNiNKoIExLMBKu.241nJn43hJxbbzU6F 5wd57oxXpR5nxH6EmcgI3zIiaCMO7F0YumAlxYoigPh.5rN6Ftg4WzLXih.gNay31ZCqOkrPWEoH 9pCTdZQGrSlxPh6uuIlKLC_tXeeDVZTfCJwjZ.rNffq45qQDRaZE_9C25dek9AnzycOleZw4niCN gY9JR5N1Lw3Sw8PoAkQSORBv_925FB8w5fUdNOdJjCKM3SU5lY.nz9X0dW_jkI9b9ZwAl10Uc9Vw 7WAg5YAvn8GnxE3f_BQnfXXiA3KM5DSRXWa_v3kIdLeJ.ZhLE2OzgPE8aTD2VTeJW7Vk0lfBQxQO CTs24oqognIw35ev0v1GWNcy914ozMGM5sQKXl.q9ZWGbI_L1XSgsunirxYxJTGM9SAEUbuUqU_O _rQ_.G4zt0Q0Jmq.LA5Aqt6ILrMtFL1sZRyDpSK2y0MijipKxglKMTtjn_h1v6B0PQ9ChGWeB7g9 qw6WnsB_tXzveZA.uOisylJs732yn_Ea36NUDu_y5ZlFf3uzJouCkCqP37D7wfF6IxqttY6Gp25S nAuBYbT36e1kaCSogFm7XFk3gK5LUb53iHu96JjTGV0V6AvwrAC8.RX5yoj7uQaLo0s8Q89NOC4Q 99cCxbcusC2YI8djKAkOw.pxuQs4SNFZo5Y5qiJZunPxpBiarhO1PtO1pLwn.ajm0ApyfM4sa9hb YzkzdPfW57JKqd6bg0Z1gX.zgoTR_DUHOfxQMfsxfBleHWRZYJ8f9 Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Fri, 9 Nov 2018 05:01:09 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp409.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID df49675ce8d2dffcdb3b606ae2bb193e; Fri, 09 Nov 2018 05:01:05 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: gnu/lib/libgcc 's unwind-dw2.c and company: DW_CFA_{remember,restore}_state handling is incomplete and gcc 4.2.1 output tends to avoid those (powerpc examples) Message-Id: Date: Thu, 8 Nov 2018 21:01:03 -0800 To: FreeBSD Toolchain , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3445.101.1) X-Rspamd-Queue-Id: 67B587E294 X-Spamd-Result: default: False [-1.34 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_FROM(0.00)[yahoo.com]; NEURAL_HAM_LONG(-0.99)[-0.991,0]; NEURAL_SPAM_SHORT(0.78)[0.777,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCVD_IN_DNSWL_NONE(0.00)[82.189.163.66.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(0.38)[ipnet: 66.163.184.0/21(1.09), asn: 36646(0.88), country: US(-0.09)]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2018 05:01:11 -0000 Some context: /usr/src/gnu/lib/libgcc/Makefile has: .if ${TARGET_CPUARCH} =3D=3D "arm" LIB2ADDEH =3D unwind-arm.c libunwind-arm.S pr-support.c unwind-c.c .else LIB2ADDEH =3D unwind-dw2.c unwind-dw2-fde-glibc.c unwind-sjlj.c = gthr-gnat.c \ unwind-c.c .endif It appears that only powerpc families and sparc64 use unwind-dw2.c and company unless someone uses WITHOUT_LLVM_LIBUNWIND=3D deliberately for non-arm. This is about unwind-dw2.c and company and uses a powerpc context for illustration. The problem: gnu/lib/libgcc 's libgcc_s.so when based on unwind-dw2.c and company do not correctly/completely handle: DW_CFA_remember_state DW_CFA_restore_state as they are put to use by fairly modern c++ compilers, use that requires cfa-rule save/restore. Here I use g++8 for illustration, but g++6 is similar, for example. Yet gcc 4.2.1 tends to "work" because it has less complete stack (cfa) tracking in the exception handling output it produces, thus commonly avoiding use of DW_CFA_{remember,restore}_state . The evidence: I'm going to illustrate with 32-powerpc because I happen to have g++ 4.2.1 handy in that context, as well as g++8 . g++ 4.2.1 toolchain (and why it does not illustrate the problem): (The c++ source code is not directly significant here --but that it is the same for both g++*'s is important .) (gdb) disass g Dump of assembler code for function g(): (mixed with related dwarfdump lines and other notes) 0x018008e0: =20 0x018008e0 <+0>: mflr r0 0x018008e4 <+4>: stwu r1,-16(r1) 0x018008e8: =20 0x018008e8 <+8>: lis r9,385 0x018008ec <+12>: stw r0,20(r1) 0x018008f0: =20 0x018008f0 <+16>: lwz r0,3496(r9) 0x018008f4 <+20>: cmpwi cr7,r0,0 0x018008f8 <+24>: bne cr7,0x180090c (Note: the branch = target requires cfa=3D16(r1) ) 0x018008fc <+28>: lwz r0,20(r1) 0x01800900 <+32>: addi r1,r1,16 (Note: the cfa changed but nothing reports it here: still = treated as cfa=3D16(r1) ) (Later: Compare to what a more modern g++ compilers produce = after adjusting r1.) 0x01800904 <+36>: mtlr r0 0x01800908 <+40>: b 0x18008b8 (Compare here to what more modern g++ compilers produce.) 0x0180090c <+44>: li r3,4 0x01800910 <+48>: bl 0x1810e0c <__cxa_allocate_exception@plt> 0x01800914 <+52>: lis r9,385 0x01800918 <+56>: addi r9,r9,3712 0x0180091c <+60>: lis r4,385 0x01800920 <+64>: lis r5,385 0x01800924 <+68>: stw r9,0(r3) 0x01800928 <+72>: addi r4,r4,3724 0x0180092c <+76>: addi r5,r5,3652 0x01800930 <+80>: bl 0x1810e14 <__cxa_throw@plt> End of assembler dump. No use of DW_CFA_remember_state or DW_CFA_restore_state, despite the tail call optimization. This is why gcc 4.2.1 tests do not show the DW_CFA_{remember,restore}_state problem here. g++8 toolchain: (but a.out using /lib/libgcc_s.so.1 in order to test that library) (gdb) disass g Dump of assembler code for function g(): (mixed with related dwarfdump lines) (Note: f()'s code was inlined.) 0x01800978: =20 0x01800978 <+0>: lis r10,385 0x0180097c <+4>: stwu r1,-32(r1) 0x01800980: =20 0x01800980 <+8>: lwz r9,3176(r10) 0x01800984 <+12>: cmpwi cr7,r9,0 0x01800988 <+16>: bne cr7,0x18009ac (Note: branch = target requires cfa=3D32(r1) ) 0x0180098c <+20>: li r9,97 0x01800990 <+24>: stb r9,8(r1) 0x01800994 <+28>: lwz r9,3176(r10) 0x01800998 <+32>: addi r9,r9,1 0x0180099c <+36>: stw r9,3176(r10) 0x018009a0 <+40>: lbz r9,8(r1) 0x018009a4 <+44>: addi r1,r1,32 DW_CFA_remember_state is generate before the following change is = made. (unwind-dw2.c and company do not record the cfa=3D32(r1) = material but should) 0x018009a8: (gcc 4.2.1 did not generate = anything to cause this) 0x018009a8 <+48>: blr DW_CFA_restore_state is generated to cause the following change: 0x018009ac: (unwind-dw2.c and company did not record the cfa=3D32(r1) = material but should have) (unwind-dw2.c and company cause defaults here: cfa=3D0(r1), = which is wrong) 0x018009ac <+52>: mflr r0 0x018009b0: =20 (unwind-dw2.c and company caused defaults here: cfa=3D0(r1), = which is wrong) 0x018009b0 <+56>: li r3,4 0x018009b4 <+60>: stw r0,36(r1) 0x018009b8: =20 (unwind-dw2.c and company caused defaults here: cfa=3D0(r1), = which is wrong) 0x018009b8 <+64>: bl 0x1810cc4 <__cxa_allocate_exception@plt> 0x018009bc <+68>: lis r9,385 0x018009c0 <+72>: lis r5,385 0x018009c4 <+76>: addi r9,r9,2916 0x018009c8 <+80>: lis r4,385 0x018009cc <+84>: stw r9,0(r3) 0x018009d0 <+88>: addi r5,r5,3332 0x018009d4 <+92>: addi r4,r4,3380 0x018009d8 <+96>: bl 0x1810cec <__cxa_throw@plt> End of assembler dump. g++8 and the like track more of the cfa changes in the exception handling information and so use DW_CFA_{remember,restore}_state in more types of contexts. This leads to running into the incomplete implementation in unwind-dw2.c and company more as well. Based on the incorrect cfa=3D0(r1) _Unwind_RaiseException ends up looping, looking at the same frame each time, making no progress. powerpc64 notes: It turns out that devel/powerpc64-gcc used for buildworld generates code in /lib/libgcc_s.so's exception handling code that hits the problem, blocking all c++ exception handling via that library because of _Unwind_RaiseException never finishing. For testing I touched the library code to avoid ending up with the DW_CFA_{remember,restore}_state usage where it was a problem. This allowed for simple programs to be used for illustration of the problem in that context --and programs that do not show the problem as well (via lack of DW_CFA_{remember,restore}_state use). clang++ does generate DW_CFA_{remember,restore}_state in some contexts and these have the problem too. Any DW_CFA_restore_state where the result should not have cfa=3D0(r1) is broken for powerpc families. For reference: For the g++8 based a.out: # ldd a.out a.out: libstdc++.so.6 =3D> /usr/lib/libstdc++.so.6 (0x41860000) libm.so.5 =3D> /lib/libm.so.5 (0x41972000) libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x419ab000) libc.so.7 =3D> /lib/libc.so.7 (0x419cb000) (g++8's own libgcc_s.so does not have such problems.) # more exception_test1.cpp=20 #include // -O2 context used. volatile unsigned int v =3D 1; extern int f() { volatile unsigned char c =3D 'a'; v++; // despite volatile the access to v in g // was otherwise optimized out and the // std::exception was not followed by // code for f(). return c; } extern void g() { if (v) throw std::exception(); f(); // Modern g++'s: ends up inlined but the problem is = demonstrated. } int main(void) { try {g();} // Used a separate function to avoid any potential // special handling of code in main. catch (std::exception& e) {} return 0; } =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)