Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1521367ybm; Thu, 23 May 2019 02:26:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAXfd0SiXubohdN6MUYlnz37vuQliLin6zcRVmGxxk1bUvF8EWxw4zfP9hR6bRkiCIaWJN X-Received: by 2002:a65:64d9:: with SMTP id t25mr95719959pgv.130.1558603578215; Thu, 23 May 2019 02:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558603578; cv=none; d=google.com; s=arc-20160816; b=CyXaeMwc8Mdlx4gLxWKB9W+o/rrwiMF7N+7Uueq+0RKTbA/o8nI36OMwoz6654TuV5 MlRWxdddxRGLOpyvrQGIIerrLuJwVqiU5LRN9HUoalFS3cWEP0oJjOrIYy33Hw/zS1gI 0j43fbG4SsmcbLJBuMiUNb4R7/xov/9pIYHoBOD9mU+341nrXK+dirNN0Is6upSBYekX Bsmnopl05+FL1gqm4wGTF0yXLIOOor2f8aPNsjGIev1Hz+LrDWyiur0gp+UgeK4xEeOu fEvKTogT4bv11fSHCRTOZhFH5oMKpGC7amwfTFrOtPwd9rmEcbWq0wBQ5T8Lc+IjxGuS EE5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=IzhC8+GAMc/UbDs0JRk7sqe8QZCdglI5SAz1/Q8QIoA=; b=RfJQZaP+WgmQWODYDtd7NLz3qYZZ/LfdH6NrojRGu97CZ//wd3/aqK2RUZ/qubQSMP CHn8TVp8uvG/1SCkEaVgigiTj1R33PQaIm3ACpuW1NqSkwEXZ9bocIkBkTyZI99oB7gR gkzr20+6nJbs27LJIahKksOjX36nl0VPeH9Vz07YbP8a6MaW3kwUw+w4vJgOLN6q20XH JxR3yGsYg4SjUK00DYBT2aHREi7H/0hu0DRSNEt2TOkVJVpG3raicAMoBrLiuuJDxEds B10dIzXdr9ALXPPbGwg30RGwPqryUgixTmLH4t/J9n/XjNm/W///HaW9g86sHC9tG9NF PKXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=RjDTA3w1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a62si28369423pgc.129.2019.05.23.02.26.02; Thu, 23 May 2019 02:26:18 -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=pass header.i=@zytor.com header.s=2019051801 header.b=RjDTA3w1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729902AbfEWJYV (ORCPT + 99 others); Thu, 23 May 2019 05:24:21 -0400 Received: from terminus.zytor.com ([198.137.202.136]:34333 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbfEWJYU (ORCPT ); Thu, 23 May 2019 05:24:20 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x4N9O6Qo4040002 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 May 2019 02:24:06 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x4N9O6Qo4040002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1558603447; bh=IzhC8+GAMc/UbDs0JRk7sqe8QZCdglI5SAz1/Q8QIoA=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=RjDTA3w1rSow9e+De2mH2+MEGYpt2CUPOM1KXDc74Jfdj4iDxHOKAFq0GB/JXmME4 MQly/Hm29DPcnbbNsHlOgBfyC+HPJTY0QCPot4AxEkzWJXQ+eh87WP4w6V7NWqqFat gN8sFAHuX69nd0oHA/C1hqBpfcwina/GPVeqEc6KKnmroAy7zDuMax5hMcjHeicN6u SvP+4H1luxdRtRs0aCMvItlEEScP/Y6WRZjIBhjQXPgNr2YHuJDwNaVDxyU+2RS6Md 8QpLteRo42x/yMDl7vBVeOaQONZ1QWljs0pveUYmj58XaHb9yU0pIzCjDsS2x3+xYm zFEBUr89wTBxw== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x4N9O50D4039998; Thu, 23 May 2019 02:24:05 -0700 Date: Thu, 23 May 2019 02:24:05 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Len Brown Message-ID: Cc: len.brown@intel.com, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org Reply-To: len.brown@intel.com, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/topology] cpu/topology: Export die_id Git-Commit-ID: 0e344d8c709fe01d882fc0fb5452bedfe5eba67a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0e344d8c709fe01d882fc0fb5452bedfe5eba67a Gitweb: https://git.kernel.org/tip/0e344d8c709fe01d882fc0fb5452bedfe5eba67a Author: Len Brown AuthorDate: Mon, 13 May 2019 13:58:47 -0400 Committer: Thomas Gleixner CommitDate: Thu, 23 May 2019 10:08:31 +0200 cpu/topology: Export die_id Export die_id in cpu topology, for the benefit of hardware that has multiple-die/package. Signed-off-by: Len Brown Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Acked-by: Peter Zijlstra (Intel) Cc: linux-doc@vger.kernel.org Link: https://lkml.kernel.org/r/e7d1caaf4fbd24ee40db6d557ab28d7d83298900.1557769318.git.len.brown@intel.com --- 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