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

RE: [PATCH v2 07/24] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Mon, 8 Jun 2026 04:29:09 +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=H7WXOu4c6g1XYn8ts0jOO/F3hUDL48Mqd3nfgigfKd8=; b=MIS0yaOrQhN3VnEqokZ0Cgvn4k0tlfy76nPHiwJ0dcEW0S69w6+STEBwXOJ2zhPTyOywfmw0NNnHlpYn6wI5OfJusV7DNVUb3AUJD8Wsn7Emx1VTDapt/9blkF+IgarT4EI3DFRU3WZsYLR2rvPnash/ZtovHmtWC5qOEIgaqFQcxLnyGUtZnMSMmhbigvKG5D5OBn7BZ+NMutbIvuOsTwcg4J+z/yPkIDZ/Pp3ReY6YYwMfvuvzji6iUq76/pM2IrmGwKfhVJU4JXBrdiwKVUuEIWPXnDYrEFok2/bvDVIXy1k2XxQoBH4db5vkLkex3n8XcSVV2uncJi9Y7F87mQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uuSuHHg18A+uY04w7O+JwdlBkypS3CGqDqsct7HbqNA272ZVXn+Bd5gm24YXC20JpZUSTbUIDXdMmtAp7WhjXJgLee1d3wrn//YO1toV4GVCHvqcUEgIU+9Ey2sHYVDljG/wNK+6nfvn2G4y8L85NBpbTpiDkRDifbPsoVVjGgM1WU0eNY2W4VPAhKbSkvemGUCspKQF3d69WcgmGB2cXP0Eie0EWmOltNuEq+xlbQJUpXVivzC8hIMDoRUw/6hvnCqyMDrWfAo9Wzd1J2PQKGPsihAi4FZ9RDNHPhW0Uk/sjejsJSYcCLQpBUVxh0YCzTJYddkaMfkH+a/5vTSPwQ==
  • 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: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=valinux.co.jp;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 08 Jun 2026 04:29:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHc8U+PsZhvkHY9vEqKRtt8NHnfGrYrBomAgAF93dCAADBuAIAHZqKQ
  • Thread-topic: [PATCH v2 07/24] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration

Hello,

> >>> +#include <xen/types.h>
> >>> +#include <xen/device_tree.h>
> >>> +
> >>> +struct cpu_topology {
> >>> +    int thread_id;
> >>> +    int core_id;
> >>> +    int cluster_id;
> >>> +    int package_id;
> >>
> >> Can any of these go negative? If not, "unsigned int" please. Iirc I said 
> >> the
> >> same elsewhere on v1. Please apply such comments throughout the series.
> >
> > These members can actually be '-1' to represent a missing entry when
> parsing the Device Tree's
> > 'cpu-map' node.
> 
> Yet that sentinel doesn't need to be -1, does it? Any unsigned value greater 
> or
> equal to NR_CPUS will do, I suppose.

Ok, I will make then unsigned int.

> > Since I imported this directly from Linux kernel 7.0 (specifically from
> include/linux/arch_topology.h
> > and drivers/base/arch_topology.c), I would lean toward keeping them as 'int'
> to minimize
> > any divergence from the original Linux implementation.
> 
> Linux is quite a bit more lax though with use of (appropriate) types.

I agree with you at this point.

Thank you,
Hirokazu Takahashi.

 


Rackspace

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