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

RE: [XEN RFC PATCH 22/40] xen/arm: introduce a helper to parse device tree processor node


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Fri, 27 Aug 2021 09:31:35 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • 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-SenderADCheck; bh=Sv9ag1hS+yBaf9fPu0LBg///Aaco6MlTmDq/11RA2Mk=; b=i3ZrAfdwdrVVIXqVtqmHM8WA5gndbq2/0bfFBJZiF9jk2I42vF3/CV51Mr/3DikdXZ716keU3neZ0P9ueDXo4pwKTfydCZBB/Cg65KYQrjNvOP7a5/rpkgqA+ao3r77yLhN9S4A5xTXdj4VTh59VVIv2X95fTNqXLbmPkzQAJknnqdZncdT0wrOtShU60dnf5gaDH+8Hrlz7JACZBBmpase6UijqGCHXpK2YWl6dsFTN0Gxd4Orp79Nym+CgAqIMzgsTTFH6McWRX9jOwmXGlfppHAay7w5ODWkqUcgPqyNhNGlov7lPWF66BqKeGcbxzclhi7vCY1kmHo64AkljlQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Du4XMac0rmjwon5BxSfTHkHwBOc+CFXKQlXw/fX7LWb0vJMKtVRn6TZ3jKmQkqSenRH61XPp6QjvmPkoKPo6LASxNQuQFksGr1MsdlLl4fjQegAtgzhN7Yc7t7D+7g/mAcDyhEX4qhVmBKtbdHnH0NfR88WuA+igcLpMsqcieufzcpda0YJTUb7RCzzH/yzNwjO6xV5CGJE1umbI94a2n0iBl6tpUukLN8wtwhXlgY2zq3Bat8Dp8pOc3+ZK27OcpU/0YtWDvbC3Dzi3KUJlr5YQBRqQBBURDwmqNMer2UGF5CGDyfriOej8eiR5j6GL2T5zNpEP40w2bUtBG9lycw==
  • Authentication-results-original: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Fri, 27 Aug 2021 09:31:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXjps9W9pBfq916EKAfG5ObJRyjauGkX+AgACdvkA=
  • Thread-topic: [XEN RFC PATCH 22/40] xen/arm: introduce a helper to parse device tree processor node

Hi Stefano,

> -----Original Message-----
> From: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Sent: 2021年8月27日 8:06
> To: Wei Chen <Wei.Chen@xxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; sstabellini@xxxxxxxxxx; julien@xxxxxxx;
> jbeulich@xxxxxxxx; Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
> Subject: Re: [XEN RFC PATCH 22/40] xen/arm: introduce a helper to parse
> device tree processor node
> 
> On Wed, 11 Aug 2021, Wei Chen wrote:
> > Processor NUMA ID information is stored in device tree's processor
> > node as "numa-node-id". We need a new helper to parse this ID from
> > processor node. If we get this ID from processor node, this ID's
> > validity still need to be checked. Once we got a invalid NUMA ID
> > from any processor node, the device tree will be marked as NUMA
> > information invalid.
> >
> > Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> > ---
> >  xen/arch/arm/numa_device_tree.c | 41 +++++++++++++++++++++++++++++++--
> >  1 file changed, 39 insertions(+), 2 deletions(-)
> >
> > diff --git a/xen/arch/arm/numa_device_tree.c
> b/xen/arch/arm/numa_device_tree.c
> > index 1c74ad135d..37cc56acf3 100644
> > --- a/xen/arch/arm/numa_device_tree.c
> > +++ b/xen/arch/arm/numa_device_tree.c
> > @@ -20,16 +20,53 @@
> >  #include <xen/init.h>
> >  #include <xen/nodemask.h>
> >  #include <xen/numa.h>
> > +#include <xen/device_tree.h>
> > +#include <asm/setup.h>
> >
> >  s8 device_tree_numa = 0;
> > +static nodemask_t processor_nodes_parsed __initdata;
> >
> > -int srat_disabled(void)
> > +static int srat_disabled(void)
> >  {
> >      return numa_off || device_tree_numa < 0;
> >  }
> >
> > -void __init bad_srat(void)
> > +static __init void bad_srat(void)
> >  {
> >      printk(KERN_ERR "DT: NUMA information is not used.\n");
> >      device_tree_numa = -1;
> >  }
> > +
> > +/* Callback for device tree processor affinity */
> > +static int __init dtb_numa_processor_affinity_init(nodeid_t node)
> > +{
> > +    if ( srat_disabled() )
> > +        return -EINVAL;
> > +    else if ( node == NUMA_NO_NODE || node >= MAX_NUMNODES ) {
> > +           bad_srat();
> > +           return -EINVAL;
> > +   }
> > +
> > +    node_set(node, processor_nodes_parsed);
> > +
> > +    device_tree_numa = 1;
> > +    printk(KERN_INFO "DT: NUMA node %u processor parsed\n", node);
> > +
> > +    return 0;
> > +}
> > +
> > +/* Parse CPU NUMA node info */
> > +int __init device_tree_parse_numa_cpu_node(const void *fdt, int node)
> > +{
> > +    uint32_t nid;
> > +
> > +    nid = device_tree_get_u32(fdt, node, "numa-node-id", MAX_NUMNODES);
> > +    printk(XENLOG_WARNING "CPU on NUMA node:%u\n", nid);
> 
> Given that this is not actually a warning (is it?) then I would move it
> to XENLOG_INFO
> 
> 


OK

> > +    if ( nid >= MAX_NUMNODES )
> > +    {
> > +        printk(XENLOG_WARNING "Node id %u exceeds maximum value\n",
> nid);
> 
> This could be XENLOG_ERR
> 

OK

> 
> > +        return -EINVAL;
> > +    }
> > +
> > +    return dtb_numa_processor_affinity_init(nid);
> > +}


 


Rackspace

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