[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 3/7] xen/common: Move Arm's bootfdt to common



Hi Jan,

On 19/12/2023 17:03, Jan Beulich wrote:
On 15.12.2023 03:43, Shawn Anastasio wrote:
Move Arm's bootfdt.c to xen/common so that it can be used by other
device tree architectures like PPC and RISCV. Only a minor change to
conditionalize a call to a function only available on EFI-supporting
targets was made to the code itself.

Suggested-by: Julien Grall <julien@xxxxxxx>
Signed-off-by: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
---
  xen/arch/arm/Makefile                          |  1 -
  xen/common/Makefile                            |  1 +
  xen/common/device-tree/Makefile                |  1 +
  xen/{arch/arm => common/device-tree}/bootfdt.c | 15 +++++++++------
  4 files changed, 11 insertions(+), 7 deletions(-)
  create mode 100644 xen/common/device-tree/Makefile
  rename xen/{arch/arm => common/device-tree}/bootfdt.c (98%)

I think this wants to come with an update to ./MAINTAINERS, such that
the file doesn't change maintainership.

--- a/xen/arch/arm/bootfdt.c
+++ b/xen/common/device-tree/bootfdt.c
@@ -431,12 +431,15 @@ static int __init early_scan_node(const void *fdt,
  {
      int rc = 0;
- /*
-     * If Xen has been booted via UEFI, the memory banks are
-     * populated. So we should skip the parsing.
-     */
-    if ( !efi_enabled(EFI_BOOT) &&
-         device_tree_node_matches(fdt, node, "memory") )
+    if ( device_tree_node_matches(fdt, node, "memory") )
+#if defined(CONFIG_ARM_EFI)
+        /*
+         * If Xen has been booted via UEFI, the memory banks are
+         * populated. So we should skip the parsing.
+         */
+        if ( efi_enabled(EFI_BOOT) )
+            return rc;
+#endif

I'm not a DT maintainer, but I don't like this kind of #ifdef, the more
that maybe PPC and quite likely RISC-V are likely to also want to support
EFI boot. But of course there may be something inherently Arm-specific
here that I'm unaware of.

Right now, I can't think how this is Arm specific. If you are using UEFI, then you are expected to use the UEFI memory map rather than the content of the device-tree.

However, we don't have a CONFIG_EFI option. It would be nice to introduce one but I am not sure I would introduce it just for this #ifdef.

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.