[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>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Wed, 6 Nov 2024 16:19:14 +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=z1dAccebykuxnKhJ6CqD4TxswwzD4ENLzUsm4zKB5B8=; b=pZ/tPlTV7zohdvIqbilo276mYk+4bQQ5iRhMA+gbzr8Efv0UNpxyGT7qf4gEgKHpe8dA7tLVPlEFGl2BiuLUYX6amzc/BTL7Do9xoWrNamkdnbRQc5QxXbfFWoYD0467KqgM8s2GCGeIVgOM9GgwMmONTKoakWfgPozpZyG0m/28seVewG5fGnYkjIDSJep7SGJllOXK4FdJUl8zVOFNE3d5X5IMfuY7kMXFssFRJifpKfck3MWYVlMHohwVzrE3b/kFEhWWooUtWiSD55aClrT9N5jn1HV5PlV/YydYMERX/YF2chX7PTPgxpcAOVvtkrzMEz4FxUBTaVZU4tUYng==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NvtisC0etbqMc0SzSafOdUqEECau8i0jo1KxUEnf0NaD2Us40y7Uh6JzmpzK0aAQi60RsPM99EPQETR5tc0nGwYGOtTYfT2Ekr42TEfi1uPkJ5Tots4IqiYAuw38jIVH55bRGsQhrVM4Zk2HUVh4PvHn/3Qd2ZXAnKV5wj10JasNwqk9LXeakGntC57lUkCMn2NR9SrIPBc8Z0z0Q5D74E/Ong4leGbQcc+H3l9wRKY0Z5llf9MiO+T7m/8NlKM6LDmbiQFQ8/xmyM+xUHAygpOEZpJ/KGl35MLDGPvlR0hKN0AYDvTtGR4Uqmc3POtZ+WzB04V0sUG8ezN7LtZYcg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 06 Nov 2024 14:19:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 06.11.24 15:41, Luca Fancellu wrote:
There are some cases where the device tree exposes a memory range
in both /memreserve/ and reserved-memory node, in this case the
current code will stop Xen to boot since it will find that the
latter range is clashing with the already recorded /memreserve/
ranges.

Furthermore, u-boot lists boot modules ranges, such as ramdisk,
in the /memreserve/ part and even in this case this will prevent
Xen to boot since it will see that the module memory range that
it is going to add in 'add_boot_module' clashes with a /memreserve/
range.

When Xen populate the data structure that tracks the memory ranges,
it also adds a memory type described in 'enum membank_type', so
in order to fix this behavior, allow the 'check_reserved_regions_overlap'
function to check for exact memory range match given a specific memory
type; allowing reserved-memory node ranges and boot modules to have an
exact match with ranges from /memreserve/.

While there, set a type for the memory recorded during ACPI boot.

Fixes: 53dc37829c31 ("xen/arm: Add DT reserve map regions to 
bootinfo.reserved_mem")
Reported-by: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
Reported-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
---
I tested this patch adding the same range in a /memreserve/ entry and
/reserved-memory node, and by letting u-boot pass a ramdisk.
I've also tested that a configuration running static shared memory still works
fine.

[...]

Thank you, Dom0 started successfully with Initrd.

Tested-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

Meminfo from boot log is below:

(XEN) Checking for initrd in /chosen
(XEN) Initrd 0000000084000040-00000000860864fd
(XEN) RAM: 0000000048000000 - 00000000bfffffff
(XEN) RAM: 0000000480000000 - 00000004ffffffff
(XEN) RAM: 0000000600000000 - 00000006ffffffff
(XEN)
(XEN) MODULE[0]: 0000000048080000 - 00000000481ec000 Xen
(XEN) MODULE[1]: 0000000048000000 - 000000004801e080 Device Tree
(XEN) MODULE[2]: 0000000084000040 - 00000000860864fd Ramdisk
(XEN) MODULE[3]: 0000000048300000 - 000000004a300000 Kernel
(XEN) MODULE[4]: 0000000048070000 - 0000000048080000 XSM
(XEN)  RESVD[0]: 0000000084000040 - 00000000860864fc
(XEN)  RESVD[1]: 0000000060000000 - 000000007fffffff
(XEN)  RESVD[2]: 00000000b0000000 - 00000000bfffffff
(XEN)  RESVD[3]: 00000000a0000000 - 00000000afffffff
...

BR,
-grygorii





 


Rackspace

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