lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250105172741.3476758-1-dmaluka@chromium.org>
Date: Sun,  5 Jan 2025 17:27:39 +0000
From: Dmytro Maluka <dmaluka@...omium.org>
To: Thomas Gleixner <tglx@...utronix.de>,
	Rob Herring <robh@...nel.org>
Cc: Ingo Molnar <mingo@...hat.com>,
	Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	x86@...nel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	"H. Peter Anvin" <hpa@...or.com>,
	Saravana Kannan <saravanak@...gle.com>,
	Saurabh Sengar <ssengar@...ux.microsoft.com>,
	Usama Arif <usamaarif642@...il.com>,
	Stephen Boyd <sboyd@...nel.org>,
	Frank Rowand <frowand.list@...il.com>,
	linux-kernel@...r.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
	devicetree@...r.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE),
	Pierre-Clément Tosi <ptosi@...gle.com>,
	Shikha Panwar <shikhapanwar@...gle.com>,
	Will Deacon <will@...nel.org>,
	Keir Fraser <keirf@...gle.com>,
	Michal Mazurek <mazurekm@...gle.com>,
	Bartłomiej Grzesik <bgrzesik@...gle.com>,
	Tomasz Nowicki <tnowicki@...gle.com>,
	Grzegorz Jaszczyk <jaszczyk@...gle.com>,
	Dmytro Maluka <dmaluka@...omium.org>
Subject: [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(-)

-- 
2.47.1.613.gc27f4b7a9f-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ