Received: by 10.192.165.148 with SMTP id m20csp907046imm; Fri, 27 Apr 2018 09:22:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrx+Nq3lXRLfEOj7yMAMqkZG3yZlx8Yy1jg86BZyHwZhjv5eETM/rxaVHchQYaJ/y7Lzv4Z X-Received: by 2002:a65:52cc:: with SMTP id z12-v6mr2648123pgp.126.1524846132177; Fri, 27 Apr 2018 09:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524846132; cv=none; d=google.com; s=arc-20160816; b=izxG3nxg7hUw/idM5jYbT15wUSFqpy0ChQEmcJh3IoZAB/My3ziUBScjt7M+nafLtL zANLyeI4N5ruvqtPVChFCRqOfC91boeYbmnUfOfv0o13Cr4nwVSos1QHO3e+acTSvWYK uEcrdcNg0Cvxra7s7jV+oT8M7WHB2/fT/yF3D7NtpuhxmPFrjvDh+1JUWcLS7GnqFZH/ 2m5fqKelydNk9wkgH8UuoEON3PISVGujS6YKUkSjxbOxK5JNHwwDTryxjPguyES1qRyq aHWayIrh7wxKUPYPx5Kvi4HxxxNq6Bm4DdXhDmsbGWRHBSqi/pGqU6fokscsokdT3bjt pIsA== 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=zq/zg8nXLxpaa4APYi2plD38R/n15Lgjh6ZRiyS9fLg=; b=U5klQDmE83yIqLkDEucmlfKNaqk3OvqDI/21w7ta1SbGmZcw6aeyGcDJ07/gdrb6fD RPpDwhyVyHEBCWXk/h5bc/TTUxC7oXhcXYxUtQSDZ4zWkruN1tj9h9gfJVRQd2bI/9SC Cocobs/DiFBxcBe0OGK0hBooPO9AsMpGW9xHwlXOZat0NM8tl54YYThB5JEY6fxMc901 PxZLfb9fByV7Chqufg1LL4HRL7JBy0ZThxLjzXaJepr8qGhQeHcOlkxi6B5F38EgWHrI CIC9Rx5Mz/sbhP2iJMHduU0mEVP6BmR7OJFvnckrowCIKDvyXQDCTg2026eBZRYww6uN IXgg== 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 n2-v6si1477293plk.374.2018.04.27.09.21.57; Fri, 27 Apr 2018 09:22:12 -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 S932820AbeD0QUs (ORCPT + 99 others); Fri, 27 Apr 2018 12:20:48 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43438 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758565AbeD0QUr (ORCPT ); Fri, 27 Apr 2018 12:20:47 -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 9624D15AD; Fri, 27 Apr 2018 09:20:46 -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 4851C3F4FF; Fri, 27 Apr 2018 09:20:45 -0700 (PDT) Subject: Re: [PATCH v8 05/13] ACPI/PPTT: Add Processor Properties Topology Table parsing To: "Rafael J. Wysocki" Cc: ACPI Devel Maling List , Sudeep Holla , linux-arm-kernel@lists.infradead.org, Lorenzo Pieralisi , Hanjun Guo , "Rafael J. Wysocki" , Will Deacon , Catalin Marinas , Greg Kroah-Hartman , Mark Rutland , Linux Kernel Mailing List , linux-riscv@lists.infradead.org, wangxiongfeng2@huawei.com, vkilari@codeaurora.org, Al Stone , Dietmar Eggemann , Morten Rasmussen , palmer@sifive.com, Len Brown , John Garry , austinwc@codeaurora.org, tnowicki@caviumnetworks.com, jhugo@qti.qualcomm.com, timur@qti.qualcomm.com, Ard Biesheuvel References: <20180425233121.13270-1-jeremy.linton@arm.com> <20180425233121.13270-6-jeremy.linton@arm.com> From: Jeremy Linton Message-ID: Date: Fri, 27 Apr 2018 11:20:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: 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, Thanks for taking a look at this. On 04/27/2018 06:02 AM, Rafael J. Wysocki wrote: > On Thu, Apr 26, 2018 at 1:31 AM, Jeremy Linton wrote: >> ACPI 6.2 adds a new table, which describes how processing units >> are related to each other in tree like fashion. Caches are >> also sprinkled throughout the tree and describe the properties >> of the caches in relation to other caches and processing units. >> >> Add the code to parse the cache hierarchy and report the total >> number of levels of cache for a given core using >> acpi_find_last_cache_level() as well as fill out the individual >> cores cache information with cache_setup_acpi() once the >> cpu_cacheinfo structure has been populated by the arch specific >> code. >> >> An additional patch later in the set adds the ability to report >> peers in the topology using find_acpi_cpu_topology() >> to report a unique ID for each processing unit at a given level >> in the tree. These unique id's can then be used to match related >> processing units which exist as threads, within a given >> package, etc. >> >> Signed-off-by: Jeremy Linton >> Acked-by: Sudeep Holla >> --- >> drivers/acpi/pptt.c | 518 ++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 518 insertions(+) >> create mode 100644 drivers/acpi/pptt.c >> >> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c >> new file mode 100644 >> index 000000000000..cced71ef851a >> --- /dev/null >> +++ b/drivers/acpi/pptt.c >> @@ -0,0 +1,518 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> +/* >> + * pptt.c - parsing of Processor Properties Topology Table >> + * >> + * Copyright (C) 2018, ARM >> + * >> + * This file implements parsing of Processor Properties Topology Table (PPTT) >> + * which is optionally used to describe the processor and cache topology. >> + * Due to the relative pointers used throughout the table, this doesn't >> + * leverage the existing subtable parsing in the kernel. >> + * >> + * The PPTT structure is an inverted tree, with each node potentially >> + * holding one or two inverted tree data structures describing >> + * the caches available at that level. Each cache structure optionally >> + * contains properties describing the cache at a given level which can be >> + * used to override hardware probed values. >> + */ >> +#define pr_fmt(fmt) "ACPI PPTT: " fmt >> + >> +#include >> +#include >> +#include >> + >> +/** >> + * fetch_pptt_subtable() - Find/Verify that the PPTT ref is a valid subtable > > The parens above are at least redundant (if not harmful). Everywhere > else in a similar context too. The kerneldoc ones? I guess i'm confused the kernel doc example in doc-guide/kernel-doc has * function_name() - Brief description of function. > > Also kerneldoc comments document function arguments too as a rule, so > please do that here and wherever you use kerneldoc comments in the > patchset. Ok, sure. > >> + * >> + * Given the PPTT table, find and verify that the subtable entry >> + * is located within the table >> + * >> + * Return: acpi_subtable_header* or NULL >> + */ >> +static struct acpi_subtable_header *fetch_pptt_subtable(struct acpi_table_header *table_hdr, >> + u32 pptt_ref) >> +{ >> + struct acpi_subtable_header *entry; >> + >> + /* there isn't a subtable at reference 0 */ >> + if (pptt_ref < sizeof(struct acpi_subtable_header)) >> + return NULL; >> + >> + if (pptt_ref + sizeof(struct acpi_subtable_header) > table_hdr->length) >> + return NULL; >> + >> + entry = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr, pptt_ref); >> + >> + if (entry->length == 0) >> + return NULL; >> + >> + if (pptt_ref + entry->length > table_hdr->length) >> + return NULL; >> + >> + return entry; >> +} > > Apart from the above I'm not entirely sure why you need the changes in > patch [09/13] to go in a separate patch. All of them are new code > going into the file created by this patch, so why not to put them > here? Ok, I was doing that because Lorenzo asked for it, but he hasn't said much so I will collapse it back together. That makes me happy, as splitting chunks between patches is a pain anyway.