Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5723031yba; Tue, 30 Apr 2019 21:25:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwC+xOvWsEplIfBDf+Ol9KvrWepB5fADuY7kxeordwBQraaPQtUiOsXSJqmPybPPe5tgvWF X-Received: by 2002:a17:902:b40b:: with SMTP id x11mr7413256plr.265.1556684756464; Tue, 30 Apr 2019 21:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556684756; cv=none; d=google.com; s=arc-20160816; b=nLSaiTEzRnqFDJBDF+tbie8BhzRDR/+izuXaXCrJxSB2d/hPTY2zl6CnIrxER96DMx leGPnzd3VtWpiffUoQEFxWGiiiPCnDCmBngWNXDO/ZQZGqPiQrAlsK1Xol891j1BwZCn hYZ4D8E44wsQiL5gPgtyR31L5CyAYvJ8pbp1CGejm6br7RvqZ14FsivpZK/2fOGZdn6H OI499d87VSLzmsbaqJ2hYYcZ/wfB/8V643Pyt7tO/cSxYfLhRrhr4MSFOSahp43zgEbd 8CHjN/c58l3l3fO6eqFPm9pfCUPal7DqulcAm9IJGCx4LnqZyGP7/QiXhTiYW+LVsGoX Na9w== 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=SDgjyDjHpWTAQKIqsazlK1Si7Pd7dWmetjdWXt1vVlfMiFgN1QFRqz3MgiXjKpKQaC tky7827vwGCXjbz2Tmbu3CVuLu3cMg1EIB0Gfjp0uJTKDQoFfqbTC9Dr1+y9yCVOFfp2 U+CMBB3jTakmfpVt2QPa6F7/cJfr/qU0+mNZ0NkJSaw5Qj10rc1cxhv7FijLJ3Y4aSae X8KpXVQYkNgU2nDPcdFiNclBxzQLJeLtyti36DxKH5l1rnkDd469P0NkcNDtl3Fs4HeI njxBQNzCnrAI31O3JPJjuJTtSWENGM1wPpBROypLmLShMvPSKmVBhkh2Z1WYAa0BiY/l FIrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZflL5ply; 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 y5si40194625pfm.191.2019.04.30.21.25.41; Tue, 30 Apr 2019 21:25: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=ZflL5ply; 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 S1726243AbfEAEYp (ORCPT + 99 others); Wed, 1 May 2019 00:24:45 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:40834 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEAEYm (ORCPT ); Wed, 1 May 2019 00:24:42 -0400 Received: by mail-it1-f194.google.com with SMTP id k64so8370085itb.5; Tue, 30 Apr 2019 21:24:41 -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=ZflL5plyQPtPgeKSsPzaQzePVoXQSUqrXvuDP0S6eIdQWq+PzmznAETv8I1mLrvRkM /WYdDlE/D4BmVTd7bI6eYtZYCCDBymnkCnwzypsMRC4qW0RohyluF/EN2DuH4zjRJOun CNgorjZzU6+EKKjdtydGhGwbcn9Milh8Ox49mvjKE+hiSvME49xDNG+j9lDHjXRZv07R 3UibTIj8PSzxrv3t0LtzMMbmL+mfLBEI/fpvRxhv/XogQUvZIg+XyoZYsDvanFIBvjh5 ZnxhicHZAV1WMwqsJeRF5NkrbbDOh1LcWe3hPT9A+FG87K6TsVLiRtLFBksnkdMSQryd o+JA== 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=b2f1acpJK6I8YuoRHMblwHVU7J1Mi4WKzVKIlTURaGOICC4EgTcYztJ/kQxzTPd/hB VM/GreWosWfBFLeb0ZCgYKCHTN5iP5h9XckKFLjQTygdx3vMHU8oTYr/Z6Rw4fKcnAvB ScjFD1MhU1GEfTMkwAjRY0vvf/GFm2hbOmLMWwXdVO0tyXAPedFllUY9QnpzV9mjDxG8 vTXfbIiZvCT+SNm3/PPFeWHejxEZZvwtScO1I6DpkgtYfeJ2VBxbB72CgJLYHHJ72aQ+ 8IUrB/r16dHCmbi0XZZhw4ZlNBAI8sEWLZtqHmH7EPRmpU8OazWOtCHfm0SeYSfLYOyI 60Eg== X-Gm-Message-State: APjAAAWlFB3OtxBNVShnasdjIR0jT1pti1Coh6kHB15g0Sw8sTVapu1s jK/EeiFS9zVfpiH6qolo9CU= X-Received: by 2002:a24:58c:: with SMTP id 134mr6397210itl.103.1556684681419; Tue, 30 Apr 2019 21:24:41 -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 b8sm2569728itb.20.2019.04.30.21.24.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 21:24:40 -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/18] cpu topology: Export die_id Date: Wed, 1 May 2019 00:24:15 -0400 Message-Id: X-Mailer: git-send-email 2.18.0-rc0 In-Reply-To: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1556657368.git.len.brown@intel.com> References: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1556657368.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