Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1944761ybd; Thu, 27 Jun 2019 04:17:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmiWAwhXLMvvJrJC+tXwbsltsot+qy9G4/6B/HOAR/x7GzuCvQ159BxeRCSAzRFXV/OR9Z X-Received: by 2002:a17:90a:8c92:: with SMTP id b18mr5288290pjo.97.1561634226231; Thu, 27 Jun 2019 04:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561634226; cv=none; d=google.com; s=arc-20160816; b=P8L2OsbZmGd3bq1pptSKvSCv1rcTIrv1wSzbKmUAT+U6LtVJZDAXthNDplHrcY8zdJ ZFiC34nvGVp8LVCy36llgbEvSlXkfcb70pnBNEMbTbLwaLOgyZR8d/0doq/RFcrjyXv7 o5wIJ6YxydO+ziZcHpEPSiZD2q8ZtNcSjLP5s2CVdeW6nNU6HxowlbxBbqszHmP7NReP 17OjjNK59b7TgB7zWtu1n4PncEd1ysJrfVti/xMoTIC6kZ8oUXLKF4V1AdRZ2PZU6fWq +1cvj+KlBG8NRg1DZU3X7VPaSFGLTL/Pu8R8YadDK5XjtTMFxG8+z3HRQ+oPReUGQDPa WR1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=MCoUAfvQtoOdUQRzJp3YAxMM5z56DlV6XuvnfrWIxh8=; b=w3n6hF1yXucGNrTSvmEIpYTbeBq9wtfanLDkIuB4fxk0PDL6vTvmv1m9DsSvhrc28w mPSJmK4Zy9qkyIERjT6NrDFUXhzgjHgy19v8gXeJaO4/BpELOazhfHcbhNTVtZXgR+mm 8PMJi09IS85YxOokbVHPS16hI3A+WSllZ2GfvkA1o1+tJXGLgbSHV7U8CZMXgYBRN3Vj pdMFz/4V7mgHjUphDY66IBu780L7LbvSzdXttw0tUAPQ11ymuVtoH/P85wx221bYgvq1 mE/ERmMW75gEuPKVrEDCyloCaszqj/b2MakJxVdIVwujIkvIYDXJkfMeSQz05P3xKZvi K4jQ== 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; 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 r73si1987399pgr.553.2019.06.27.04.16.49; Thu, 27 Jun 2019 04:17:06 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbfF0LPi (ORCPT + 99 others); Thu, 27 Jun 2019 07:15:38 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:41927 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726431AbfF0LPh (ORCPT ); Thu, 27 Jun 2019 07:15:37 -0400 Received: by mail-oi1-f193.google.com with SMTP id g7so1266619oia.8; Thu, 27 Jun 2019 04:15:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MCoUAfvQtoOdUQRzJp3YAxMM5z56DlV6XuvnfrWIxh8=; b=i5tUm84hpzVj5tc/Ydd9YeNUaRZa9BalURw2NMRQ1seeLibJOEwurOSqbUTIPEep3T 6/JEsutFoKBGAZ+p+yv+5XD1EN/uUGpD8enKPhNOuhXf2pDKxvycIrIlBIs5cqZ1NBcU XZQQSi/COP5JB8Jot71NT+JwGTEmt3+Qzgt+UE6KUROZ+yIIga9tmr3WKIcGh0UjJx4n Q5joDs6hGmSapPaM6euqT0jZii//IVMrWnZvvdDY9CuRr3IVArtY52yqWkvACYAjjZ4F F2bTrPYBwaGb60ONJUrIR6rO2crjN7w37pphjfR6N/RdHNH8oxGUFfdFru8r7+lTAegq rLLw== X-Gm-Message-State: APjAAAUw5736VsyLZ/rrE+oe/orsDdvjLGlqBdGuWnjPcHNuMDOBoEKm dqgIK+Ky2tfSo+SNKHKrhxRPGWtrJm1GZXOMs9yFd+4w X-Received: by 2002:aca:d907:: with SMTP id q7mr1855837oig.68.1561634136962; Thu, 27 Jun 2019 04:15:36 -0700 (PDT) MIME-Version: 1.0 References: <20190626213718.39423-1-jeremy.linton@arm.com> <20190626213718.39423-3-jeremy.linton@arm.com> In-Reply-To: <20190626213718.39423-3-jeremy.linton@arm.com> From: "Rafael J. Wysocki" Date: Thu, 27 Jun 2019 13:15:26 +0200 Message-ID: Subject: Re: [PATCH v5 2/4] ACPI/PPTT: Add function to return ACPI 6.3 Identical tokens To: Jeremy Linton Cc: Linux ARM , ACPI Devel Maling List , Linux Kernel Mailing List , Catalin Marinas , Will Deacon , "Rafael J. Wysocki" , Len Brown , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Hanjun Gou Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 26, 2019 at 11:37 PM Jeremy Linton wrote: > > ACPI 6.3 adds a flag to indicate that child nodes are all > identical cores. This is useful to authoritatively determine > if a set of (possibly offline) cores are identical or not. > > Since the flag doesn't give us a unique id we can generate > one and use it to create bitmaps of sibling nodes, or simply > in a loop to determine if a subset of cores are identical. > > Tested-by: Hanjun Gou > Reviewed-by: Sudeep Holla > Signed-off-by: Jeremy Linton Assuming that the Tested-by tag will be fixed: Acked-by: Rafael J. Wysocki > --- > drivers/acpi/pptt.c | 26 ++++++++++++++++++++++++++ > include/linux/acpi.h | 5 +++++ > 2 files changed, 31 insertions(+) > > diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c > index 05344413f199..1e7ac0bd0d3a 100644 > --- a/drivers/acpi/pptt.c > +++ b/drivers/acpi/pptt.c > @@ -683,3 +683,29 @@ int find_acpi_cpu_topology_package(unsigned int cpu) > return find_acpi_cpu_topology_tag(cpu, PPTT_ABORT_PACKAGE, > ACPI_PPTT_PHYSICAL_PACKAGE); > } > + > +/** > + * find_acpi_cpu_topology_hetero_id() - Get a core architecture tag > + * @cpu: Kernel logical CPU number > + * > + * Determine a unique heterogeneous tag for the given CPU. CPUs with the same > + * implementation should have matching tags. > + * > + * The returned tag can be used to group peers with identical implementation. > + * > + * The search terminates when a level is found with the identical implementation > + * flag set or we reach a root node. > + * > + * Due to limitations in the PPTT data structure, there may be rare situations > + * where two cores in a heterogeneous machine may be identical, but won't have > + * the same tag. > + * > + * Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found. > + * Otherwise returns a value which represents a group of identical cores > + * similar to this CPU. > + */ > +int find_acpi_cpu_topology_hetero_id(unsigned int cpu) > +{ > + return find_acpi_cpu_topology_tag(cpu, PPTT_ABORT_PACKAGE, > + ACPI_PPTT_ACPI_IDENTICAL); > +} > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > index d315d86844e4..5bcd23e5ccd6 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h > @@ -1303,6 +1303,7 @@ static inline int lpit_read_residency_count_address(u64 *address) > #ifdef CONFIG_ACPI_PPTT > int find_acpi_cpu_topology(unsigned int cpu, int level); > int find_acpi_cpu_topology_package(unsigned int cpu); > +int find_acpi_cpu_topology_hetero_id(unsigned int cpu); > int find_acpi_cpu_cache_topology(unsigned int cpu, int level); > #else > static inline int find_acpi_cpu_topology(unsigned int cpu, int level) > @@ -1313,6 +1314,10 @@ static inline int find_acpi_cpu_topology_package(unsigned int cpu) > { > return -EINVAL; > } > +static inline int find_acpi_cpu_topology_hetero_id(unsigned int cpu) > +{ > + return -EINVAL; > +} > static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level) > { > return -EINVAL; > -- > 2.21.0 >