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

Re: [PATCH] xen/device-tree: Allow exact match for overlapping regions


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Wed, 13 Nov 2024 12:31:21 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ol3n3IPB8oiHzITVz5sjVJWYTXUqdNgKay4oswSQWPs=; b=TaqBjfh0Uor2wK0qcIV5q/6dnmEIQQwFVIDCE8ycnllf+T+CSx4nErIXtCmcOhMfUsP51yxEwPEbztq0Rb1Yy+ayRirTqfAQhBDhvLk9JNf575WUXlQw8csnq6TRsVfsfGOh2W4CEN54q4DrjmNIs+bQ5AuBOIShI/tcLo1MGyNxFjMOsrMKxeDa1k2HHSvP8H5uPssrvIpp3caC7QqsWsBY9yM1DFgICpYeY5Ky+RRHthxEti7ngXJ7077IUBrrwO0RWqpopAX1wj/QWh3bU2ViIOcAN1CTWHimEq5e0QCOa8PX/CIeSmGdxOa4M5uFf+QV7UFIinPPdkeqbO8oVA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HA6cdt432cFgpK/U3ma9oKvolc4UefjTIQojaqr3Mv/urnGC0PJjUlXi1kiNdqPA6bftMhNmEwLykue45R6xKHV7JSrRm8sPd11tuXqx+NAlGfXQU8tHbBH/4iLNkyU/DNZSUCX9KF5m9sqy9eAF3QzdjmNPAZAvZtkzdFFrR/H+R+svGoZOus61n6bHuIWljtnpewMckfYNxPbhS9HDEPOLf+qj/p2H1cm6ciHz/OaPv9WmbBRdQQG61XfTqC6a59FdI+uLgH2tk3noLzO+Azl4zVeqsA6BLyy5enFkp837XLXRXVMx3Dx1OBCsMbH1QUxcVMDEfZW/CEuN+Zejcw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Wed, 13 Nov 2024 10:31:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


Hi All,

On 07.11.24 11:42, Grygorii Strashko wrote:


On 06.11.24 17:16, Luca Fancellu wrote:
Hi Michal,

So we have 2 separate issues. I don't particularly like the concept of 
introducing MEMBANK_NONE
and the changes below look a bit too much for me, given that for boot modules 
we can only have
/memreserve/ matching initrd.

Shawn patch fixes the first issue. AFAICT the second issue can be fixed by 
below simple patch:
diff --git a/xen/common/device-tree/bootfdt.c b/xen/common/device-tree/bootfdt.c
index 927f59c64b0d..d8bd8c44bd35 100644
--- a/xen/common/device-tree/bootfdt.c
+++ b/xen/common/device-tree/bootfdt.c
@@ -586,6 +586,10 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)

     add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);

+    ret = device_tree_for_each_node(fdt, 0, early_scan_node, NULL);
+    if ( ret )
+        panic("Early FDT parsing failed (%d)\n", ret);
+
     nr_rsvd = fdt_num_mem_rsv(fdt);
     if ( nr_rsvd < 0 )
         panic("Parsing FDT memory reserve map failed (%d)\n", nr_rsvd);
@@ -594,10 +598,14 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t 
paddr)
     {
         struct membank *bank;
         paddr_t s, sz;
+        const struct bootmodule *mod = 
boot_module_find_by_kind(BOOTMOD_RAMDISK);

         if ( fdt_get_mem_rsv_paddr(device_tree_flattened, i, &s, &sz) < 0 )
             continue;

+        if ( mod && (mod->start == s) && (mod->size == sz) )
+            continue;

Ok I see, we skip the /memreserve/ entry if it matches the ramdisk, fair enough, I 
don’t have
a strong opinion on how we do that, the important thing is just to unblock the 
users experiencing
this issue.

Don't know if my opinion would matter here, but Luca's patch looks more generic 
and logically solid for me.
While handling only "ramdisk" somewhere in the middle  - looks more like a hack.

Any way, it's up to you.


Sorry, that I'm disturbing you, but is there going to be any conclusion 
regarding this patch?


Best regards,
-Grygorii





 


Rackspace

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