2023-04-28 18:16:51

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [External] Re: [PATCH] firmware: added a firmware information passing method FFI

On Fri, 28 Apr 2023 at 17:09, ron minnich <[email protected]> wrote:
>
> There is lots of text in the preceding notes :-), which is nice because we're clearly looking at something that matters!
>
> But, note, ARM Chromebooks run Linux, and I checked with the firmware team just now:
> "Right. We're not using UEFI or ACPI or SMBIOS or DMI or any of that on Arm. Just the Device Tree."
>
> So I do not agree that we need UEFI tables due to some presumed semantics that they implement, because: several tens of millions of ARM chromebooks running Linux show otherwise.
>
> We've got a chance here to move to self describing data, and I think we need to take it. It will be a long time before we get this chance again.
>

I'm not sure what you mean by self-describing: device tree is
definitely not self-describing, and we maintain a huge collection of
DT bindings (which are documented in separate YAML files) in the
kernel tree that specify in detail how a device tree must be
constructed in order to comply with the device tree based boot
protocol.

However, introducing such a binding for SMBIOS is perfectly
reasonable, although I would suggest that we don't copy the
SMBIOS/SMBIOS3 entry point address into the device tree (as this patch
does), but properly describe the memory region that contains the
actual SMBIOS structured data directly, along with its version. This
might be reused by other DT based platforms as well.

Doing the same for ACPI is where we'll get into trouble, given that
we'd end up with two conflicting hardware descriptions and unfulfilled
dependencies on EFI specific data structures, and it is not the
kernel's job to reason about which h/w description should take
precedence, or to make guesses about memory types. So I fully agree
with Ron that moving to device tree is a much better choice here -
that way, you can avoid ACPI and UEFI altogether




> On Thu, Apr 27, 2023 at 8:18 PM 运辉崔 <[email protected]> wrote:
>>
>> Hi Ard, Mark,
>>
>> On Thu, Apr 27, 2023 at 8:52 PM Ard Biesheuvel <[email protected]> wrote:
>>
>> > and the only combination we do not support is ACPI without EFI, as
>> > ACPI on arm64 depends on the EFI memory map.
>> >
>> > What this patch seems to be proposing is a combination of all of
>> > these, i.e., doing a pseudo-EFI direct kernel boot where the EFI
>> > dependencies of ACPI are being fulfilled by ad-hoc descriptions passed
>> > in via DT.
>> >
>> > I am concerned that this will result in a maintenance burden for Linux
>> > with very little gain, so I feel we should not go down this road.
>>
>> Judging from the current kernel, getting acpi smbios, memmap tables is
>> not just a way to have EFI, right?
>> smbios:SMBIOS_ENTRY_POINT_SCAN_START
>> acpi:CONFIG_ACPI_LEGACY_TABLES_LOOKUP
>> memmap: e820
>>
>> Our current situation is that coreboot does not support EFI, but supports fdt,
>> but we need to support ACPI, and riscv does not have a reserved
>> address segment
>> like x86 that can be used, so our current solution is to pass acpi and
>> other tables through fdt.
>>
>> Based on this, do you have a better suggestion ?
>>
>> Thanks,
>> Yunhui


2023-05-04 12:19:28

by yunhui cui

[permalink] [raw]
Subject: Re: [External] Re: [PATCH] firmware: added a firmware information passing method FFI

Hi Ron, Ard

On Sat, Apr 29, 2023 at 2:03 AM Ard Biesheuvel <[email protected]> wrote:
>
> On Fri, 28 Apr 2023 at 17:09, ron minnich <[email protected]> wrote:
> >
> > There is lots of text in the preceding notes :-), which is nice because we're clearly looking at something that matters!
> >
> > But, note, ARM Chromebooks run Linux, and I checked with the firmware team just now:
> > "Right. We're not using UEFI or ACPI or SMBIOS or DMI or any of that on Arm. Just the Device Tree."
> >
> > So I do not agree that we need UEFI tables due to some presumed semantics that they implement, because: several tens of millions of ARM chromebooks running Linux show otherwise.
> >
> > We've got a chance here to move to self describing data, and I think we need to take it. It will be a long time before we get this chance again.
> >

> However, introducing such a binding for SMBIOS is perfectly
> reasonable, although I would suggest that we don't copy the
> SMBIOS/SMBIOS3 entry point address into the device tree (as this patch
> does), but properly describe the memory region that contains the
> actual SMBIOS structured data directly, along with its version. This
> might be reused by other DT based platforms as well.

Could you help to give me an example to add smbios in the memmap
region description?

Even after adding to the memmap region, it needs to be connected to
the current dmi_scan_machine()?
Or add another dmi code under the fdt framework?


> Doing the same for ACPI is where we'll get into trouble, given that
> we'd end up with two conflicting hardware descriptions and unfulfilled
> dependencies on EFI specific data structures, and it is not the
> kernel's job to reason about which h/w description should take
> precedence, or to make guesses about memory types. So I fully agree
> with Ron that moving to device tree is a much better choice here -
> that way, you can avoid ACPI and UEFI altogether

Thanks for your suggestions, I don't quite get what needs to be moved
to dts? Could you explain in detail?
Is it to realize the content of acpi based on the dts framework?

Thanks,
Yunhui

2023-05-04 13:45:46

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [External] Re: [PATCH] firmware: added a firmware information passing method FFI

On Thu, 4 May 2023 at 14:06, 运辉崔 <[email protected]> wrote:
>
> Hi Ron, Ard
>
> On Sat, Apr 29, 2023 at 2:03 AM Ard Biesheuvel <[email protected]> wrote:
> >
> > On Fri, 28 Apr 2023 at 17:09, ron minnich <[email protected]> wrote:
> > >
> > > There is lots of text in the preceding notes :-), which is nice because we're clearly looking at something that matters!
> > >
> > > But, note, ARM Chromebooks run Linux, and I checked with the firmware team just now:
> > > "Right. We're not using UEFI or ACPI or SMBIOS or DMI or any of that on Arm. Just the Device Tree."
> > >
> > > So I do not agree that we need UEFI tables due to some presumed semantics that they implement, because: several tens of millions of ARM chromebooks running Linux show otherwise.
> > >
> > > We've got a chance here to move to self describing data, and I think we need to take it. It will be a long time before we get this chance again.
> > >
>
> > However, introducing such a binding for SMBIOS is perfectly
> > reasonable, although I would suggest that we don't copy the
> > SMBIOS/SMBIOS3 entry point address into the device tree (as this patch
> > does), but properly describe the memory region that contains the
> > actual SMBIOS structured data directly, along with its version. This
> > might be reused by other DT based platforms as well.
>
> Could you help to give me an example to add smbios in the memmap
> region description?
>

I'm not a DT expert, better to ask the maintainers for guidance.

> Even after adding to the memmap region, it needs to be connected to
> the current dmi_scan_machine()?
> Or add another dmi code under the fdt framework?
>

Yes. This should be generic code that permits any DT platform to
expose SMBIOS data without relying on EFI. So I would imagine that the
support code will live somewhere under drivers/of/ perhaps?

>
> > Doing the same for ACPI is where we'll get into trouble, given that
> > we'd end up with two conflicting hardware descriptions and unfulfilled
> > dependencies on EFI specific data structures, and it is not the
> > kernel's job to reason about which h/w description should take
> > precedence, or to make guesses about memory types. So I fully agree
> > with Ron that moving to device tree is a much better choice here -
> > that way, you can avoid ACPI and UEFI altogether
>
> Thanks for your suggestions, I don't quite get what needs to be moved
> to dts? Could you explain in detail?
> Is it to realize the content of acpi based on the dts framework?
>

Yes. You will have to duplicate the platform topology description,
including CPU's, interrupt controllers, PCI host bridges and all other
non-discoverable peripherals. You will lose some functionality
regarding hotplugging and RAS, because DT does not support that, but
otherwise, it should be quite feasible to replace ACPI entirely.

But Ron is the expert here on replacing vendor provided firmware with
open(er) source alternatives, so perhaps he has some ideas on how to
bridge this gap?