Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp853689imm; Fri, 29 Jun 2018 07:28:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpftxBrxH5O8rsKmBPwWvbgNkDdxK/m0vu4VLJnIg88K569RoWSeh9RR/P/Nsr9PyrKoh+7Z X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr2545564pla.52.1530282505777; Fri, 29 Jun 2018 07:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530282505; cv=none; d=google.com; s=arc-20160816; b=o1qG7xA+lXumzKeorCxYwbZEfgEA1PKJjFiDL1HSAxsSH3HCyzv322bkIr6mYV+tsL Gws0q2nce6++iWZlLHzV22afPWsA6qYCO85BIXxs8CAByag+xWGCxtd3DECyUOB48+eE IAZe8zC22dDH99QceIHPq0gqTIr3NKjVWLfhVHxXdSngvbBGbiLTGnvrhjYylUpxfj3G ATOoVwYl8yG0r/dIsjLvZN00uQ9j+jEEdg+Od/uUoO/69XvrHe22TsAsmCqcuCMCxLJl XJqiMF5d7Fi12oLdZndp5HKhjoy+gqF1EMum5h7OL+Evystu4OWbbfTtD7XbC3snob35 FGPg== 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=P3H78P26hSLFAYXzy/Use3MW9m7Okqszuog7uVXxi1s=; b=Fh2djpSNZrmgL10wNA5JiTfh2n6omF5w5ww0DWthYfGbpR0iNvbUw3LBQoF+mYanZ1 RwyONcLlGu+dfW9AKNCeQMJa68DPz1f3DpDkQGJ2XemA1Lxns3upKgZ8zrqlgQ+MJYAm 0g4Ny208rkRdFssfWmd0dqP+V1KAzzJLjQ3HdO+Al1XO19l9oe2yd/WfwCiGjed6zmQd 1Njlw6PplsTqaT/LNC2oit6ZNrur3DJXFbDfj615vIXjwzJGP+CO3bcXHUBRbLi9HtUH QcQ4iZqmqI/lWv3QPlY3Pqljtz+W9e3Os2nlcS7+lQlNVuwJxzbEI4S2XKN5M8WreDFr /glw== 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 s25-v6si8362560pgd.188.2018.06.29.07.28.11; Fri, 29 Jun 2018 07:28:25 -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 S933831AbeF2Niz (ORCPT + 99 others); Fri, 29 Jun 2018 09:38:55 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34438 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932078AbeF2Niy (ORCPT ); Fri, 29 Jun 2018 09:38:54 -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 CCE6280D; Fri, 29 Jun 2018 06:38:53 -0700 (PDT) Received: from e107155-lin (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 326063F5C0; Fri, 29 Jun 2018 06:38:52 -0700 (PDT) Date: Fri, 29 Jun 2018 14:38:49 +0100 From: Sudeep Holla To: Andrew Jones Cc: Jeremy Linton , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ard.biesheuvel@linaro.org, shunyong.yang@hxt-semitech.com, yu.zheng@hxt-semitech.com, catalin.marinas@arm.com, will.deacon@arm.com Subject: Re: [PATCH] arm64: acpi: reenumerate topology ids Message-ID: <20180629133849.GB16282@e107155-lin> References: <20180628145128.10057-1-drjones@redhat.com> <20180629105334.GB18043@e107155-lin> <20180629114227.4noje2kx3lcjbcpd@kamzik.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180629114227.4noje2kx3lcjbcpd@kamzik.brq.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 29, 2018 at 01:42:27PM +0200, Andrew Jones wrote: > On Fri, Jun 29, 2018 at 11:53:34AM +0100, Sudeep Holla wrote: > > On Thu, Jun 28, 2018 at 12:12:00PM -0500, Jeremy Linton wrote: > > > Hi, > > > > > > On 06/28/2018 11:30 AM, Sudeep Holla wrote: > > > > [...] > > > > > >I am not sure if we can ever guarantee that DT and ACPI will get the > > > >same ids whatever counter we use as it depends on the order presented in > > > >the firmware(DT or ACPI). So I am not for generating ids for core and > > > >threads in that way. > > > > > > > >So I would like to keep it simple and just have this counters for > > > >package ids as demonstrated in Shunyong's patch. > > > > > > So, currently on a non threaded system, the core id's look nice because they > > > are just the ACPI ids. Its the package id's that look strange, we could just > > > fix the package ids, but on threaded machines the threads have the nice acpi > > > ids, and the core ids are then funny numbers. So, I suspect that is driving > > > this as much as the strange package ids. > > > > > > > Yes, I know that and that's what made be look at topology_get_acpi_cpu_tag > > For me, if the PPTT has valid ID, we should use that. Just becuase DT lacks > > it and uses counter doesn't mean ACPI also needs to follow that. > > AFAIK, a valid ACPI UID doesn't need to be something derivable directly > from the hardware, so it's just as arbitrary as the CPU phandle that is > in the DT cpu-map, i.e. DT *does* have an analogous leaf node integer. > Its platform specific, left to vendors to identify that. Are you referring to reg property in DT for leaf nodes ? If so, that's MPIDR and is present in ACPI MADT. > > > > I am sure some vendor will put valid UID and expect that to be in the > > sysfs. > > I can't think of any reason that would be useful, especially when the > UID is for a thread, which isn't even displayed by sysfs. > You are mixing MPIDR and UID here. > > > > > (and as a side, I actually like the PE has a acpi id behavior, but for > > > threads its being lost with this patch...) > > > > > > Given i've seen odd package/core ids on x86s a few years ago, it never > > So this inspired me to grep some x86 topology code. I found > arch/x86/kernel/smpboot.c:topology_update_package_map(), which uses > a counter to set the logical package id and Documentation/x86/topology.txt > states > > """ > - cpuinfo_x86.logical_id: > > The logical ID of the package. As we do not trust BIOSes to enumerate the > packages in a consistent way, we introduced the concept of logical package > ID so we can sanely calculate the number of maximum possible packages in > the system and have the packages enumerated linearly. > """ > > Which I see as x86 precedent for the consistency argument I made in my > other reply. > There are lots of things arm64 doesn't replicate x86. So I don't take that as valid argument. It's a new feature, we can use APCI PPTT UID feature to be consistent. I don't see counter being in anyway consistent. Even PPTT could be generated in the firmware and the order is not consistent. In which case the counter values in Linux might get things wrong while using UID from the firmware can keep it consistent(e.g. sockets removed,..etc) -- Regards, Sudeep