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

Re: [XEN][PATCH] common/libfdt: optimize usage


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Tue, 18 Nov 2025 21:43:33 +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=bd4ODv427YJtT60WZI6Ty3rkCnD2W7OaWuKCYaDTL9U=; b=XJaM1GcbfLXY+xQ8EwBiEYHnKpyZ7NY3Zsn5JSip4FH42S960iaw9FgtwF6/ByZp0zWIjj9v/qNK0BVlT90Fnnm1gh7itmU2NgvSaXB8F4glI4cdYnDB0n2fgihkt8BnR3YjSUa1C+z4uZRPWkAemTtVRqALJt/T/6o7kex0cJ32jbsWrodf9fNj01rwnJJ871p8KjwmjaUHPwJHxc1syiKT9+6SSeMQcgXYuYeHy4i3yTo9Pvpj0JLiTx189YCncPFeobLA4t8IuUK6c1OU1mGB65K+e5qtNeXFTdqZSWYbLt4kSM8W+in37zDbGpCLDFZW/BDwPnZW4pAHka6LFQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ArVzEj+sceqFNO5IOtyk8o4elg9g4cvZnYjKlqwn0TV6QhAGdnNSiAhAHouAPuhsKKabHeq/aGrKwbtSM5DWGm9SXGyqNj5XZ0ZVml/giGH1+Lad9Ek8lXyLisPAXVKrQCv4A8NDGsPomc+oMxa7w20npSqPkrL3tTr5MLAeweSDxtQCp4jFP7pJzEgDWB61ex+14uFqGuJube7QF1VPDvc2IjGu+Xfb/DZog1T0TFk8M3TM1idZQ2vJOySMBhx70AYBSEIJ3d2k/+gZQS8qmk3MYUg+VciU99SM6i/jg1K3EWAVSq2ktXUn3rVsao4j1RPrbW93p+3r6Kj5aoM8zw==
  • 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>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 18 Nov 2025 19:43:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 17.11.25 11:31, Jan Beulich wrote:
On 14.11.2025 19:01, Grygorii Strashko wrote:
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

Now all libfdt features are built-it unconditionally, but...

X86: The libfdt is used on x86 only to parse Hyperlaunch/dom0less Xen
nodes, so full libfdt is not needed in this case and minimal, RO
configuration can be used.

ARM - situation is more complicated:
1) ARM reads Host DT (fdt.c RO)
2) ARM reads passthrough DT (RO)
3) ARM generates dom0/hwdom DT from Host DT (there is a mix of WIP and SW APIs)
4) ARM generates domU DT (there is a mix of WIP and SW APIs)
4) With EFI enabled - ARM needs RW API and fdt_empty_tree
5) With CONFIG_OVERLAY_DTB - ARM needs RW and fdt_overlay API

This goes too far, imo.

--- /dev/null
+++ b/xen/common/libfdt/Kconfig
@@ -0,0 +1,14 @@
+config LIBFDT_WIP

"Write-in-place"
- update property in place
- NOP the property or node
(no resize)

+       bool
+
+config LIBFDT_SW

"Sequential-write"
Used to create DT in a buffer sequentially in one pass
fdt_create
 fdt_begin_node
  fdt_property
  ...
 fdt_end_node
...
fdt_finish

+    bool
+
+config LIBFDT_RW

"Full read-write"
- add/del/change nodes or properties in fdt blob
- no automatic resize

+    bool
+
+config LIBFDT_EMPTY_TREE

Enables fdt_create_empty_tree() helper

+    bool
+
+config LIBFDT_OVERLAY

Enables DT overlay helpers (deps: RW, WIP)

+    bool

Nit: Inconsistent indentation.

Also, how would one be to guess which of these may need selecting? What do
"WIP", "SW", and "RW" stand for? What exactly would "empty tree" mean? Yes,
you follow what the files are named under libfdt/, but that naming is
overly cryptic, too. The comments at the top of these files also don't
say anything helpful.

Indeed.

--
Best regards,
-grygorii




 


Rackspace

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