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

RE: [PATCH v12 1/4] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration


  • To: "Orzel, Michal" <michal.orzel@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Thu, 22 Oct 2026 20:57:21 +0000
  • Accept-language: ja-JP, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=valinux.co.jp; dmarc=pass action=none header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; 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=GcPbvWO3fWCtg+TX/iVPDjxJ6aVeKoWU16tT0g+PwA8=; b=YHgiVxgLvnJG/ot1sJFeayIKOSTAPqMj2lbrq/Iwcoj1li3uc6omRKCJ8OGTguZlQIAaCxW2XI6KK1hssjup/Svj25xrgTyLREVkDoiPzd+gWYb6Wgg1V7jZ5nDar9m62SPowwFgnZ7zGhkBDE6QrGp4BMMwrj7GjNYtN6s53Au4xiQ9Hg7y0fV4a+9RwzH+AtsbO2xXiDfT20/FyRuuAMftkS2ULEM8+6IFCF/04Nsm9qSKiZ4K3x8jnd9UoLWYlVCJLZryDHTkEx9/f/kFkOBAdLL8AdzZAVxzKlDYzf75RuezA+GZtdI0vxohZ7GGrrmztrQYh3dqo23NN5XNrg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gOu++UVcjowZpjqteJTHpWalrnjJjeMEudPjmrnMJBcsoZtKqtTTxhZnCI98PO5H8dz2a0E7M7TIhF4RrYsp9/tECmsP60l15Mgw1uzYV+WdYo4Wyr+la+piUJuVZSzHMcPL/xImdYXje5eyT0PyZDCG4WwXa27FKWmIzJIzQYeOv8GENDaoHqKlOLOrt9ZyiKZaVHLPXXsHo/Ml9QVb8tDCSkPEq/c4FjK8r71UR1tv4/Necr4jxWAgr5wCYBW4juXzfKHHGarrfjVtFf+qzKeqCqJfqUT+wqHmCUGgVpE+W1xF9uCxr8U87vpXtOzXDMeVCoTbo0ydMC7tccogJg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=valinux.co.jp;
  • Cc: "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, "Mykyta_Poturai@xxxxxxxx" <Mykyta_Poturai@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>
  • Delivery-date: Thu, 22 Oct 2026 20:57:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHdX21OrO4+KL2GDkargycw+FU9OrcH2ImAgAIuzCA=
  • Thread-topic: [PATCH v12 1/4] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration

Hi Michal,

> >  xen/common/device-tree/cpu-topology.c | 370 ++++++++++++++++++++++++++
> >  xen/drivers/acpi/Makefile             |   1 +
> >  xen/drivers/acpi/topology.c           |  43 +++
> Shouldn't this file be called cpu-topology like the DT equivalent?

Okay.

> > diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> > index 8c9072f3c1..d34396f9b1 100644
> > --- a/xen/arch/arm/smpboot.c
> > +++ b/xen/arch/arm/smpboot.c
> > @@ -9,10 +9,12 @@
> >
> >  #include <xen/acpi.h>
> >  #include <xen/cpu.h>
> > +#include <xen/cpu-topology.h>
> >  #include <xen/cpumask.h>
> >  #include <xen/delay.h>
> >  #include <xen/device_tree.h>
> >  #include <xen/domain_page.h>
> > +#include <xen/dt-cpu-topology.h>
> Nothing in this file seems to use this header

This header is required because this file uses map_cpu_to_dt_node().
This extern declaration is provided in it.

> > +void __init init_cpu_topology(void)
> > +{
> > +    unsigned int cpu;
> > +    int ret = 0;
> > +
> > +    if ( num_possible_cpus() == 1 )
> > +        return;
> > +
> > +    cpu_topology = xvzalloc_array(struct cpu_topology, nr_cpu_ids);
> > +
> > +    if ( cpu_topology )
> > +    {
> > +        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)
>  )
> > +                ret = -ENOMEM;
> The loop continues allocating after the first error which is incorrect.

You are right. I will fix it.

> > +        }
> > +    }
> > +    else
> > +        ret = -ENOMEM;
> > +
> > +    if ( ret != 0 )
> > +        printk(XENLOG_WARNING "CPU topology table allocation failed\n");
> After printing this one we will also print the "Failed to initialize..." one.
> Please goto the error.

Okay.

> > +    else if ( acpi_disabled )
> > +        ret = dt_init_cpu_topology();
> > +    else
> > +        ret = acpi_init_cpu_topology();
> > +
> > +    /* Free the CPU topology table if initialization fails. */
> > +    if ( ret != 0 )
> In v11 I asked you to print error on real failure, not all the time e.g. on -
> EOPNOTSUPP or ENOENT as a result of not finding cpu-map.

Okay
 
> > +    {
> > +        printk("Failed to initialize cpu topology (error %d)\n", ret);
> XENLOG_ERR/WARNING?

I will fix it.


> > +        if ( !thread )
> > +            break;
> > +
> > +        leaf = false;
> > +        ret = get_cpu_for_node(thread, &cpu);
> > +        if ( ret )
> > +        {
> > +            printk(XENLOG_ERR
> > +                   "%s: No CPU found for thread\n", dt_node_name(thread));
> Use dt_node_full_name(). Otherwise the printed name can be ambiguous.

Okay.

> > +            return ret;
> > +        }
> > +
> > +        if ( cpu == INVALID_TOPO_ID )
> > +        {
> > +            /*
> > +             * Ignore this CPU node definition as the corresponding 
> > physical
> > +             * CPU failed to boot.
> You updated the printk message but not the comment. Please fix.

Okay

 


Rackspace

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