|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v11 1/4] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
On 13.10.2026 12:36, Hirokazu Takahashi wrote:
> Parse the 'cpu-map' node in the Device Tree to extract CPU topology
> information. If the 'cpu-map' node is absent, simply ignore it.
>
> Signed-off-by: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> # common, acpi
Imo this should have been dropped, when the covered code ...
> ---
> Changes in v11:
> - When parsing the Device Tree, ignore CPU nodes if the corresponding
> physical CPU failed to boot, rather than treating it as an error.
> - Drop the dependency on UNSUPPORTED for CPU topology support.
> - Print an error message if memory allocation fails in init_cpu_topology().
... was touched at least for this change. Specifically ...
> --- /dev/null
> +++ b/xen/common/cpu-topology.c
> @@ -0,0 +1,69 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#include <xen/acpi.h>
> +#include <xen/cpu-topology.h>
> +#include <xen/cpumask.h>
> +#include <xen/dt-cpu-topology.h>
> +#include <xen/init.h>
> +#include <xen/xvmalloc.h>
> +
> +static void __init free_topology_table(void)
> +{
> + unsigned int cpu;
> +
> + for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
> + {
> + free_cpumask_var(cpu_topology[cpu].thread_sibling);
> + free_cpumask_var(cpu_topology[cpu].core_sibling);
> + free_cpumask_var(cpu_topology[cpu].cluster_sibling);
> + }
> +
> + XVFREE(cpu_topology);
> +}
> +
> +void __init init_cpu_topology(void)
> +{
> + unsigned int cpu;
> + int ret;
> +
> + if ( num_possible_cpus() == 1 )
> + return;
> +
> + cpu_topology = xvzalloc_array(struct cpu_topology, nr_cpu_ids);
> + if ( !cpu_topology )
> + {
> + printk(XENLOG_WARNING "CPU topology table allocation failed.\n");
... for one, nit: No full stops please in log messages. And then, how can
a reader of the log tell this message from ...
> + return;
> + }
> +
> + for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
> + {
> + if ( !zalloc_cpumask_var(&cpu_topology[cpu].thread_sibling) ||
> + !zalloc_cpumask_var(&cpu_topology[cpu].core_sibling) ||
> + !zalloc_cpumask_var(&cpu_topology[cpu].cluster_sibling) )
> + {
> + free_topology_table();
> + printk(XENLOG_WARNING "CPU topology table allocation failed.\n");
... this one? Or if the message is meant to be the same, perhaps you want
to fold both printk()s (likely by way of using goto)?
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |