From owner-freebsd-arm@freebsd.org Fri Dec 1 21:50:25 2017 Return-Path: Delivered-To: freebsd-arm@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 0F811E6BD49 for ; Fri, 1 Dec 2017 21:50:25 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-x22c.google.com (mail-qt0-x22c.google.com [IPv6:2607:f8b0:400d:c0d::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7206724F8 for ; Fri, 1 Dec 2017 21:50:24 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x22c.google.com with SMTP id b10so7110983qti.11 for ; Fri, 01 Dec 2017 13:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uWIewsoVuQlZiS/UR4a7GOydBK9vZ7E3PxwWZhk1i8k=; b=fgaPjAG7FrtmvP6F98QlPFcxVraJo/GKeTbxEWW5EA8IaHbMIJUZAolr6KdM4h636t RRhdZ+Hwmx5GXsQkqw+nZHpTrfx04QmTtz9+HoSKosNpossTgTDSROeU1ZsAf46eUSC4 m1IaWS2DwrlwiakcKJVvv6dZ9Tlyg9WT+bJinZpaOf5OGwNvZFm7R5xXKhogxqDKoYDe u2mvjiME1yAngG8tS2CFNuB4Jdq3hlIAX+aZFZxBuXJ/TsxW/gQ3BCFCdXvQ6hw3W6Qs i/HuKGNGEAoWdnfXMMlmVqXKsDY+0bargYLm8d2z/XuQzFWFzI/GKo9PPgzcMvXf5PQJ MFtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uWIewsoVuQlZiS/UR4a7GOydBK9vZ7E3PxwWZhk1i8k=; b=LzzhHGWOKsWGShuFk8Hfhso45Qklnt48oD7J4ZMWbHMfdyMYuYGYoKL9d6wPt9ADNf f5BCHEQU/GfydvSA21D6N8tNej/aWWQLFrHDjlJAwkfjFvVbDnLBmQSauPT0BnpdWW2p +fRWtt7m/jdcH52rCSmtui1DrdqtXL8CLL3GwnTIAl1KXvhtDTKdsSq/yDOaAEuAzj84 bFO802bvk6+0smI8JGZsvO6/hEJt2eHEaRGC89jZfFO8qgHbfWGpYeQKWllmWOkN68ww F0XExNf/cvNDqBZdFzq5Iw+KaKVKr3QW+z1BWM8RPZTclhT6DCjbmR5jp10/wkg1kqRY KgYw== X-Gm-Message-State: AKGB3mJYvBmvDyJMNvyFyApiNG5eTrE051/rPzNkOZZqG93YiNR3fT1C vDt5JV5Q1Sx1UdlAbp5vMtyrrQ== X-Google-Smtp-Source: AGs4zMYyTb2MWV0Ss5tcHSYzSvCKYdUl3gpbdr/F2MB+U15LzmayoF5tBPReTUzaIm2syp3h0hdoqw== X-Received: by 10.200.42.122 with SMTP id l55mr8900627qtl.66.1512165023548; Fri, 01 Dec 2017 13:50:23 -0800 (PST) Received: from mutt-hbsd (tor-exit4-readme.dfri.se. [171.25.193.78]) by smtp.gmail.com with ESMTPSA id n64sm5188341qkf.49.2017.12.01.13.50.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Dec 2017 13:50:21 -0800 (PST) Date: Fri, 1 Dec 2017 16:49:55 -0500 From: Shawn Webb To: Warner Losh Cc: "freebsd-arm@freebsd.org" , FreeBSD Current Subject: Re: Booting UEFI ZFS is broken on arm64 Message-ID: <20171201214955.zopa6v2f2mx3rkt2@mutt-hbsd> References: <20171130002135.q7p27hh6qkog4slr@mutt-hbsd> <20171130003458.bnltotlgfdbke5ue@mutt-hbsd> <20171130004358.usia2jrvman4cvvz@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yaae3ulvhny5nors" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171027 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Dec 2017 21:50:25 -0000 --yaae3ulvhny5nors Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 29, 2017 at 07:31:17PM -0700, Warner Losh wrote: > On Wed, Nov 29, 2017 at 5:54 PM, Warner Losh wrote: >=20 > > > > > > On Wed, Nov 29, 2017 at 5:43 PM, Shawn Webb > > wrote: > > > >> On Wed, Nov 29, 2017 at 05:42:52PM -0700, Warner Losh wrote: > >> > On Wed, Nov 29, 2017 at 5:34 PM, Shawn Webb >> > > >> > wrote: > >> > > >> > > On Wed, Nov 29, 2017 at 05:33:46PM -0700, Warner Losh wrote: > >> > > > On Wed, Nov 29, 2017 at 5:21 PM, Shawn Webb < > >> shawn.webb@hardenedbsd.org> > >> > > > wrote: > >> > > > > >> > > > > It appears that in the latest FreeBSD 12-CURRENT/arm64 snapsho= t, > >> > > > > booting UEFI GPT ZFS on my OverDrive 1000 is broken. It boots = up > >> to > >> > > > > this line: > >> > > > > > >> > > > > Using DTB provided by EFI at 0x801fe00000. > >> > > > > >> > > > > >> > > > Which snapshot is that? Boot1 was broken until recently. > >> > > > >> > > FreeBSD-12.0-CURRENT-arm64-aarch64-20171121-r326056-memstick.img > >> > > > >> > > It also happens on latest HEAD, so it would appear to still be bro= ken. > >> > > >> > > >> > Is this boot1.efi producing the output, or loader.efi? I'm guessing = the > >> > latter, but wanted to make sure. If so, then we're past the point wh= ere > >> > boot1.efi would have failed (besides, it was fixed before that > >> snapshot). > >> > >> With DEBUG turned on for stand/fdt: > >> > >> Booting [/boot/kernel/kernel]... > >> fdt_copy(): fdt_copy va 0x01208000 > >> fdt_setup_fdtp(): fdt_setup_fdtp() > >> fdt_load_dtb_addr(): fdt_load_dtb_addr(0x801fe00000) > >> Using DTB provided by EFI at 0x801fe00000. > >> Loaded the platform dtb: 0x81f56f1630. > >> fdt_fixup(): fdt_fixup() > >> > >> ^ hangs after that message > > > > > > That doesn't sound like anything I've changed, but it could well be... I > > think to find this breakage, you may need to bisect backwards along sta= nd / > > sys/boot until we find the spot where it broke. > > >=20 > There's been several conversations on IRC about how others are hitting a > scheduler bug, at least on x86. hps' fix seems to do the trick for their > issues. >=20 > Author: hselasky > Date: Wed Nov 29 23:28:40 2017 +0000 >=20 > The sched_add() function is not only used when the thread is initially > started, but also by the turnstiles to mark a thread as runnable for > all locks, for instance sleepqueues do: > setrunnable()->sched_wakeup()->sched_add() >=20 > In r326218 code was added to allow booting from non-zero CPU numbers > by setting the ts_cpu field inside the ULE scheduler's sched_add() > function. This had an undesired side-effect that prior sched_pin() and > sched_bind() calls got disregarded. This patch fixes the > initialization of the ts_cpu field for the ULE scheduler to only > happen once when the initial thread is constructed during system > init. Forking will then later on ensure that a valid ts_cpu value gets > copied to all children. >=20 > Reviewed by: jhb, kib > Discussed with: nwhitehorn > MFC after: 1 month > Differential revision: https://reviews.freebsd.org/D13298 > Sponsored by: Mellanox Technologies >=20 >=20 > git-svn-id: svn+ssh://svn.freebsd.org/base/head@326376 > ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f >=20 > is the fix.... But the bug it fixes post-dates the snapshot, so maybe this > isn't the same thing... Definitely is not the same thing. I've so far got it printf'd to where the uefi loader jumps into the kernel's entry point. So the loader itself might be fine. Something in the kernel, then, is going funky. Booting in verbose mode does not provide any additional input. Here's the output I get (some of the output is from printf's I've done): FreeBSD/arm64 EFI loader, Revision 1.1 (Wed Nov 29 21:51:14 EST 2017 shawn@hbsd-dev-laptop) EFI boot environment Loading /boot/defaults/loader.conf /boot/kernel/kernel text=3D0x7e0a78 data=3D0xaad80+0x443f62 syms=3D[0x8+0x1= 0ec78+0x8+0x1021d4] /boot/entropy size=3D0x1000 /boot/kernel/zfs.ko text=3D0x99070 text=3D0x130390 data=3D0x21ff8+0x9ef98 s= yms=3D[0x8+0x22c68+0x8+0x1b99b] /boot/kernel/opensolaris.ko text=3D0x1330 text=3D0xd00 data=3D0x10160+0x125= d0 syms=3D[0x8+0xff0+0x8+0x8d8] Hit [Enter] to boot immediately, or any other key for command prompt. Booting [/boot/kernel/kernel]... =20 Using DTB provided by EFI at 0x801fe00000. fdt_copy returned. dtb_size is 9060. bi_load finished. err: 0 dev_cleanup finished About to call into the entry point at 0x81ee601000 Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --yaae3ulvhny5nors Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlohzoEACgkQaoRlj1JF bu4hQRAAgL0VhELWc/KkhQSEHEN1x44yfRuqBIeWSz39SLqA5g+YTnpheJ8KSfo4 QAjt1tKYZPaq+y5Q1sWDhF2y5G2TCIptmwZ3g3ks0FkrhAV7F7bPPWqL94WP4yZz PDJtzIWMiSEh/2mBAAsT2PpJiYaEoc+bEs6QqFB+xM/LK/4rTfZkmJVDR35eoBoh e/6SIJy5zc9bD/dbVlpwkJSXMk+kwB6aLNnXw13F09s6OXMe8sia2kfOAF6WUG+R OWAIldEVIdHLr1m4SYe6jzgiTEx1+IasHGVQN8NdlkCQhdQIaiAYEOIq84tewqsX +pEM1uSqwsyaOZybn+Rlbc/p4VhCIUf60lLwbZqyz6r6zZ7SJ1nmFNPJCHHZqlhM 04mcWR8pNP8CXvACZ0DAE3zIjiDI2zifany2oMKMxa536e5bqUImJrcVo1jPhZ7X 0BlY2yJm6SIYTObSK2EmSZc3w8NLkgFj5AQHJYuhMz8Cb1FirSxYxffdHHyU9UqF 1y4Rf09Is2l8vPsMVIXfHcyD5Ttxi4Y6ixmpj+d4NZS8bLgPQLUn3imvZRZ9BkX8 AG67PhTvfYAKFuU0bVjQEc4aOQw8E3+0OBaf6Qi5wOdpKWH2+CuuTlUPMDQzAqJT TUlfsTuwUyVEHmxNfRDKvG6OqIem0+r933CJ7r8sEu5eN3x68VM= =wEoZ -----END PGP SIGNATURE----- --yaae3ulvhny5nors--