Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 May 2022 17:05:41 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= <olivier@freebsd.org>
Cc:        FreeBSD Current <current@freebsd.org>
Subject:   Re: Loader can't find /boot/ua/loader.lua on UFS after main-n255828-18054d0220c
Message-ID:  <CANCZdfr3gVXT6qEvXY3S9AeuBT7KKs_YcrBEk60a0jZmZ531VQ@mail.gmail.com>
In-Reply-To: <CA%2Bq%2BTcp_wfhhK2CvdKsx9GwkKmD3mR9D12pny4ge1Dq4=NokDQ@mail.gmail.com>
References:  <YpQdK70gH%2B%2BZ9ZjA@albert.catwhisker.org> <AE2261C9-12E5-4DA2-AEA9-43C3E9C4AA2A@me.com> <YpSb5aWAn3DYZXZQ@albert.catwhisker.org> <CANCZdfqDx2rVNy=K1rcbQZu1igFDhuUwwBQN7UN9p=Ya-t3ZbA@mail.gmail.com> <7BEE44CC-4D31-4CBC-BC12-9A327424299C@me.com> <CANCZdfpqiOj595_uU=kWg4qD37GCO1zXZo6B2MUbWTokUeugHg@mail.gmail.com> <20220530223432.D91C518F@slippy.cwsent.com> <CA%2Bq%2BTcp_wfhhK2CvdKsx9GwkKmD3mR9D12pny4ge1Dq4=NokDQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000007573af05e056d04a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, May 31, 2022 at 3:55 PM Olivier Cochard-Labb=C3=A9 <olivier@freebsd=
.org>
wrote:

> Same problem here:
> - I'm building FreeBSD head on a builder machine, and NFS mounting its
> /usr/src and /usr/obj to 4 others
>
> Results:
> - 2 of them, UEFI+ZFS machines works great ((Thinkpad T420 and AMD Epyc
> with Tyan motherboard)
> - 2 of them, BIOS+UFS machines meet this "can't find /boot/ua/loader.lua"
> (HP microserver and PC Engines APU2)
>
> I had to boot from an USB stick, mounting the system partition and "cp
> boot/loader_4th.old boot/loader".
>

Kirk found that the boot loader defines MAXPHYS to be 128k, which only is
for the BIOS loader since it's 32-bit. UEFI
is 64-bits and just works because it's define to 1MB. So the UEFI machines
with ZFS are doubly safe. Kirk has a change
that relaxes the check and I think we should do this

diff --git a/sys/sys/param.h b/sys/sys/param.h
index 1f720ed31142..8cd9616e872e 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -176,7 +176,7 @@
 #define DFLTPHYS       (64 * 1024)     /* default max raw I/O transfer
size */
 #endif
 #ifndef MAXPHYS                                /* max raw I/O transfer
size */
-#ifdef __ILP32__
+#if defined(__ILP32__) && !defined(_STANDALONE) /* Always 1M for loader */
 #define MAXPHYS                (128 * 1024)
 #else
 #define MAXPHYS                (1024 * 1024)

as well to ensure that the loader always assumes a larger MAXPHYS (though
I'd kinda like the loader to not
define it at all, but that is a longer conversation after reflection not a
quick fix to get people back up and
running).

Warner

--0000000000007573af05e056d04a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Tue, May 31, 2022 at 3:55 PM Olivi=
er Cochard-Labb=C3=A9 &lt;<a href=3D"mailto:olivier@freebsd.org">olivier@fr=
eebsd.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div>Same problem here:</div><=
div>- I&#39;m building FreeBSD head on a builder machine, and NFS mounting =
its /usr/src and /usr/obj to 4 others</div><div><br></div><div>Results:</di=
v><div>- 2 of them, UEFI+ZFS machines works great ((Thinkpad T420 and AMD E=
pyc with Tyan motherboard)</div><div>- 2 of them, BIOS+UFS machines meet th=
is &quot;can&#39;t find /boot/ua/loader.lua&quot; (HP microserver and PC En=
gines APU2)</div><div><br></div><div>I had to boot from an USB stick, mount=
ing the system partition and &quot;cp boot/loader_4th.old boot/loader&quot;=
.</div></div></div></blockquote><div><br></div><div>Kirk found that the boo=
t loader defines MAXPHYS to be 128k, which only is for the BIOS loader sinc=
e it&#39;s 32-bit. UEFI</div><div>is 64-bits and just works because it&#39;=
s define to 1MB. So the UEFI machines with ZFS are doubly safe. Kirk has a =
change</div><div>that relaxes the check and I think we should do this</div>=
<div><br></div><div>diff --git a/sys/sys/param.h b/sys/sys/param.h<br>index=
 1f720ed31142..8cd9616e872e 100644<br>--- a/sys/sys/param.h<br>+++ b/sys/sy=
s/param.h<br>@@ -176,7 +176,7 @@<br>=C2=A0#define DFLTPHYS =C2=A0 =C2=A0 =
=C2=A0 (64 * 1024) =C2=A0 =C2=A0 /* default max raw I/O transfer size */<br=
>=C2=A0#endif<br>=C2=A0#ifndef MAXPHYS =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0/* max raw I/O transfer size */<br>-#ifdef __ILP32__<br>+#if defined(__I=
LP32__) &amp;&amp; !defined(_STANDALONE) /* Always 1M for loader */<br>=C2=
=A0#define MAXPHYS =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(=
128 * 1024)<br>=C2=A0#else<br>=C2=A0#define MAXPHYS =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1024 * 1024)<br></div><div><br></div><di=
v>as well to ensure that the loader always assumes a larger MAXPHYS (though=
 I&#39;d kinda like the loader to not</div><div>define it at all, but that =
is a longer conversation after reflection not a quick fix to get people bac=
k up and</div><div>running).</div><div><br></div><div>Warner</div></div></d=
iv>

--0000000000007573af05e056d04a--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfr3gVXT6qEvXY3S9AeuBT7KKs_YcrBEk60a0jZmZ531VQ>