Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp311652ybb; Thu, 28 Mar 2019 03:05:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4ij2WqJon9RisorFGGty2Ev/539JPtDNkxjlO7ATCXNEiywJ306U2Sh11vmPZWzSqSicm X-Received: by 2002:a65:51c3:: with SMTP id i3mr38605991pgq.45.1553767533062; Thu, 28 Mar 2019 03:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553767533; cv=none; d=google.com; s=arc-20160816; b=N6poXO07ueKW8Gk0Qxew3OF2CAQXSQtK2nBpqjOk49jBe4pj7tFNtQ+SaaAaDAfNo2 stNen9sjzQ9cy+la5GuhlMuYj3/4FWvkHm78R7RRCJvs/y7XzT4OqLtKhrN5CBNjXDzA PE/NnZDaPxhfRvxmrxoifjbIpZ5VjJXUk5nsvj2ZhQK21qSjcWojBANu7WlMMX6K8dJa vYBBsPxf61Sb6lzmYt9PbJ3nHleXm0lCaWzxR1IJhoS//p9bYuLw6P+o1EsVh6NlN9Mj FaQr5c4KwPri1aUdcAo1QTJ/maQ6bf4ry0FAHuQI4IQDyqebmxJx9+ZrWwCXzGZjJpIs 2ggA== 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=xtmdu5XLPrI43gJK8nagjJ6gJWySA3zZa00qKeEf1cg=; b=xL1TCdPOETfQ77Dk1CumoA/CC/1xGbZWXBFVCcePQV6LHL9a/8yqV4KHTg7vr+7J4l dw/urMKUs+Fju3d2+qloG5S8uHvdAFlKhF8Ye1wdpd3LrOiPN2AOKqXh3ZmbSHnqFUHP z7okWxm1NSY0UwZkJenTmzud7tEGAb4Avr47wSxzhAJqoRbmoe3vjEjn7+1Ydnoyf+Pi MX5koB2WXpBTod7IcYXtwOebF3iXb5pmA/DArY58FldBC+6662YUk4El2npKnLdLrGSe M+Ntkfs7YCLgMBuCWvw4iNBaOycqdNzoX7usjJ4hINXGqGe0XEE92L9F2zDN5S6Ln8Kz 35ww== 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 b12si20264202pgq.421.2019.03.28.03.05.17; Thu, 28 Mar 2019 03:05:33 -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 S1727275AbfC1KE0 (ORCPT + 99 others); Thu, 28 Mar 2019 06:04:26 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:38363 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbfC1KE0 (ORCPT ); Thu, 28 Mar 2019 06:04:26 -0400 Received: by mail-ot1-f68.google.com with SMTP id e80so17759206ote.5; Thu, 28 Mar 2019 03:04:25 -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=xtmdu5XLPrI43gJK8nagjJ6gJWySA3zZa00qKeEf1cg=; b=WHO6a5P2TEJ3xVqmmqo0emS0ZQKQWwWsyc9MN1z+8kd08LHyAUbawjPhp/6/QzIzIq aLi7S3i9MlEoXe7R7KGk55q98rbEeRmtxA5kAu0b1ddVBRQR2YA5vGtoahVJGtNfHVgN Ma40bhmCdKwMwZXfaGfGpJlgdeaOm4SDuNJ4d+TYJkl9hxrB+AfEWZVTuBM1ZLC7sjr6 K5WRNxNF61iOwi0x0e3TEGaj3YW3OoqC3coQXNQmJnMW49vINErwPuvbOZ/3L/5KJmpa 9+i8j12ylnSWmAMZAYg81SKi6tNk3pwPdsdFE7ksNXBwZyI7YpiuuSR3PDKAPynuObkd Ac/g== X-Gm-Message-State: APjAAAWlj2jFELEnqMTDUoBewi3+89YCk7iLDovgzIIKpbtfpagYG+hi OqOYguLAtJ8r00i2m9Moh66hGlElJ6p7GBrJoxo= X-Received: by 2002:a9d:36a:: with SMTP id 97mr3722387otv.124.1553767465525; Thu, 28 Mar 2019 03:04:25 -0700 (PDT) MIME-Version: 1.0 References: <20190326223938.5365-1-jeremy.linton@arm.com> <20190326223938.5365-2-jeremy.linton@arm.com> In-Reply-To: <20190326223938.5365-2-jeremy.linton@arm.com> From: "Rafael J. Wysocki" Date: Thu, 28 Mar 2019 11:04:14 +0100 Message-ID: Subject: Re: [PATCH 1/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 , Sudeep Holla , James Morse , Lorenzo Pieralisi , Linuxarm 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 Tue, Mar 26, 2019 at 11:40 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. > > Signed-off-by: Jeremy Linton > --- > 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 065c4fc245d1..472c95ec816b 100644 > --- a/drivers/acpi/pptt.c > +++ b/drivers/acpi/pptt.c > @@ -660,3 +660,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() - Determine a unique implementation Maybe "Get a core architecture tag"? > + * @cpu: Kernel logical cpu number s/logical cpu/logical CPU/ please. > + * > + * Determine a unique heterogeneous ID for the given CPU. CPUs with the same > + * implementation should have matching IDs. Since this is a tree we can only > + * detect implementations where the heterogeneous flag is the parent to all > + * matching cores. AKA if a two socket machine has two different core types > + * in each socket this will end up being represented as four unique core types > + * rather than two. I find it quite difficult to parse that comment, honestly. AFAICS, the function returns a tag that will be the same for all cores with the same architecture in one package. That is, if the package is heterogeneous and there are two types of cores in it, there will be two different tags. Is this correct? > + * > + * The returned ID 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. > + * > + * 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 d5dcebd7aad3..1444fb042898 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h > @@ -1309,6 +1309,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) > @@ -1319,6 +1320,10 @@ static inline int find_acpi_cpu_topology_package(unsigned int cpu) > { > return -EINVAL; > } > +static 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.20.1 >