Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1056425imm; Fri, 29 Jun 2018 10:36:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdXiELqosfnnMryS5cSGK2+CAYp9iAKu61fRdGP/+l3ZbIaIrnMhmMTXyyGPw3o8JdOZ41H X-Received: by 2002:a65:5784:: with SMTP id b4-v6mr13602465pgr.315.1530293789471; Fri, 29 Jun 2018 10:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530293789; cv=none; d=google.com; s=arc-20160816; b=OICUmox1sL7pEzjrvZ23r9Qkw82i+OC6AusHanbAlp2wSBwvGQXKUyu1l4Ng1xzfPj yght2GlFPE3W8buvH/FBNbZk25S9Vsfh0gzADBG8wjbUFf/2HglHebSqpJsc+uoGq6qr Ua0eT8GpQA7dzAgD5HL6BwzllhV+9AhVDX904kVuOzEXtmXN8GtIipAqZIWhy/4Q3e1K cmWCUPcysG6xhx2FWMpiQU44qniyuSB0BP9oF9cW6yn/f1/PF+4kmxhCC9QBJt2j6AEh lQVJFYEgA08CkwUyKqKkYpAUcKEelnUrirmltzkIkSC99Zi45VLQ1K7hHa39AaOmGv49 FEmw== 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:from:references:cc:to:subject:arc-authentication-results; bh=ImSkRgKjlan5Vq3tmxL5f78vSaM0SP3zuF9JPM1iqV8=; b=PVJd0RMPGr9j2anjMxyCOHPwMdAE/2kSZsygI51H2h2w4zMjCbkOJoVjVOOVhrZM6e dtousDGq/iO5agF4rcmqVW9Qo0gSUgnLMTzrJlBQXzyVgxlIi6j5Sr+L7PrIRPMU45vj R3zp4VFll+seqJ1g9M537xUE8G3E/6fKagv3ViJhsDR2oScS5JFFbFBYrBOUqYkS3fqY nSTwphgDsxVbS023+6VW/KFhdOotAIKNmMLuStdS/XXTMpyvTYiIyo0SeoIDqtefNm2k iB/re+OV5n97rLTxFraTDjXeyfYKUxidEYwW8Cp3pdRzKN2F582RG3bT0gxlK4WrXvon yQOQ== 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 x13-v6si9290355pln.62.2018.06.29.10.36.15; Fri, 29 Jun 2018 10:36:29 -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 S937071AbeF2QsU (ORCPT + 99 others); Fri, 29 Jun 2018 12:48:20 -0400 Received: from foss.arm.com ([217.140.101.70]:37052 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935714AbeF2QsR (ORCPT ); Fri, 29 Jun 2018 12:48:17 -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 C28771529; Fri, 29 Jun 2018 09:48:16 -0700 (PDT) Received: from [192.168.100.244] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3AB453F266; Fri, 29 Jun 2018 09:48:16 -0700 (PDT) Subject: Re: [PATCH] arm64: acpi: reenumerate topology ids To: Andrew Jones , Sudeep Holla Cc: 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 References: <20180628145128.10057-1-drjones@redhat.com> <20180628173243.obydzakh2stfs26w@kamzik.brq.redhat.com> <20180629102927.GA18043@e107155-lin> <20180629112354.hefdl2pe72frl6x3@kamzik.brq.redhat.com> <20180629132934.GA16282@e107155-lin> <20180629154608.nqudibf54ti6dpjc@kamzik.brq.redhat.com> From: Jeremy Linton Message-ID: <30d56d70-6043-0ad7-4530-208fab18c8d4@arm.com> Date: Fri, 29 Jun 2018 11:48:15 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180629154608.nqudibf54ti6dpjc@kamzik.brq.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed 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, On 06/29/2018 10:46 AM, Andrew Jones wrote: > On Fri, Jun 29, 2018 at 02:29:34PM +0100, Sudeep Holla wrote: >> If it matters a lot, vendors must use UID for consistency. Since OS doesn't >> use those IDs for any particular reason, OS must not care. > > That depends. If you look at how topology_logical_package_id() is used in > x86 code you'll see it gets used as an index to an array in a couple > places. If we don't remap arbitrary IDs to counters than we may miss out > on some opportunities to avoid lists. > > Also, we're talking about what's visible to users. I think it's much more > likely to break a user app by exposing topology IDs that have values > greater than the linear CPU numbers (even though properly written apps > shouldn't expect them to be strictly <=), than the opposite. > >> >>>> >>>>>> >>>>>> So I would like to keep it simple and just have this counters for >>>>>> package ids as demonstrated in Shunyong's patch. >>>>>> >>>>> >>>>> If we don't also handle cores when there are threads, then the cores >>>>> will also end up having weird IDs. >>>>> >>>> >>>> Yes, but if PPTT says it has valid ID, I would prefer that over DT like >>>> generated. >>> >>> Valid *ACPI* ID, which just means it's a guaranteed unique ACPI UID, >>> which isn't likely going to be anything useful to a user. >>> >> >> How is that different from OS generated one from user's perspective ? >> Vendors might assign sockets UID and he may help them to replace one. >> Having some generated counter based id is not helpful. > > I agree with this. It's a good argument for maintaining a mapping of > package-id to id-physically-printed-on-a-package somewhere. To avoid > maintaining a mapping it could just be stored directly in > cpu_topology[cpu].package_id, but then how can we tell the difference > between a valid printed-on-package-id and an ACPI offset? We'd still > have to maintain additional state to determine if it's valid or not, > so we could just maintain a mapping instead. Just to be clear, there isn't anything (AFAIK) in the ACPI specification which dictates what values should comprise the various ACPI id's. They are assumed only to be machine readable, which is why it seems some implementations are just using a sanitized version of mpidr for the core/MADT acpi id. That is why simply using the id flagged as valid in a PPTT node doesn't necessarily give you a more human readable value. If you want a human readable socket identifier that matches something stamped above the socket, that is what SMBIOS is for. Queue discussion about that tables reliability for functional ids. Either way, as the spec is written today (or any ECRs I've seen), your definitely not going to get both nice socket1, socket2, and cpu1, cpu2 out of the same PPTT/ACPIid name-space since the numerical id's conflict.