Received: by 10.192.165.148 with SMTP id m20csp570347imm; Fri, 27 Apr 2018 04:04:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoJH2AJAM7mYF0XxrZZnN2w8AVfDE6/lMLhEyWM060Kgb/RsDSporqG8vxaVR7PJ1iLmzFB X-Received: by 10.98.92.129 with SMTP id q123mr1811064pfb.252.1524827073252; Fri, 27 Apr 2018 04:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524827073; cv=none; d=google.com; s=arc-20160816; b=MVXX0r036BdDM1oyNNAU+o6DsQOpgjcNOBr13iip5RNkra/+ZI7xD4p8OhXQeLu7Hv pFrJQd55AFvNEd+t/mFrPVzBPk/x5gPDJ9Gt/5Nw8K39V3IlrWeLEbzkez5TyW8Dtq4k VCGTBregOvBMZhpvSj+SV7qKTDbDNcGSiHJEsM0+Pb6bbL1jj2PWu790Vx0RwoH6OlUp Y0we+8bsbFS2EAifDKZjqBLmANZ4RLdd+1tbOFQAKW8bn67WfJ9wLOkTFObETfKp8p9R j8NZ5dDM350Gjkq/Zul+blLHg/qI+nRHo11pb/bGnnJUBSbZV6srObKMqJqnG+Y3/rD+ c4WQ== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=5IWXSQqECrIdnnHYoOzlvgdver40YzbTuKYT6WPs8Qc=; b=uCIcz1jlVdg19bWT0r459dj4KEZP2xPT7dE7v0SOj0WpAOd2fB6+rylfj6AOADjA0e 0z8QGix7llouOk1yq63hb00+ek2qP1WHijDusn4lxBVjF/ou/ouhhIrAZ5j16RBnHX0H atVOEtNrz5kMbagNxS9ICts+5fc496k/b2QkvI3TXxxJ3yfiPi+BNQwhlGzuZT+OELbz eygo3kZvNLTklBsWTK7x1Z9ZY9keSN4Qu2i0VywBQGdwIM7JBzjaFrtQ0Zvsclq4FYUY IWPTlQBHOIAUX17OOrQUfA1xkafOsDrW4JCTn3/3LcLtStyAPSdR78/UBoNcFrDcaE+K Pubw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=S2Nv2JDM; 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 i62si1063651pfg.218.2018.04.27.04.04.19; Fri, 27 Apr 2018 04:04: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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=S2Nv2JDM; 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 S932772AbeD0LCJ (ORCPT + 99 others); Fri, 27 Apr 2018 07:02:09 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:35100 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932415AbeD0LCC (ORCPT ); Fri, 27 Apr 2018 07:02:02 -0400 Received: by mail-oi0-f68.google.com with SMTP id a6-v6so1212472oia.2; Fri, 27 Apr 2018 04:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5IWXSQqECrIdnnHYoOzlvgdver40YzbTuKYT6WPs8Qc=; b=S2Nv2JDMzvY9ldVd5K7sff05y1HcuzOPEHd8CSsyYnmDof1Xc1eLgh6E5Km5INSbX8 RX4tOKfWUPqud85q28dX74zqQaBuQREsHNK6xWFFyqy0tezsjlE790G6CIlGSu/IIEB+ jESKPJl3DrCNboadZQNFQXgFWxQp1B1vVsitqrr/ReLyvy9MeIvrqCwu4a6XW06wmkXP RazK/W2LQQ0dWIh9VrJGyPuQMuzKUTRd9Ml0V8o0F8gcI+FuY8WS3HedKQHAMeMkh/8y JVW3fEIOyqcS+XtJsY/yDp7KXi1fmH+OVCXMIGqJx4qt0FXyFMkNiM3bfB2I9pj/y7T6 yJDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=5IWXSQqECrIdnnHYoOzlvgdver40YzbTuKYT6WPs8Qc=; b=JjGzqf8BC6GHg0dANIKHtDt+q7WLoYXvEkEGHNY5Og/CSYnqsGxqrCtWd6qUTrHKjM sNmKtjWkNAHsOsDsroocw2lGWcMxE3iBZOuskszlMR7l6Mjlxr1hZrHGp5AtX7k/aKqe QLpTJgB5LnkNL3v8cla3dxERnEYxpZE6/H0qPPBinA76Z2B1QXZ0SIUWc+099P2w/C0V f7Q+loqURYc2ymGw//y+0tHRuPr7ugFNn3osdZRzM7DAb2Gc2bvb/X/UYklePN/8676S cM/zxsNLtgI1wqZ6uyll90W4uc0e6Lai3qOIJ7WDeFO2gbGQS2ahTcTQlwjDzxa64W9f MSPw== X-Gm-Message-State: ALQs6tCVEkiHftptUTgxtD6BatCazQ804Oe4i3ZRUOjOydhW/9xZDJj8 KkLj5eMMSpS6AQjuIAjs18qSbPJKKqTyrRAAIDE= X-Received: by 2002:aca:ea46:: with SMTP id i67-v6mr1003892oih.174.1524826921190; Fri, 27 Apr 2018 04:02:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1468:0:0:0:0:0 with HTTP; Fri, 27 Apr 2018 04:02:00 -0700 (PDT) In-Reply-To: <20180425233121.13270-6-jeremy.linton@arm.com> References: <20180425233121.13270-1-jeremy.linton@arm.com> <20180425233121.13270-6-jeremy.linton@arm.com> From: "Rafael J. Wysocki" Date: Fri, 27 Apr 2018 13:02:00 +0200 X-Google-Sender-Auth: q4s-HptTLEAo68JCKXZdCW0wL4A Message-ID: Subject: Re: [PATCH v8 05/13] ACPI/PPTT: Add Processor Properties Topology Table parsing To: Jeremy Linton 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 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 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. Also kerneldoc comments document function arguments too as a rule, so please do that here and wherever you use kerneldoc comments in the patchset. > + * > + * 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?