Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Dec 2022 18:03:07 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        hiroo.ono+freebsd@gmail.com
Cc:        Mark Millard <marklmi@yahoo.com>, freebsd-arm@freebsd.org
Subject:   Re: Still did not succeed to boot on Lenovo Yoga C630
Message-ID:  <CANCZdfrF8P0FgU-E-n8hgNVshg3BBJuCuYOdTwEz4DMQ3mPDvg@mail.gmail.com>
In-Reply-To: <CANtk6SgeCFSwkRpXDd9DsR%2BN%2BNNa_c9pm6-8u6c9Q2au0ZiWZA@mail.gmail.com>
References:  <CANtk6SgUoqC_Jgdtu=CZnFvnLzqP445MQqfwhV5%2BBgX_%2BVFUZA@mail.gmail.com> <B55013C7-B04C-48E4-BC0F-C106DA08348F@yahoo.com> <CANtk6Shwaea09TiTZq3UZwzCoXjm8TqkA930QQwS_i3_Awd5bg@mail.gmail.com> <CANCZdfqpTW3AVHPfHPWOEpEW2QPTE6aADGNzhH=pQT4btA1%2BvQ@mail.gmail.com> <CANtk6Si4Eg3vd4j3wvgCt%2BoodpNK7ikei-XikEmXPMdQUane3w@mail.gmail.com> <CANCZdfpKnxeRp3RtPGrq%2BsCMqXjq0AnYWuN2orHt1qt57KRh0Q@mail.gmail.com> <CANtk6ShzbOcw%2B86J_M_AQeDHU36ptQG%2Bj7XndYzhCJ3E0N0Qqw@mail.gmail.com> <CANtk6ShVXDHt5K0UoGaMgw0o_w3HPCMPGYdu-m1hCUkZ3ZMcUQ@mail.gmail.com> <CANCZdfqyMUUDVgg4YHZNaXGVb9E8TXmFH0jtQuXN0TkCti46vQ@mail.gmail.com> <CANtk6SgeCFSwkRpXDd9DsR%2BN%2BNNa_c9pm6-8u6c9Q2au0ZiWZA@mail.gmail.com>

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

On Fri, Dec 23, 2022 at 5:49 PM Hiroo Ono (=E5=B0=8F=E9=87=8E=E5=AF=9B=E7=
=94=9F) <
hiroo.ono+freebsd@gmail.com> wrote:

> The current status of FreeBSD 14-current on Lenovo Yoga C630 is as follow=
s:
>
>  1) Merging from OpenBSD's loader code made the loader boot apart from
> 3 points (#2 to 4 ).
>  2) when comconsole->c_init() runs the 2nd time, it seems to freeze.
> (might be C630 specific)
>  3) SetVirtualAddressMap() in efi_do_vmap() freezes. (might also
> affect other snapdragon systems like Microsoft Arm Developer Kit)
>  4) The kernel is kicked but does not start.
>
> 1) is quite straightforward. What needs to be changed is
> stand/efi/loader/arch/arm64/start.S.
>

Can you share what needs to be done? To my eye, we don't need any changes,
so it would be good to know what you've had to do exactly.


> For 2), I do not know what to do. Currently, I commented out
> comconsole from struct console *consoles[] in stand/efi/loader/conf.c
> as a workaround. Maybe, I should write a fault handler that helps
> returning from the fault.
>

There were problems with this with HyperV on aarch64 too.

Something like
diff --git a/stand/efi/loader/efiserialio.c b/stand/efi/loader/efiserialio.=
c
index 8b3f8e83e0b3..54ee39096685 100644
--- a/stand/efi/loader/efiserialio.c
+++ b/stand/efi/loader/efiserialio.c
@@ -261,11 +261,11 @@ comc_probe(struct console *sc)
                if (comc_port =3D=3D NULL)
                        return;
        }
-       comc_port->baudrate =3D COMSPEED;
+       comc_port->baudrate =3D 0;
        comc_port->ioaddr =3D 0;                  /* default port */
-       comc_port->databits =3D 8;                /* 8,n,1 */
-       comc_port->parity =3D NoParity;           /* 8,n,1 */
-       comc_port->stopbits =3D OneStopBit;       /* 8,n,1 */
+       comc_port->databits =3D 0;                /* 8,n,1 */
+       comc_port->parity =3D 0;          /* 8,n,1 */
+       comc_port->stopbits =3D 0;        /* 8,n,1 */
        comc_port->ignore_cd =3D 1;               /* ignore cd */
        comc_port->rtsdtr_off =3D 0;              /* rts-dtr is on */
        comc_port->sio =3D NULL;

was needed.  Possibly the following would be better:

diff --git a/stand/efi/loader/efiserialio.c b/stand/efi/loader/efiserialio.=
c
index 8b3f8e83e0b3..54ee39096685 100644
--- a/stand/efi/loader/efiserialio.c
+++ b/stand/efi/loader/efiserialio.c
@@ -494,8 +494,7 @@ comc_setup(void)
                return (false);

        status =3D comc_port->sio->SetAttributes(comc_port->sio,
-           comc_port->baudrate, 0, 0, comc_port->parity,
-           comc_port->databits, comc_port->stopbits);
+           0, 0, 0, 0, 0, 0);
        if (EFI_ERROR(status))
                return (false);



> 3), I dumped each memory map's VirtualStart and PhysicalStart. All
> VirtualStart were 0. So overwriting VirutalStart by the value of
> PhysicalStart and running SetVirtualAddressMap should work. But in
> reality, it doesn't.
>   OpenBSD does not use SetVirtualAddress for arm64 and Linux seems to
> have abandoned it for arm64 in 2019.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=3D=
4e46c2a956215482418d7b315749fb1b6c6bc224
>   Maybe, we also can avoid SetVirtualAddressMap (by
> efi_disable_vmap=3D"YES"). In this case, (as you wrote) I should change
> the kernel to treat VA=3D=3DPA if VirtualStart is 0. (OpenBSD seems to do
> so).
>

FreeBSD tends to prefer this... Our kernel needs to cope with cases where
it has
been called (many kexec environments provide PA !=3D VA virtual mappings th=
at
we
can't change).


> About 4), I am completely confused. In elf64_exec in
> stand/efi/loader/arch/arm64/exec.c, the memory address that the kernel
> was loaded is calculated as:
>     entry =3D efi_translate(ehdr->e_entry);  // which becomes 0xb340000
> and later kicked as:
>     (*entry)(modulep);
> I wrote that this calculation is doubtful, but it was right. I dumped
> the data at the address 0xb340000 and compared it with the output of
> objdump -D loader_lua.syms. It turned out that it matched with the
> kernel's _start code in locore.S.
> Putting some code that jumps to loader's ImageBase address at the
> start of kernel's _start did not change anything, so I judged that the
> kernel is not started at all.
> The excerpt of the loader's memmap command output is as follows:
>     Type           Physical           Virtual              #Pages     Att=
r
>     LoaderData 0000b33ea000  000000000000  00000000  UC WC WT WB WP RP XP
>     LoaderCode 0000bb909000  000000000000  000000d1 UC WC WT WB WP RP XP
> From this output, I wonder if the memory attributes on Yoga C630 is
> properly implemented, but as XP (exec protect) bit is on, I tried to
> set it off by DXE services' SetMemoryAttributes() (with a lot of
> transcription from the standards...).It succeeded, but the kernel
> still did not run.
>
> From this tweet:
> https://twitter.com/canadianbryan/status/1598053941270679552 and its
> replies, the Microsoft Arm Developer Kit seems to have similar
> problem, so if somebody succeeded to run FreeBSD on it, please share
> the information how to do it.
>

I run other arm64 machines w/o issue with the current code. I've not heard
from Allan
for his changes, nor seen any reviews come through...

Where can one buy one of these systems. It seems just odd-ball enough that
I can
justify picking one up for work...

Warner


> 2022=E5=B9=B412=E6=9C=8819=E6=97=A5(=E6=9C=88) 5:33 Warner Losh <imp@bsdi=
mp.com>:
>
> >
> >
> >
> > On Sun, Dec 18, 2022 at 4:31 AM Hiroo Ono (=E5=B0=8F=E9=87=8E=E5=AF=9B=
=E7=94=9F) <
> hiroo.ono+freebsd@gmail.com> wrote:
> >>
> >> Hello,
> >>
> >> I investigated a little more.
> >> I thought it was the kernel that did not run, but still it did not get
> >> through the loader.
> >
> >
> > Keep at it...
> >
> >>
> >> The loader freezed in efi_do_vmap(), so I needed to add
> >> efi_disable_vmap=3D"YES" in loader.conf.
> >
> >
> > No. The code for this needs to be fixed...  More on that in a second...
> >
> >>
> >> At last, in elf64_exec, it tried to run (*entry)(modulep) where the
> >> address entry is calculated from ehdr->e_entry by efi_translate() in
> >> stand/efi/loader/copy.c. There,
> >> ehdr->e_entry was 0xffff000000020000 (should be 0xffff000000000800,
> >> but I modified a little) and
> >> stage_offset was 0x10000b33e0000.
> >> The sum of two which efi_translate() returns is 0x100000000b3400000.
> >> It overflows uint64_t and becomes 0xb3400000.
> >
> >
> > Yea, I think this is wrong.
> >
> >>
> >> Currently, I do not understand well what the functions in
> >> stand/efi/loader/copy.c do, and do not know how to workaround this
> >> problem.
> >
> >
> > So there's two things going on here. First is that on arm64 we should
> *NEVER* copy the
> > kernel. It loads at a specific address and we jump to where it loaded i=
n
> RAM (in your case,
> > I think it should be stage_offset + (ehdr->e_entry - KERNBASE). Kernbas=
e
> is 0xffff000000000000
> > so we should jump to 0x10000brre0000 + 0x20000 (or maybe 0x800 is you
> suggest). The kernel
> > code that's there should do some tricks to find out where it was loaded=
,
> turn on the MMU and
> > then jump to the VA to continue starting up the kernel. The arm64 kerne=
l
> is linked with a VA. Old amd64
> > kernels expected to start at a fixed physical address, but the UEFI spe=
c
> allows memory to be mapped anywhere
> > which means it was recently switched to create a page table in the boot
> loader, then jump to the right
> > VA, and use the page table to find what PA that is and use that to
> bootstrap the pmap. This works great on
> > amd64, but sometimes goes astray on arm64 (though the way it does for
> you doesn't make sense
> > to me). The amd64 code used to start at a PA, and that's what the 'copy=
'
> routine is supposed to do:
> > copy the kernel down that fixed address and jump to it. I don't think
> we'll ever want that on arm64, though,
> > and that might also be getting in your way (thought I'm doing this from
> memory w/o careful study of
> > the code because it's fresh in my mind due to getting arm64 working wit=
h
> linuxboot).
> >
> > Also, vmap *MUST* be called in the boot loader. The trouble is, it
> assumes VA =3D=3D PA, but that's not
> > strictly true. If you boot via LinuxBoot, for example, it has a memory
> mapping that's not VA =3D=3D PA so
> > at least some parts of the kernel fail their VA =3D=3D PA asserts. the =
vmap
> code in the loader currently
> > blindly assumes VA =3D=3D PA, but it should, IMHO, only do that if the =
VA
> from entry from the table from
> > the get memory map call is 0. Today it blindly overwrites it. You might
> try changing that, and removing
> > the bit in the kernel that checks for VA =3D=3D PA and bails out if the=
re's
> a mismatch. Here's the patch I'm
> > temporarily using until I have the time to do more than a quick,
> superficial analysis of the issue:
> >
> > diff --git a/sys/arm64/arm64/efirt_machdep.c
> b/sys/arm64/arm64/efirt_machdep.c
> > index 727c9c37f94d..075174d164d8 100644
> > --- a/sys/arm64/arm64/efirt_machdep.c
> > +++ b/sys/arm64/arm64/efirt_machdep.c
> > @@ -193,8 +193,8 @@ efi_create_1t1_map(struct efi_md *map, int ndesc,
> int descsz)
> >                         continue;
> >                 if (p->md_virt !=3D 0 && p->md_virt !=3D p->md_phys) {
> >                         if (bootverbose)
> > -                               printf("EFI Runtime entry %d is
> mapped\n", i);
> > -                       goto fail;
> > +                               printf("EFI Runtime entry %d is mapped
> PA %#lx VA %#lx\n", i, p->md_phys, p->md_virt);
> > +//                     goto fail;
> >                 }
> >                 if ((p->md_phys & EFI_PAGE_MASK) !=3D 0) {
> >                         if (bootverbose)
> >
> > clearly, not suitable for upstreaming, eh? And I have about 2 dozen
> commits in my queue ahead of that
> > one that need refinement, review and upstreaming before I jump into thi=
s
> issue. It will be after the first
> > of the year at least before I'll look at it since I just started my
> year-end vacation...
> >
> > Warner
> >
> >>
> >> 2022=E5=B9=B412=E6=9C=889=E6=97=A5(=E9=87=91) 9:25 Hiroo Ono (=E5=B0=
=8F=E9=87=8E=E5=AF=9B=E7=94=9F) <hiroo.ono+freebsd@gmail.com>:
> >> >
> >> > 2022=E5=B9=B412=E6=9C=889=E6=97=A5(=E9=87=91) 3:19 Warner Losh <imp@=
bsdimp.com>:
> >> > >
> >> > >
> >> > >
> >> > > On Wed, Dec 7, 2022 at 4:21 PM Hiroo Ono (=E5=B0=8F=E9=87=8E=E5=AF=
=9B=E7=94=9F) <
> hiroo.ono+freebsd@gmail.com> wrote:
> >> > >>
> >> > >> 2022=E5=B9=B412=E6=9C=887=E6=97=A5(=E6=B0=B4) 1:18 Warner Losh <i=
mp@bsdimp.com>:
> >> > >> >
> >> > >> >
> >> > >> >
> >> > >> > On Tue, Dec 6, 2022 at 7:59 AM Hiroo Ono (=E5=B0=8F=E9=87=8E=E5=
=AF=9B=E7=94=9F) <
> hiroo.ono+freebsd@gmail.com> wrote:
> >> > >>
> >> > >> >> OK, I (and the subject) was wrong. The loader boots, and show
> >> > >> >> following log at last:
> >> > >> >>
> >> > >> >> Loading kernel...
> >> > >> >> /boot/kernel/kernel text=3D0x2a8 text=3D0x8bcbf0 text=3D0x1f97=
ac
> >> > >> >> data=3D0x1a6ac0 data=3D0x0+0x381000 syms=3D[0x8+0x11f6a0+0x8+0=
x1439ea]
> >> > >> >> Loading configured modules...
> >> > >> >> can't find '/boot/entropy'
> >> > >> >> can't find '/etc/hostid'
> >> > >> >> No valid device tree blob found!
> >> > >> >> WARNING! Trying to fire up the kernel, but no device tree blob
> found!
> >> > >> >> EFI framebuffer information
> >> > >> >> addr, size        0x80400000, 0x7e9000
> >> > >> >> dimensions     1920 x 1080
> >> > >> >> stride             1920
> >> > >> >> masks            0x00ff0000, 0x0000ff00, 0x000000ff, 0xff00000=
0
> >> > >> >>
> >> > >> >> and it stops here. No "<<BOOT>>" line is displayed.
> >> > >> >> So, it seems that the kernel is loaded but could not be starte=
d.
> >> > >> >
> >> > >> >
> >> > >> > There are several causes of this.
> >> > >> >
> >> > >> > Most likely is that the console is setup to go somewhere else.
> Though if you are on the video display and getting that framebuffer outpu=
t,
> it won't not go there w/o some setting to override (say to force serial).
> >> > >>
> >> > >> In the loader, when comconsole->c_init() is called for the second
> >> > >> time, the function does not return. (I commented out comconsole t=
o
> >> > >> make the loader work, but it is rather brutal and is not a proper
> >> > >> solution).
> >> > >> But the function parse_uefi_con_out() in stand/efi/loader/main.c
> >> > >> always returns RB_SERIAL, so the loader tries to use the serial
> >> > >> console.
> >> > >
> >> > >
> >> > > I wonder why that is. Is this -current or -stable? I have a rather
> large backlog of MFC-able loader changes. If it is with stable, then it
> makes sense: I fixed a bug where parse_uefi_con_out would return serial i=
f
> '8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut' was unset. Is it set?  Now =
we
> return Video console if we fine evidence there's a video console.
> >> >
> >> > It is stable/13.
> >> > I tried 14-current, and the same change to loader was needed (mergin=
g
> >> > OpenBSD's start.S and ldscript.arm64, and commenting out comconsole)=
.
> >> > Even with these change, the console defaults to serial, so I changed
> >> > parse_uefi_con_out() to always return 0.
> >> > Still, it stops at the same point. The kernel does not seem to boot.
> >> >
> >> > Running efi-show from the loader prompt did not show
> >> > '8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut'
> >> > The variable name containing 'ConOut' were:
> >> >
> >> > global NV,BS,RS ConOut =3D
> >> >
> VenHw(9042A9DE-23DC-4A38-96FB-7ADED080516A),/VenHw(857A8741-0EEC-43BD-048=
2-27D14ED47D72)/Uart(115200,8,N,1)
> >> > global NV,BS,RS ConOutDev =3D
> >> >
> VenHw(9042A9DE-23DC-4A38-96FB-7ADED080516A),/VenHw(857A8741-0EEC-43BD-048=
2-27D14ED47D72)/Uart(115200,8,N,1)
> >> >
> >> > > Now, why it fails the second time, I don't know.
> >> > >
> >> > >>
> >> > >> If a similar thing happens with the kernel, it may be stopping at
> >> > >> serial console initialization.
> >> > >
> >> > >
> >> > > The kernel doesn't use the EFI routines to initialize the serial
> console. But if the kernel is being told the wrong console, then it could
> also be booting just fine or almost fine and hitting some bug later.
> >> > >
> >> > >>
> >> > >> > Next most likely is that FreeBSD doesn't cope well with having
> both FDT and ACPI information available. But since not DTB is being passe=
d
> in (per that message) that's not likely at play here.
> >> > >>
> >> > >> I managed to load the dtb file and the boot process stopped at th=
e
> >> > >> same point. The problem is not here?
> >> > >
> >> > >
> >> > > Yea, I don't think so.
> >> > >
> >> > > Warner
> >> > >
> >> > >>
> >> > >> > Finally, the loader passes a large number of tables, etc to the
> kernel. It's quite possible that, for reasons still unknown, that data is
> wrong or if standard conforming not expected by the kernel. this leads to=
 a
> crash before we've setup the console in the kernel which looks a lot like=
 a
> hang.
> >> > >> >
> >> > >> > Warner
> >> > >> >
> >> > >> >
> >> > >> >>
> >> > >> >> > . . .
> >> > >> >> >
> >> > >> >> > Such also happens for stable/13, releng/13.* based
> installations
> >> > >> >> > as well --and likely others too.
> >> > >> >> >
> >> > >> >> > ACPI booting does not use Device Tree information but the
> messages
> >> > >> >> > are output anyway about the lack. Only if you know that the
> context
> >> > >> >> > is a Device Tree style of boot are the messages actually
> reporting
> >> > >> >> > a problem.
> >> > >> >> >
> >> > >> >> >
> >> > >> >> > =3D=3D=3D
> >> > >> >> > Mark Millard
> >> > >> >> > marklmi at yahoo.com
> >> > >> >> >
> >> > >> >>
>

--000000000000b6dfee05f0887747
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 Fri, Dec 23, 2022 at 5:49 PM Hiroo=
 Ono (=E5=B0=8F=E9=87=8E=E5=AF=9B=E7=94=9F) &lt;<a href=3D"mailto:hiroo.ono=
%2Bfreebsd@gmail.com">hiroo.ono+freebsd@gmail.com</a>&gt; wrote:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex">The current status of Free=
BSD 14-current on Lenovo Yoga C630 is as follows:<br>
<br>
=C2=A01) Merging from OpenBSD&#39;s loader code made the loader boot apart =
from<br>
3 points (#2 to 4 ).<br>
=C2=A02) when comconsole-&gt;c_init() runs the 2nd time, it seems to freeze=
.<br>
(might be C630 specific)<br>
=C2=A03) SetVirtualAddressMap() in efi_do_vmap() freezes. (might also<br>
affect other snapdragon systems like Microsoft Arm Developer Kit)<br>
=C2=A04) The kernel is kicked but does not start.<br>
<br>
1) is quite straightforward. What needs to be changed is<br>
stand/efi/loader/arch/arm64/start.S.<br></blockquote><div><br></div><div>Ca=
n you share what needs to be done? To my eye, we don&#39;t need any changes=
, so it would be good to know what you&#39;ve had to do exactly.</div><div>=
=C2=A0</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">
For 2), I do not know what to do. Currently, I commented out<br>
comconsole from struct console *consoles[] in stand/efi/loader/conf.c<br>
as a workaround. Maybe, I should write a fault handler that helps<br>
returning from the fault.<br></blockquote><div><br></div><div>There were pr=
oblems with this with HyperV on aarch64 too.</div><div><br></div><div>Somet=
hing like</div><div>diff --git a/stand/efi/loader/efiserialio.c b/stand/efi=
/loader/efiserialio.c<br>index 8b3f8e83e0b3..54ee39096685 100644<br>--- a/s=
tand/efi/loader/efiserialio.c<br>+++ b/stand/efi/loader/efiserialio.c<br>@@=
 -261,11 +261,11 @@ comc_probe(struct console *sc)<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (comc_port =3D=3D NULL)<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 r=
eturn;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>- =C2=A0 =C2=A0 =C2=A0 comc_port=
-&gt;baudrate =3D COMSPEED;<br>+ =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;baudrat=
e =3D 0;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;ioaddr =3D 0; =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* default port */<b=
r>- =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;databits =3D 8; =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* 8,n,1 */<br>- =C2=A0 =C2=A0 =C2=A0 co=
mc_port-&gt;parity =3D NoParity; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* 8,n,=
1 */<br>- =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;stopbits =3D OneStopBit; =C2=
=A0 =C2=A0 =C2=A0 /* 8,n,1 */<br>+ =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;datab=
its =3D 0; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* 8,n,1 =
*/<br>+ =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;parity =3D 0; =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0/* 8,n,1 */<br>+ =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;stopbi=
ts =3D 0; =C2=A0 =C2=A0 =C2=A0 =C2=A0/* 8,n,1 */<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 comc_port-&gt;ignore_cd =3D 1; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 /* ignore cd */<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;=
rtsdtr_off =3D 0; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* rts-dt=
r is on */<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;sio =3D NULL;<br></=
div><div><br></div><div>was needed.=C2=A0 Possibly the following would be b=
etter:</div><br>diff --git a/stand/efi/loader/efiserialio.c b/stand/efi/loa=
der/efiserialio.c<br>index 8b3f8e83e0b3..54ee39096685 100644<br>--- a/stand=
/efi/loader/efiserialio.c<br>+++ b/stand/efi/loader/efiserialio.c<br><div>@=
@ -494,8 +494,7 @@ comc_setup(void)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 return (false);<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 sta=
tus =3D comc_port-&gt;sio-&gt;SetAttributes(comc_port-&gt;sio,<br>- =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;baudrate, 0, 0, comc_port-&gt;par=
ity,<br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comc_port-&gt;databits, comc_p=
ort-&gt;stopbits);<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0, 0, 0, 0, 0, 0=
);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (EFI_ERROR(status))<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (false);<br></div><div><br=
></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0=
px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
3), I dumped each memory map&#39;s VirtualStart and PhysicalStart. All<br>
VirtualStart were 0. So overwriting VirutalStart by the value of<br>
PhysicalStart and running SetVirtualAddressMap should work. But in<br>
reality, it doesn&#39;t.<br>
=C2=A0 OpenBSD does not use SetVirtualAddress for arm64 and Linux seems to<=
br>
have abandoned it for arm64 in 2019.<br>
=C2=A0 =C2=A0 <a href=3D"https://git.kernel.org/pub/scm/linux/kernel/git/ti=
p/tip.git/commit/?id=3D4e46c2a956215482418d7b315749fb1b6c6bc224" rel=3D"nor=
eferrer" target=3D"_blank">https://git.kernel.org/pub/scm/linux/kernel/git/=
tip/tip.git/commit/?id=3D4e46c2a956215482418d7b315749fb1b6c6bc224</a><br>
=C2=A0 Maybe, we also can avoid SetVirtualAddressMap (by<br>
efi_disable_vmap=3D&quot;YES&quot;). In this case, (as you wrote) I should =
change<br>
the kernel to treat VA=3D=3DPA if VirtualStart is 0. (OpenBSD seems to do<b=
r>
so).<br></blockquote><div><br></div><div>FreeBSD tends to prefer this... Ou=
r kernel needs to cope with cases where it has</div><div>been called (many =
kexec environments provide PA !=3D VA virtual mappings that we</div><div>ca=
n&#39;t change).</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">
About 4), I am completely confused. In elf64_exec in<br>
stand/efi/loader/arch/arm64/exec.c, the memory address that the kernel<br>
was loaded is calculated as:<br>
=C2=A0 =C2=A0 entry =3D efi_translate(ehdr-&gt;e_entry);=C2=A0 // which bec=
omes 0xb340000<br>
and later kicked as:<br>
=C2=A0 =C2=A0 (*entry)(modulep);<br>
I wrote that this calculation is doubtful, but it was right. I dumped<br>
the data at the address 0xb340000 and compared it with the output of<br>
objdump -D loader_lua.syms. It turned out that it matched with the<br>
kernel&#39;s _start code in locore.S.<br>
Putting some code that jumps to loader&#39;s ImageBase address at the<br>
start of kernel&#39;s _start did not change anything, so I judged that the<=
br>
kernel is not started at all.<br>
The excerpt of the loader&#39;s memmap command output is as follows:<br>
=C2=A0 =C2=A0 Type=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Physical=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Virtual=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 #Pages=C2=A0 =C2=A0 =C2=A0Attr<br>
=C2=A0 =C2=A0 LoaderData 0000b33ea000=C2=A0 000000000000=C2=A0 00000000=C2=
=A0 UC WC WT WB WP RP XP<br>
=C2=A0 =C2=A0 LoaderCode 0000bb909000=C2=A0 000000000000=C2=A0 000000d1 UC =
WC WT WB WP RP XP<br>
>From this output, I wonder if the memory attributes on Yoga C630 is<br>
properly implemented, but as XP (exec protect) bit is on, I tried to<br>
set it off by DXE services&#39; SetMemoryAttributes() (with a lot of<br>
transcription from the standards...).It succeeded, but the kernel<br>
still did not run.<br>
<br>
>From this tweet:<br>
<a href=3D"https://twitter.com/canadianbryan/status/1598053941270679552" re=
l=3D"noreferrer" target=3D"_blank">https://twitter.com/canadianbryan/status=
/1598053941270679552</a> and its<br>
replies, the Microsoft Arm Developer Kit seems to have similar<br>
problem, so if somebody succeeded to run FreeBSD on it, please share<br>
the information how to do it.<br></blockquote><div><br></div><div>I run oth=
er arm64 machines w/o issue with the current code. I&#39;ve not heard from =
Allan</div><div>for his changes, nor seen any reviews come through...</div>=
<div><br></div><div>Where can one buy one of these systems.=C2=A0It seems j=
ust odd-ball enough that I can</div><div>justify picking one up for work...=
</div><div><br></div><div>Warner</div><div>=C2=A0</div><blockquote class=3D=
"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2=
04,204,204);padding-left:1ex">
2022=E5=B9=B412=E6=9C=8819=E6=97=A5(=E6=9C=88) 5:33 Warner Losh &lt;<a href=
=3D"mailto:imp@bsdimp.com" target=3D"_blank">imp@bsdimp.com</a>&gt;:<br>
<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Sun, Dec 18, 2022 at 4:31 AM Hiroo Ono (=E5=B0=8F=E9=87=8E=E5=AF=9B=
=E7=94=9F) &lt;<a href=3D"mailto:hiroo.ono%2Bfreebsd@gmail.com" target=3D"_=
blank">hiroo.ono+freebsd@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; I investigated a little more.<br>
&gt;&gt; I thought it was the kernel that did not run, but still it did not=
 get<br>
&gt;&gt; through the loader.<br>
&gt;<br>
&gt;<br>
&gt; Keep at it...<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; The loader freezed in efi_do_vmap(), so I needed to add<br>
&gt;&gt; efi_disable_vmap=3D&quot;YES&quot; in loader.conf.<br>
&gt;<br>
&gt;<br>
&gt; No. The code for this needs to be fixed...=C2=A0 More on that in a sec=
ond...<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; At last, in elf64_exec, it tried to run (*entry)(modulep) where th=
e<br>
&gt;&gt; address entry is calculated from ehdr-&gt;e_entry by efi_translate=
() in<br>
&gt;&gt; stand/efi/loader/copy.c. There,<br>
&gt;&gt; ehdr-&gt;e_entry was 0xffff000000020000 (should be 0xffff000000000=
800,<br>
&gt;&gt; but I modified a little) and<br>
&gt;&gt; stage_offset was 0x10000b33e0000.<br>
&gt;&gt; The sum of two which efi_translate() returns is 0x100000000b340000=
0.<br>
&gt;&gt; It overflows uint64_t and becomes 0xb3400000.<br>
&gt;<br>
&gt;<br>
&gt; Yea, I think this is wrong.<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Currently, I do not understand well what the functions in<br>
&gt;&gt; stand/efi/loader/copy.c do, and do not know how to workaround this=
<br>
&gt;&gt; problem.<br>
&gt;<br>
&gt;<br>
&gt; So there&#39;s two things going on here. First is that on arm64 we sho=
uld *NEVER* copy the<br>
&gt; kernel. It loads at a specific address and we jump to where it loaded =
in RAM (in your case,<br>
&gt; I think it should be stage_offset + (ehdr-&gt;e_entry - KERNBASE). Ker=
nbase is 0xffff000000000000<br>
&gt; so we should jump to 0x10000brre0000 + 0x20000 (or maybe 0x800 is you =
suggest). The kernel<br>
&gt; code that&#39;s there should do some tricks to find out where it was l=
oaded, turn on the MMU and<br>
&gt; then jump to the VA to continue starting up the kernel. The arm64 kern=
el is linked with a VA. Old amd64<br>
&gt; kernels expected to start at a fixed physical address, but the UEFI sp=
ec allows memory to be mapped anywhere<br>
&gt; which means it was recently switched to create a page table in the boo=
t loader, then jump to the right<br>
&gt; VA, and use the page table to find what PA that is and use that to boo=
tstrap the pmap. This works great on<br>
&gt; amd64, but sometimes goes astray on arm64 (though the way it does for =
you doesn&#39;t make sense<br>
&gt; to me). The amd64 code used to start at a PA, and that&#39;s what the =
&#39;copy&#39; routine is supposed to do:<br>
&gt; copy the kernel down that fixed address and jump to it. I don&#39;t th=
ink we&#39;ll ever want that on arm64, though,<br>
&gt; and that might also be getting in your way (thought I&#39;m doing this=
 from memory w/o careful study of<br>
&gt; the code because it&#39;s fresh in my mind due to getting arm64 workin=
g with linuxboot).<br>
&gt;<br>
&gt; Also, vmap *MUST* be called in the boot loader. The trouble is, it ass=
umes VA =3D=3D PA, but that&#39;s not<br>
&gt; strictly true. If you boot via LinuxBoot, for example, it has a memory=
 mapping that&#39;s not VA =3D=3D PA so<br>
&gt; at least some parts of the kernel fail their VA =3D=3D PA asserts. the=
 vmap code in the loader currently<br>
&gt; blindly assumes VA =3D=3D PA, but it should, IMHO, only do that if the=
 VA from entry from the table from<br>
&gt; the get memory map call is 0. Today it blindly overwrites it. You migh=
t try changing that, and removing<br>
&gt; the bit in the kernel that checks for VA =3D=3D PA and bails out if th=
ere&#39;s a mismatch. Here&#39;s the patch I&#39;m<br>
&gt; temporarily using until I have the time to do more than a quick, super=
ficial analysis of the issue:<br>
&gt;<br>
&gt; diff --git a/sys/arm64/arm64/efirt_machdep.c b/sys/arm64/arm64/efirt_m=
achdep.c<br>
&gt; index 727c9c37f94d..075174d164d8 100644<br>
&gt; --- a/sys/arm64/arm64/efirt_machdep.c<br>
&gt; +++ b/sys/arm64/arm64/efirt_machdep.c<br>
&gt; @@ -193,8 +193,8 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, =
int descsz)<br>
&gt;=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=A0continue;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (p-&gt=
;md_virt !=3D 0 &amp;&amp; p-&gt;md_virt !=3D p-&gt;md_phys) {<br>
&gt;=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=A0if (bootverbose)<br>
&gt; -=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=A0printf(&quot;EFI Runtime entry %d=
 is mapped\n&quot;, i);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0goto fail;<br>
&gt; +=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=A0printf(&quot;EFI Runtime entry %d=
 is mapped PA %#lx VA %#lx\n&quot;, i, p-&gt;md_phys, p-&gt;md_virt);<br>
&gt; +//=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0goto fail;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ((p-&g=
t;md_phys &amp; EFI_PAGE_MASK) !=3D 0) {<br>
&gt;=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=A0if (bootverbose)<br>
&gt;<br>
&gt; clearly, not suitable for upstreaming, eh? And I have about 2 dozen co=
mmits in my queue ahead of that<br>
&gt; one that need refinement, review and upstreaming before I jump into th=
is issue. It will be after the first<br>
&gt; of the year at least before I&#39;ll look at it since I just started m=
y year-end vacation...<br>
&gt;<br>
&gt; Warner<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2022=E5=B9=B412=E6=9C=889=E6=97=A5(=E9=87=91) 9:25 Hiroo Ono (=E5=
=B0=8F=E9=87=8E=E5=AF=9B=E7=94=9F) &lt;<a href=3D"mailto:hiroo.ono%2Bfreebs=
d@gmail.com" target=3D"_blank">hiroo.ono+freebsd@gmail.com</a>&gt;:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2022=E5=B9=B412=E6=9C=889=E6=97=A5(=E9=87=91) 3:19 Warner Los=
h &lt;<a href=3D"mailto:imp@bsdimp.com" target=3D"_blank">imp@bsdimp.com</a=
>&gt;:<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; On Wed, Dec 7, 2022 at 4:21 PM Hiroo Ono (=E5=B0=8F=E9=
=87=8E=E5=AF=9B=E7=94=9F) &lt;<a href=3D"mailto:hiroo.ono%2Bfreebsd@gmail.c=
om" target=3D"_blank">hiroo.ono+freebsd@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; &gt;&gt;<br>
&gt;&gt; &gt; &gt;&gt; 2022=E5=B9=B412=E6=9C=887=E6=97=A5(=E6=B0=B4) 1:18 W=
arner Losh &lt;<a href=3D"mailto:imp@bsdimp.com" target=3D"_blank">imp@bsdi=
mp.com</a>&gt;:<br>
&gt;&gt; &gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt; On Tue, Dec 6, 2022 at 7:59 AM Hiroo Ono (=E5=
=B0=8F=E9=87=8E=E5=AF=9B=E7=94=9F) &lt;<a href=3D"mailto:hiroo.ono%2Bfreebs=
d@gmail.com" target=3D"_blank">hiroo.ono+freebsd@gmail.com</a>&gt; wrote:<b=
r>
&gt;&gt; &gt; &gt;&gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; OK, I (and the subject) was wrong. The load=
er boots, and show<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; following log at last:<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; Loading kernel...<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; /boot/kernel/kernel text=3D0x2a8 text=3D0x8=
bcbf0 text=3D0x1f97ac<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; data=3D0x1a6ac0 data=3D0x0+0x381000 syms=3D=
[0x8+0x11f6a0+0x8+0x1439ea]<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; Loading configured modules...<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; can&#39;t find &#39;/boot/entropy&#39;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; can&#39;t find &#39;/etc/hostid&#39;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; No valid device tree blob found!<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; WARNING! Trying to fire up the kernel, but =
no device tree blob found!<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; EFI framebuffer information<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; addr, size=C2=A0 =C2=A0 =C2=A0 =C2=A0 0x804=
00000, 0x7e9000<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; dimensions=C2=A0 =C2=A0 =C2=A01920 x 1080<b=
r>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; stride=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A01920<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; masks=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; and it stops here. No &quot;&lt;&lt;BOOT&gt=
;&gt;&quot; line is displayed.<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; So, it seems that the kernel is loaded but =
could not be started.<br>
&gt;&gt; &gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt; There are several causes of this.<br>
&gt;&gt; &gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt; Most likely is that the console is setup to go =
somewhere else. Though if you are on the video display and getting that fra=
mebuffer output, it won&#39;t not go there w/o some setting to override (sa=
y to force serial).<br>
&gt;&gt; &gt; &gt;&gt;<br>
&gt;&gt; &gt; &gt;&gt; In the loader, when comconsole-&gt;c_init() is calle=
d for the second<br>
&gt;&gt; &gt; &gt;&gt; time, the function does not return. (I commented out=
 comconsole to<br>
&gt;&gt; &gt; &gt;&gt; make the loader work, but it is rather brutal and is=
 not a proper<br>
&gt;&gt; &gt; &gt;&gt; solution).<br>
&gt;&gt; &gt; &gt;&gt; But the function parse_uefi_con_out() in stand/efi/l=
oader/main.c<br>
&gt;&gt; &gt; &gt;&gt; always returns RB_SERIAL, so the loader tries to use=
 the serial<br>
&gt;&gt; &gt; &gt;&gt; console.<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; I wonder why that is. Is this -current or -stable? I hav=
e a rather large backlog of MFC-able loader changes. If it is with stable, =
then it makes sense: I fixed a bug where parse_uefi_con_out would return se=
rial if &#39;8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut&#39; was unset. Is=
 it set?=C2=A0 Now we return Video console if we fine evidence there&#39;s =
a video console.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; It is stable/13.<br>
&gt;&gt; &gt; I tried 14-current, and the same change to loader was needed =
(merging<br>
&gt;&gt; &gt; OpenBSD&#39;s start.S and ldscript.arm64, and commenting out =
comconsole).<br>
&gt;&gt; &gt; Even with these change, the console defaults to serial, so I =
changed<br>
&gt;&gt; &gt; parse_uefi_con_out() to always return 0.<br>
&gt;&gt; &gt; Still, it stops at the same point. The kernel does not seem t=
o boot.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Running efi-show from the loader prompt did not show<br>
&gt;&gt; &gt; &#39;8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut&#39;<br>
&gt;&gt; &gt; The variable name containing &#39;ConOut&#39; were:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; global NV,BS,RS ConOut =3D<br>
&gt;&gt; &gt; VenHw(9042A9DE-23DC-4A38-96FB-7ADED080516A),/VenHw(857A8741-0=
EEC-43BD-0482-27D14ED47D72)/Uart(115200,8,N,1)<br>
&gt;&gt; &gt; global NV,BS,RS ConOutDev =3D<br>
&gt;&gt; &gt; VenHw(9042A9DE-23DC-4A38-96FB-7ADED080516A),/VenHw(857A8741-0=
EEC-43BD-0482-27D14ED47D72)/Uart(115200,8,N,1)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt; Now, why it fails the second time, I don&#39;t know.<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt;<br>
&gt;&gt; &gt; &gt;&gt; If a similar thing happens with the kernel, it may b=
e stopping at<br>
&gt;&gt; &gt; &gt;&gt; serial console initialization.<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; The kernel doesn&#39;t use the EFI routines to initializ=
e the serial console. But if the kernel is being told the wrong console, th=
en it could also be booting just fine or almost fine and hitting some bug l=
ater.<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt; Next most likely is that FreeBSD doesn&#39;t co=
pe well with having both FDT and ACPI information available. But since not =
DTB is being passed in (per that message) that&#39;s not likely at play her=
e.<br>
&gt;&gt; &gt; &gt;&gt;<br>
&gt;&gt; &gt; &gt;&gt; I managed to load the dtb file and the boot process =
stopped at the<br>
&gt;&gt; &gt; &gt;&gt; same point. The problem is not here?<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Yea, I don&#39;t think so.<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt; Warner<br>
&gt;&gt; &gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt; Finally, the loader passes a large number of ta=
bles, etc to the kernel. It&#39;s quite possible that, for reasons still un=
known, that data is wrong or if standard conforming not expected by the ker=
nel. this leads to a crash before we&#39;ve setup the console in the kernel=
 which looks a lot like a hang.<br>
&gt;&gt; &gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt; Warner<br>
&gt;&gt; &gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; . . .<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; Such also happens for stable/13, relen=
g/13.* based installations<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; as well --and likely others too.<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; ACPI booting does not use Device Tree =
information but the messages<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; are output anyway about the lack. Only=
 if you know that the context<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; is a Device Tree style of boot are the=
 messages actually reporting<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; a problem.<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; =3D=3D=3D<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; Mark Millard<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt; marklmi at <a href=3D"http://yahoo.com=
" rel=3D"noreferrer" target=3D"_blank">yahoo.com</a><br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt; &gt;&gt; &gt;&gt;<br>
</blockquote></div></div>

--000000000000b6dfee05f0887747--



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