Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3092746imj; Mon, 18 Feb 2019 19:42:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ1rZtmSf9bs0nRR9j9sgnAZGg6V4xbKjNqq5kIoyXEeApQUU20YvhHZoBHKOVd8xdwx6Xa X-Received: by 2002:a63:fd07:: with SMTP id d7mr21502666pgh.163.1550547770629; Mon, 18 Feb 2019 19:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550547770; cv=none; d=google.com; s=arc-20160816; b=nHZ8eSAbTBf6zSHnj5JNWGg8mQ4Ah/Bj0LwoWlEz0BD0WjL9Fbi9D7QwyI4sLfhLo/ IbkEGeo8hdLfYpXlKofGoZfyJqmK5wMJNNygTB4Xlu5pP/62HOJ839BT+Yr8gn+splq4 CmQiQ1Z4y2YDeQfWGJcS5ovn8QcJfbA+m7DBYD9Gp8dACE20qsqXh5aPDQ1rzTXzDAXW EsyWpcHfus++tQsNHoq/eD7zNLmjVX8HG6x9EsbTxuahpK+2ZBCChknp4XUPrCvnIYW9 El8Z3ZQRb3JOoiMu5sxRHW/RDdpwlsEntk8jT5LUT4pAgtDD4ztCMqgYzOlVaWyqEAlr WvDg== 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=AE0sgzP6cJhHhsJWS+EYDFC7yviblKK4ktbj0HfAd0E=; b=xilNoYRwEEB0otsGmNB48RabGS/lbCFA8x6gZFx/z8gniXW22e3Vk6V19V0bo8ti// USoM7bUL7WAhAPLPriHWwnHmpqzBJ1pXKFuY7bCskCyqzVKuRX/FkDqad2xzU5FsASa1 H8QVGg6FhN1dG8xZSw6wXGsvsoU4EMXRpz5Au13oaErY57LOd3Xi/V8t8w20ChgAQRJP 2hnooTY1Tc2+rB8IQvJq40gBg0pg+VOylK0WxZvUG5Vl4iG4H7vikkVM8JIQUL3ayGsS ONkAKppVhaeQJ/TE3iO5qzyiqDz0BppKFvrxe2/gs3YGqMva0p650gfejs16LmbCq5Zf GkVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=inAViFSQ; 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 d186si2463674pfg.50.2019.02.18.19.42.36; Mon, 18 Feb 2019 19:42:50 -0800 (PST) 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=inAViFSQ; 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 S1726941AbfBSDlE (ORCPT + 99 others); Mon, 18 Feb 2019 22:41:04 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:38190 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbfBSDkb (ORCPT ); Mon, 18 Feb 2019 22:40:31 -0500 Received: by mail-qt1-f194.google.com with SMTP id 2so21644894qtb.5 for ; Mon, 18 Feb 2019 19:40:30 -0800 (PST) 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=AE0sgzP6cJhHhsJWS+EYDFC7yviblKK4ktbj0HfAd0E=; b=inAViFSQwLbTEht7WklQYZTF526JNgh71kVcVszMF7A5Tp3u7v1k6ruHPY4mVW8aRE W4ViHKEk9TcCcP0WsuZgMqIKYOZQiyugPDckiwvAbxN7wzjpAb48EUguVJqi+agN26Ns K2pGDYJMP4LV/EW12k1G41KeeAJZ+eN/p4yLxlr+JHnQJTqn6bfzDNY358cIoqwkyxYP Vw/V1h2iIu8UPXPp04UNp+YlE79L3aHg/zLyBroX3JZ+wAitATIg1fOkz1Si5eTYILt8 2KtTJ69yQnw+grxQ5ZIu3XDbmipqUge0ZYPJs3zqlv64a+mdn5qASvzyNQuHBr+Pisyi 9KvQ== 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=AE0sgzP6cJhHhsJWS+EYDFC7yviblKK4ktbj0HfAd0E=; b=m3+toui8KcBzTPInuVchnUu+nJi/Plp1ewY2ioLLjULxdUx5qiPsMbLmJkk7pGgiOB XHwo0t5GE7SB7NIqi5fOMwRkrjYEtmfN4lxk4MTbIXraLiRW+On5p8JGsjChJ6N9yRh9 MqBwkkjWRrL0RxyGzTnSNVWGCByS3+hAFxVzThBmf304qH9QvR5C7vOnMzjYCn0WVlGt i3AJEbANxaUfxU8+NQK+VJ60Jlipp3WRuB2vaM9OllclY+LPSBn1jKamVGCKdcAaTC0v W2vtol6AX4OjBeksljVwOd8ZoWvbmhGfUPcYmtL0+mTabKQ+jHkbfGrOhZ8pTnJDyOFt MHsQ== X-Gm-Message-State: AHQUAubm7CXO6TkYFO2rst8NxcrNX0f1n2HJ2S9/z9Txki/V3mmU4dj7 zQV6mgx8uRnPTfF2FJBfM6rLcsIE X-Received: by 2002:aed:3bb3:: with SMTP id r48mr21541630qte.278.1550547630236; Mon, 18 Feb 2019 19:40:30 -0800 (PST) Received: from kbl.fios-router.home (pool-96-233-42-17.bstnma.fios.verizon.net. [96.233.42.17]) by smtp.gmail.com with ESMTPSA id u5sm7327680qtg.37.2019.02.18.19.40.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Feb 2019 19:40:29 -0800 (PST) From: Len Brown To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 06/11] x86 topology: define topology_unique_die_id() Date: Mon, 18 Feb 2019 22:40:08 -0500 Message-Id: <270dd0e65f746e97669d9c3b89dfc56e5523e026.1550545163.git.len.brown@intel.com> X-Mailer: git-send-email 2.18.0-rc0 In-Reply-To: <635b2bf8b1151a191cd9299276b75791a818c0c2.1550545163.git.len.brown@intel.com> References: <635b2bf8b1151a191cd9299276b75791a818c0c2.1550545163.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 The topology_unique_die_id() helper calculates a unique system-wide die-id, for the benefit of multi-die per-package systems. This simple system-wide unique number within known bounds is sufficient. No need for the overhead of generating a global consecutive "logical" id. Signed-off-by: Len Brown --- arch/x86/include/asm/topology.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index a52a572147ba..12444a1a30f3 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -106,6 +106,9 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu); #define topology_logical_package_id(cpu) (cpu_data(cpu).logical_proc_id) #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) +#define topology_unique_die_id(cpu) ((cpu_data(cpu).logical_proc_id * \ + cpu_data(cpu).x86_max_dies) + \ + cpu_data(cpu).cpu_die_id) #define topology_die_id(cpu) (cpu_data(cpu).cpu_die_id) #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) -- 2.18.0-rc0