Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7373248imm; Thu, 28 Jun 2018 02:39:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcF6e/PdZgi7r949KtH3nV8XlYHWGgYCfqmnIzCmDn/KOMc6axrsAQdRtfeW+qG3H3ik7eL X-Received: by 2002:a62:3b89:: with SMTP id w9-v6mr1960971pfj.80.1530178785197; Thu, 28 Jun 2018 02:39:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530178785; cv=none; d=google.com; s=arc-20160816; b=QOWT3t39OaNy2slnrNVjIFV33iB+knHmwTLCQHY6E9Gi4LlKM0uFVYnNJku5Moa/y7 YBKOdb6ZJ9OaDsTq1aGpGxq8RYI/TI19PtrQKHF9UuSRnnZi7cCxQ3dc33Bmcr9ytzO9 Fb599tuw+ehuyYBIPC76n55vIRouBZEUJaaUHQrqDN7FrT6hmVadK2oYuaLCbqWUuDfH qaTbsAkRQf1nEJBm614xJOhkhWYTST5be8j+/ksTNAIt/4nN9BI77xelfSAoGg3YQ6VJ B8uZ0BIVkV+MXLI3ZgWsqaWR7vf3B8ZkQinEWJ3BTOHbgLs21fAJoMwdDMxzg6NnI7nO xRIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:to:subject:cc :arc-authentication-results; bh=t411r6L1IaX4mxJVDd1FVMWwxWfWexeTiWk3B5IHUm4=; b=gJIpjqlH1bOiRw8AiCpH059XIlQnoOEK85mrV466NUjIA1C07cQHxkKP6J93bLXWnV ZVVsHTggdXDXtIuBKCmsYxFTl6/MxAUXBuhSYyD97E7WnqyVDRQ4crPgE4Z7wP+HG0ys dPhIiWnQxAnN8Pyzl4d/PvizYaoRjaIKjPU4OiPeKhb0w/hiNFlwLwFbMG3UYeRWgfcQ NfCbJznzsztpRNu6rGjJcRd69znbkXNWr4j87E9EQvw51G6U5KpmYbiOkJZvUnUB0aQ+ 8rQ7FOyTuYhujGf9+5e/qYjfrycIXbmfZ7IpSxylr/z2kj/HWjtgO4YCLmcBVxbP/Jku 5sEw== 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 e72-v6si6526821pfd.352.2018.06.28.02.39.27; Thu, 28 Jun 2018 02:39:45 -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 S935132AbeF1Jic (ORCPT + 99 others); Thu, 28 Jun 2018 05:38:32 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43724 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933896AbeF1Jib (ORCPT ); Thu, 28 Jun 2018 05:38:31 -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 938DC80D; Thu, 28 Jun 2018 02:38:30 -0700 (PDT) Received: from [10.1.210.28] (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DD64D3F266; Thu, 28 Jun 2018 02:38:27 -0700 (PDT) Cc: Sudeep Holla , will.deacon@arm.com, linux-kernel@vger.kernel.org, jeremy.linton@arm.com, Joey Zheng , Andrew Jones Subject: Re: [RFC PATCH] arm64: topology: Map PPTT node offset to logic physical package id To: Shunyong Yang , catalin.marinas@arm.com References: <1530177508-15298-1-git-send-email-shunyong.yang@hxt-semitech.com> From: Sudeep Holla Organization: ARM Message-ID: Date: Thu, 28 Jun 2018 10:38:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1530177508-15298-1-git-send-email-shunyong.yang@hxt-semitech.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shunyong, On 28/06/18 10:18, 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. Thanks for the patch, but Andrew Jones has also posted a patch[1] which I had a look but was not sure what is the best approach to fix it yet. I will think about it and respond to that. -- Regards, Sudeep [1] https://patchwork.kernel.org/patch/10482261