Fix Xen boot-time cpupools handling
PATCH 1/1 Fix Xen boot-time cpupools handling
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.
---
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(-)
scripts/uboot-script-gen +2 -2
@@ -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
Signature · 1 line
2.25.1
Quoted 7 lines · Michal Orzel
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.
Quoted 5 lines
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 <[email protected]>
Quoted 29 lines
---
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(-)scripts/uboot-script-gen +2
-2@@ -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" doneSignature · 1 line
2.25.1