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

[ImageBuilder][PATCH] Fix Xen boot-time cpupools handling


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 26 Jan 2024 13:51:28 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=H4Rpw5pncYCvunyAOoAL6/OC9jz6oJupOd8JCuf5T4E=; b=asQfjimoHxoBRbzb0OvjG1aJuKvdQ9Gmz8mUz5tq9nTx/B13YVfcNCWej+mDEZfCFTn0cZyW6HdIogabD8ck5yCcHfCnBh+vn1tqNeqvMoBR0SCML7vpRcxM7wL4KdFJLTjm5hJFcOhFfNp0eSw9pRMgYTdoicY9cwGdgD49ax/CFT3p8lZ7ESnMaLSInvy6lJ9iJemIGxrQ+3SFlu9lOA2Lk4AHU26q0YSttcWxS0J5QV7vfHh5QDwdYunfTzCWwZper9UeuvzUA3LkKg07nzsQ1UZQoFJTAgB/lC7IbF7RoMfy+lcxFDaWiDetdfkGmqCTJkRG2eyN8pJqJkzksQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j4Uiw/2wIjm/v2AeZGvAynD468jTvKytnXUjbYqWmIFOGMMgMHUso1FOaCxuGZ6MHR1+3kd9+/19dcdfW58V+qyxh+ajUlh8KgLPVepJFh3Fz00Gsu8dvXtL5BymYNaqFHVBMuBQApiXkNJyvekvpcp7/Vf9UHzogA6Fc52NNacfpsDRYZXjfqS7yqfRw5VfV6txWUuCs8MhkudVnHpW9S4dy+0nUCjLh8V/ZjxD4usHDH94uo3wAd78JJVLQT89KnHN4FYbUxalBNq6+cFYUQTFJ7hcuZo8YlyQHvENxzNg07nRltU51fFBo31nDj9K4ArcZDmpu7ApwdmU0aGu1Q==
  • Cc: <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Fri, 26 Jan 2024 12:51:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

When retrieving a phandle for a CPU node using "fdtget -t x", the
resulting hex number (in case the phandle exists) lacks the '0x' prefix.
This value is subsequently used to construct the cpupool-cpus property.
This results in an incorrect property generation that leads to Xen
failure (example: cpupool-cpus < a> instead of < 0xa>). Address the
issue by adding 0x prefix to the result from fdtget.

Additionally, avoid unnecessary regeneration of the phandle if it already
exists.

Fixes: b687773b5046 ("Add support for Xen boot-time cpupools")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
This only worked if phandle did not exist or if its value did not contain a-f
and was regenerated anyway.
---
 scripts/uboot-script-gen | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 078a667c61ab..3cc6b47c7c62 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -262,12 +262,12 @@ function add_device_tree_cpupools()
             fi
 
             # set phandle for a cpu if there is none
-            if ! phandle=$(fdtget -t x "${DEVICE_TREE}" "$cpu" "phandle" 2> 
/dev/null)
+            if ! phandle="0x$(fdtget -t x "${DEVICE_TREE}" "$cpu" "phandle" 2> 
/dev/null)"
             then
                 get_next_phandle phandle
+                dt_set "$cpu" "phandle" "hex" "$phandle"
             fi
 
-            dt_set "$cpu" "phandle" "hex" "$phandle"
             cpu_phandles="$cpu_phandles $phandle"
             cpu_list="$cpu_list $cpu"
         done
-- 
2.25.1




 


Rackspace

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