Re: [PATCH V8 00/22] arch: Add basic LoongArch support

From: Arnd Bergmann
Date: Mon Mar 21 2022 - 19:00:51 EST


On Mon, Mar 21, 2022 at 5:59 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Mon, Mar 21, 2022 at 4:09 AM Arnd Bergmann <arnd@xxxxxxxx> wrote:
> >
> > This looks fine to me for the most part [...]
>
> So it looks like this is getting there.. Do we have a way forward for
> this to be merged?
>
> I obviously can take the patches, but it would be even nicer to have a
> pull request, and you'd be the obvious person since you are - whether
> you like it or not - the "odd architecture guy".

I can prepare a pull request when it gets to that, but I think the boot protocol
should be fixed first, and that makes it 5.19 material.

The TL;DR version here is that LoongArch requires the use of ACPI/UEFI
firmware, but does not currently enter the kernel using the UEFI protocol.

Instead, grub gets loaded by the firmware (not sure using which protocol),
and it then loads the kernel from disk, entering it through an ad-hoc
method passing data from grub to the kernel using a combination of
CPU registers and in-memory data structures that are different from
how UEFI passes the same information using the drivers/firmware/efi
stub entry.

We have already discussed that this will be replaced with a regular
UEFI entry using the same code that x86 and arm64 have, but at the
moment, neither the specification nor the code is there.

Merging the current version and changing it to the standard boot
protocol later would mean they'd have to keep both protocols in
the kernel, which adds complexity.

Arnd