Skip to content

of, x86: Restore possibility to use both ACPI and FDT from bootloader

Dmytro Maluka linux-devicetree lkml 2 versions Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied
  2. v12 patches 1 replySuperseded

Changes in v2 from the cover letter

Split the patch into two, to separate the x86 part from the common part.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2x86/of: Don't use DTB for SMP setup if ACPI is enabledarch/x86/kernel/devicetree.c+2 -10 replies
2/2of/fdt: Restore possibility to use both ACPI and FDT from bootloaderdrivers/of/fdt.c+1 -91 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] of, x86: Restore possibility to use both ACPI and FDT from bootloader

There are cases when the bootloader provides information to the kernel in both ACPI and DTB, not interchangeably. One such use case is virtual machines in Android. When running on x86, the Android Virtualization Framework (AVF) boots VMs with ACPI like it is usually done on x86 (i.e. the virtual LAPIC, IOAPIC, HPET, PCI MMCONFIG etc are described in ACPI) but also passes various AVF-specific boot parameters in DTB. This allows reusing the same implementations of various AVF components on both arm64 and x86. (Note that on arm64 AVF uses DT only, no ACPI.)

Commit 7b937cc243e5 ("of: Create of_root if no dtb provided by firmware") removed the possibility to do that, since among other things it introduced forcing emptying the bootloader-provided DTB if ACPI is enabled (probably assuming that if ACPI is available, a DTB can only be useful for applying overlays to it afterwards, for testing purposes).

So restore this possibility. At the same time, since on x86 the aforementioned recently introduced restriction is actually useful for preventing conflicts between ACPI and DT for LAPIC/IOAPIC/HPET setup, don't remove this restriction completely but relax it: unflatten the bootloader supplied DTB but don't try to use it for SMP setup.

Note that on arm64 currently ACPI and DT are not used together in any case (setup_arch() enforces that), and this series doesn't change that.

v1 -> v2:
Split the patch into two, to separate the x86 part from the common part.

Dmytro Maluka (2):
x86/of: Don't use DTB for SMP setup if ACPI is enabled of/fdt: Restore possibility to use both ACPI and FDT from bootloader

 arch/x86/kernel/devicetree.c |  3 ++-
 drivers/of/fdt.c             | 10 +---------
 2 files changed, 3 insertions(+), 10 deletions(-)
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog