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

Re: [Xen-devel] [RFC PATCH v1 05/21] ARM: efi: Do not delete memory node from fdt



Hello Vijay,

On 09/02/17 15:56, vijay.kilari@xxxxxxxxx wrote:
From: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxx>

When booting in UEFI mode, UEFI passes memory information
to Dom0 using EFI memory descriptor table and deletes the
memory nodes from the host DT. However to fetch the memory
numa node id, memory DT node should not be deleted by EFI stub.

With this patch, do not delete memory node from FDT.
This memory nodes are later used by XEN to extract numa
node id information.

Also, parse memory node only if bootmeminfo is NULL.

Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxx>
---
 xen/arch/arm/bootfdt.c      |  9 +++++++--
 xen/arch/arm/efi/efi-boot.h | 25 -------------------------
 2 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index cae6f83..979f675 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -285,8 +285,13 @@ static int __init early_scan_node(const void *fdt,
                                   u32 address_cells, u32 size_cells,
                                   void *data)
 {
-    if ( device_tree_node_matches(fdt, node, "memory") )
-        process_memory_node(fdt, node, name, address_cells, size_cells);
+    /*
+     * Parse memory node only if bootinfo.mem is empty.
+     */
+    if ( bootinfo.mem.nr_banks == 0 ) {

I would prefer if we use efi_enabled(EFI_BOOT) instead. This will catch any potential bug when booted without EFI.

+        if ( device_tree_node_matches(fdt, node, "memory") )
+            process_memory_node(fdt, node, name, address_cells, size_cells);
+    }
     else if ( device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) 
||
               device_tree_node_compatible(fdt, node, "multiboot,module" ))
         process_multiboot_node(fdt, node, name, address_cells, size_cells);

Regards,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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