Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2955645yba; Mon, 6 May 2019 14:30:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxke7KYwj1/V8eBnzvfGSFsaYI+1c+ADAbxGm1vokX2TECeq/fv84HHxeXriT8+K/60xXKW X-Received: by 2002:a65:5687:: with SMTP id v7mr35084677pgs.299.1557178256820; Mon, 06 May 2019 14:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557178256; cv=none; d=google.com; s=arc-20160816; b=Lr71HQlutlAHxCNcA98XsfJYbVf5UKpctlDuyTYa1smhxPoBmugOLexnw+3CL75m2z z/6vytDRXJMGG4asyiSGDf6HlT6oUXns29qeXQ5h8kwkgp6F8ul/N1/LpV2uigANkdc6 kD1Dnsvgxng3C5tURyJ7iVoJpFYodgA3ot61kP+SbQ0BA5pJaWuv+auC3ka116ApZEBp AhjH+U4+6UfnCbrax6B/g14S0pUASsH3VBLU5a31aQ2M8Sa8kC52Q32RomfEe4RC0K7k oUOtGpYf7bv5wgRU8gsrCIn59Vt7G5lT6YdcT9MmZ1TUFj/wJ3CvgLQqIuOhDqXqo8RF RjCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=BK2WmqeIaTnF7dVEhLC6AktVLWES0Us9v9VW0JdEI+Q=; b=Xh+j5GpMYl+GHJpW11keHgx5bC8tQDNvehe4anuAIR4fca5cvJuhYA60OvpyPBxeyt sB9A7pTp2l1hyVBWo/Od6+mDgUVarXlNbQFPCaV6KLekZ2e8DPCsbioi78CG6upkD6yF iZS+i5l2CXCdLm7Y9pLx8FBljQdTCc0EuDNn0xp+DGH5gFk1HrOU1ERippzhFYEJ6T39 tJFtirXV/S1+r2TVEup52o5l720XLTwwf7Juo4pC2ii2F/0M/Hp8mgXtCv5plkhZOVoG O2jvvzGEZb4pIqK2AZM5WM7Jt0auax4bVut5C/V6YLwg04GPX1cnVtajOMh571TAHFZ0 VR8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="A/WgNMD6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l143si7578896pfd.173.2019.05.06.14.30.41; Mon, 06 May 2019 14:30:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="A/WgNMD6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbfEFV0g (ORCPT + 99 others); Mon, 6 May 2019 17:26:36 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:35662 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbfEFV0d (ORCPT ); Mon, 6 May 2019 17:26:33 -0400 Received: by mail-io1-f66.google.com with SMTP id p2so1198838iol.2; Mon, 06 May 2019 14:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:organization; bh=BK2WmqeIaTnF7dVEhLC6AktVLWES0Us9v9VW0JdEI+Q=; b=A/WgNMD6yDqbEI02rlg3+7pAM9KMk9YxUbCW4o60nS78w+gh/2ECd1hyjUfFlsQz0W vin1c1v30rmKRQdjI1o87/rztc9/Ph3pjvCdBF2ArObdJ3DJuGJTb136VrnROKWTltZ8 essOfKEHdKeiGvdED1gISNoNbzW6DOcIOa249a2YXbWvHkMBR/Qb+15td/OcQ9De9H/Y qrDZRod40/gPihXt6J1JRglOVWpf5VmWFXP8MGKhDiMN52DfS7TTJno0UH27alWut/q3 dy3n2ldI21n/nt7WmnyN5lwMRb6ro6cZHUb5zBiceVwnGvMuQbU/mpG3OzgKSvfh6uP9 uMGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:reply-to:organization; bh=BK2WmqeIaTnF7dVEhLC6AktVLWES0Us9v9VW0JdEI+Q=; b=Zp2w0VE0neCxMIAYoJWwQd6qe7JiaUeNnGO/8hwwpx+OrNvYhqefJRwMlVv/HgtZSz JpDgCi4UQPGkEYIEm5HhIlFRKbE10+lwT5o3Wv9xLsVoIpBQ/xEWBr25lpDC2xqKpQIR rah1bFVvD3+Fw37KXKuQQxzsnlnIRU2V5VX5I5NVOJ9CP2K+hyuJaM3VTtiKxSQkaQdK r5k7aqMSHKJa9SPWKXC01c9qhrNT5eqkRsB255WNbK/7vhlkHxKR8X9EDV6vz8pxDXTP YOKhEtWdvpEuIQIMJDLrSTNVy9REOAOf2GSFPdnxyp0YV6l8cQP2rEfUVGxFZaN/2yQ7 c7SA== X-Gm-Message-State: APjAAAWWEmZEB48xhBmNASK1l2LZCkZHjLNHYSWD3qPFS2JfiQYNg0GS frNrjZSPK871jTL9BA9RRaU= X-Received: by 2002:a5e:9313:: with SMTP id k19mr14166455iom.239.1557177992742; Mon, 06 May 2019 14:26:32 -0700 (PDT) Received: from nuc8.lan (h69-131-112-51.cntcnh.dsl.dynamic.tds.net. [69.131.112.51]) by smtp.gmail.com with ESMTPSA id v25sm4268009ioh.81.2019.05.06.14.26.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 May 2019 14:26:31 -0700 (PDT) From: Len Brown To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown , linux-doc@vger.kernel.org Subject: [PATCH 06/22] cpu topology: Export die_id Date: Mon, 6 May 2019 17:26:01 -0400 Message-Id: X-Mailer: git-send-email 2.18.0-rc0 In-Reply-To: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1557177585.git.len.brown@intel.com> References: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1557177585.git.len.brown@intel.com> Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Len Brown Export die_id in cpu topology, for the benefit of hardware that has multiple-die/package. Signed-off-by: Len Brown Cc: linux-doc@vger.kernel.org --- Documentation/cputopology.txt | 15 ++++++++++++--- drivers/base/topology.c | 4 ++++ include/linux/topology.h | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt index cb61277e2308..2ff8a1e9a2db 100644 --- a/Documentation/cputopology.txt +++ b/Documentation/cputopology.txt @@ -12,6 +12,12 @@ physical_package_id: socket number, but the actual value is architecture and platform dependent. +die_id: + + the CPU die ID of cpuX. Typically it is the hardware platform's + identifier (rather than the kernel's). The actual value is + architecture and platform dependent. + core_id: the CPU core ID of cpuX. Typically it is the hardware platform's @@ -81,6 +87,7 @@ For an architecture to support this feature, it must define some of these macros in include/asm-XXX/topology.h:: #define topology_physical_package_id(cpu) + #define topology_die_id(cpu) #define topology_core_id(cpu) #define topology_book_id(cpu) #define topology_drawer_id(cpu) @@ -99,9 +106,11 @@ provides default definitions for any of the above macros that are not defined by include/asm-XXX/topology.h: 1) topology_physical_package_id: -1 -2) topology_core_id: 0 -3) topology_sibling_cpumask: just the given CPU -4) topology_core_cpumask: just the given CPU +2) topology_die_id: -1 +3) topology_core_id: 0 +4) topology_sibling_cpumask: just the given CPU +5) topology_core_cpumask: just the given CPU +6) topology_die_cpumask: just the given CPU For architectures that don't support books (CONFIG_SCHED_BOOK) there are no default definitions for topology_book_id() and topology_book_cpumask(). diff --git a/drivers/base/topology.c b/drivers/base/topology.c index 5fd9f167ecc1..50352cf96f85 100644 --- a/drivers/base/topology.c +++ b/drivers/base/topology.c @@ -43,6 +43,9 @@ static ssize_t name##_list_show(struct device *dev, \ define_id_show_func(physical_package_id); static DEVICE_ATTR_RO(physical_package_id); +define_id_show_func(die_id); +static DEVICE_ATTR_RO(die_id); + define_id_show_func(core_id); static DEVICE_ATTR_RO(core_id); @@ -72,6 +75,7 @@ static DEVICE_ATTR_RO(drawer_siblings_list); static struct attribute *default_attrs[] = { &dev_attr_physical_package_id.attr, + &dev_attr_die_id.attr, &dev_attr_core_id.attr, &dev_attr_thread_siblings.attr, &dev_attr_thread_siblings_list.attr, diff --git a/include/linux/topology.h b/include/linux/topology.h index cb0775e1ee4b..5cc8595dd0e4 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -184,6 +184,9 @@ static inline int cpu_to_mem(int cpu) #ifndef topology_physical_package_id #define topology_physical_package_id(cpu) ((void)(cpu), -1) #endif +#ifndef topology_die_id +#define topology_die_id(cpu) ((void)(cpu), -1) +#endif #ifndef topology_core_id #define topology_core_id(cpu) ((void)(cpu), 0) #endif -- 2.18.0-rc0