Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1556952imm; Thu, 12 Jul 2018 04:06:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfjn9lWcTKjzcIugQR/nF2WmJcFJCxtwwCy95EragOA/m4xl0UB/pY6C7tMe5WHM5uLjfXh X-Received: by 2002:a17:902:7891:: with SMTP id q17-v6mr1789423pll.186.1531393598310; Thu, 12 Jul 2018 04:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531393598; cv=none; d=google.com; s=arc-20160816; b=VdCyUwOD5wVkGUz2T0uQvMPYhVMvm0/9pMvn9eanKzrZg/bxB16mtw1ke03l8ArLYR jRxpx2tim5dFUxKQfkLMhue4ZOUSzA0dv7W8QXzB5DZEU50H5AEWvH1o2xRWAaO1bGVv tYHoCAvaAkV7SeiTJNhLIpe5zwNNylt3j8R3Ol31vlT8SAYvqsvWCYiSyyeldkvLZdKM KrwbIoICfAohPYY6H8SrwWVSHyiJErrfYQOUX3iQEIgnbHdhsFYWe/oSN9+pxII8bn9Z QXoImv930is8Vo4lFjjxeEG3Rywfyho02WPFW5GnG9lZjOjPJgoIgPiMUQrb8q6kGob+ eWig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=N1RaTbm/gvM2svzZn2or2TsZqmccZZtrxS+KpBgah8Y=; b=g8lznkIsei5sdOngOX1W7gqAVADMOmmdUq8p/627rzo3pjnijpams4cF2ibIAwb6rl gXi1P1b/hQM2prJxrXa2UuDYSial1TutqG1Pi06DszOs7bSKGPajkSwKoGHFEphz4QB/ LcLhXs7RGpcq+BhLl1YWKDfjY0d9oaX14mNwdfUwsKfDd7h5AEo2oqIbpnbh7ytfOIfw yrp0BbfFOP5CtRGMcF2ah5zkM34p3rY1LmTvXDgMFx3Xg2yk5jDl6CAiQhmrKjmaj1oi ELm/ZJiauTzP7w+7UFWeM0y6FZ9h7pcPHD0gD0EW0kTtb/NhkB9LaS8+377AV9ZccXy7 20YA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 184-v6si21338883pgj.421.2018.07.12.04.06.22; Thu, 12 Jul 2018 04:06:38 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726888AbeGLLOu (ORCPT + 99 others); Thu, 12 Jul 2018 07:14:50 -0400 Received: from foss.arm.com ([217.140.101.70]:49738 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbeGLLOu (ORCPT ); Thu, 12 Jul 2018 07:14:50 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0BC67A9; Thu, 12 Jul 2018 04:05:46 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9060C3F5B1; Thu, 12 Jul 2018 04:05:46 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id DD0021AE53FB; Thu, 12 Jul 2018 12:06:28 +0100 (BST) Date: Thu, 12 Jul 2018 12:06:28 +0100 From: Will Deacon To: Shunyong Yang Cc: catalin.marinas@arm.com, jeremy.linton@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Zheng , sudeep.holla@arm.com Subject: Re: [RFC PATCH] arm64: topology: Map PPTT node offset to logic physical package id Message-ID: <20180712110628.GA16043@arm.com> References: <1530177508-15298-1-git-send-email-shunyong.yang@hxt-semitech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530177508-15298-1-git-send-email-shunyong.yang@hxt-semitech.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 28, 2018 at 05:18:28PM +0800, Shunyong Yang wrote: > As PPTT spec doesn't define the physical package id, > find_acpi_cpu_topology_package() will return offset of the node with > Physical package field set when querying physical package id. So, it > returns 162(0xA2) in following example. > > [0A2h 0162 1] Subtable Type : 00 [Processor Hierarchy > Node] > [0A3h 0163 1] Length : 1C > [0A4h 0164 2] Reserved : 0000 > [0A6h 0166 4] Flags (decoded below) : 00000003 > Physical package : 1 > ACPI Processor ID valid : 1 > [0AAh 0170 4] Parent : 00000000 > [0AEh 0174 4] ACPI Processor ID : 00001000 > [0B2h 0178 4] Private Resource Number : 00000002 > [0B6h 0182 4] Private Resource : 0000006C > [0BAh 0186 4] Private Resource : 00000084 > > So, when "cat physical_package" in /sys/devices/system/cpu/cpu0/topology/, > it will output 162(0xA2). And if some items are added before the node > above, the output will change to other value. > > This patch maps the node offset to a logic package id. It maps the first > node offset to 0, the second to 1, and so on. > > Then, it will not output a big value, such as 162 above. And it will > not change when some nodes(Physical package not set) are added. > > And as long as the nodes with Physical package field set in PPTT keeps > the real hardware order, the logic id can map to hardware package id to > some extent. > > Hope to get feedback from you. I'm assuming this is no longer needed now that we have queued the series from Sudeep? Will