Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp561502imu; Thu, 20 Dec 2018 01:22:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/VOSpw9nmQ9W6DZQyUSrXQPbZ2qjxOcpLUOVKdIBUZpyLMk99go64oU6U7obGUo0ob3v0uu X-Received: by 2002:a17:902:8a91:: with SMTP id p17mr23412355plo.316.1545297770085; Thu, 20 Dec 2018 01:22:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545297770; cv=none; d=google.com; s=arc-20160816; b=TmAnmKuB3IEqCeEpGyNdc+r79WJAwYz+ALBTzTG+/00AEIBH9ltgETkbwPDXfrovF/ IMj9U5075twvM++HcDbvdB+DyzeXlMrRdXUNt7ZcssS3C1MCRQeG7R9mzF1gBrZghJT4 0QLe4GnzaV951rHP0MtTLsp50cnwk6Z21BlYWSXmWFtZFquElKnSgflBXW/3TlsM8y55 XF2u9AxSOn7+G/2uswphen1N0s24l5y9at10dHiKKlOlicX9cuBYK4gIQvzysXBfizYo MrQIDz6K5AZNJcIEGvHev7MPDwjto2KkN1vDegroG6n2zBKtctRwwzmhL7XnAvjafnCo M4Gg== 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=GEf+k5Uk0Mg9MUszfBZKGx3K/s+PTmCHTwwdSu6EEiw=; b=xokO+R9HivHjytBG2zhUnRA8I1GGa+3hLOoby4VxfPbXetqzRxVwVB/nRkxgyKXehZ LeTKWqWnS2RKwdf3OoqDEmjroXRNhDKAHNioUYH7wph1SYTu6JG+OjBXV1Xa2T2cAj+E 3H+j0fkub4UWOepQs6ferlvoaaAmpN9QAnrQ+7ZWRofSlCgXtuxNXhsQmpQVpGj3tvEA +7uhdxYT6vUL1uEIY/+07XSO1iyE6syY9ZPAeUk/H+yanZKfHNlzvzHHNNzYM/P6vzc+ Xkb98V59eC8nrZeL5kueCnDcoiFQKc0FUlNNpkxoAC/mVBv1opiM6KuXmMul/qreFJiS ID5A== 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 a185si17055317pge.404.2018.12.20.01.22.34; Thu, 20 Dec 2018 01:22:50 -0800 (PST) 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 S1729696AbeLTI5Z (ORCPT + 99 others); Thu, 20 Dec 2018 03:57:25 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:40342 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727159AbeLTI5Z (ORCPT ); Thu, 20 Dec 2018 03:57:25 -0500 Received: by mail-oi1-f196.google.com with SMTP id t204so766656oie.7; Thu, 20 Dec 2018 00:57:24 -0800 (PST) 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=GEf+k5Uk0Mg9MUszfBZKGx3K/s+PTmCHTwwdSu6EEiw=; b=s4SIsRyagOu12eOjzF80f4+h/ppUrSMXGnvhFkxoOHmSEDRG5mPfGQ1/HRjb+t+3fE hs8/3N1wz9umJjDAYmsQ6R70Ls+CyABC0sZjTgrlQwvtS3Al4Z7SFvPNYNLC9U6TUT6T rtYDLxODdfuccyeUpkERZSMsP+8HoLXh9+0vyVnXB6Xj0obFEa+l6avQRCY+PuBTB0OF Q0anen7vLzO6tz2HuyV5aHW8GhkqLOKV3C4t9odwrNpSJaRVfSkX86dta8QfItBlX+ei T8LolPNhN65QfV7AmunQzoR7aMkLW2lonGVfUG9+TaAmfKEjcvFWqRninX027RZ3YyI/ 4xdA== X-Gm-Message-State: AA+aEWaypqmtsZtxuY+kWaJufIHgNxVSyZ+6AyoG6QAASDFmz2CppBO5 2uNSCjE9BKo2iVBW8lOPZSCFNfPCu5Ugb3Z9Pa8= X-Received: by 2002:aca:3d42:: with SMTP id k63mr1408656oia.95.1545296243439; Thu, 20 Dec 2018 00:57:23 -0800 (PST) MIME-Version: 1.0 References: <20181211010310.8551-1-keith.busch@intel.com> <20181211010310.8551-2-keith.busch@intel.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 20 Dec 2018 09:57:11 +0100 Message-ID: Subject: Re: [PATCHv2 01/12] acpi: Create subtable parsing infrastructure To: "Schmauss, Erik" Cc: Dan Williams , "Rafael J. Wysocki" , Keith Busch , Robert Moore , Linux Kernel Mailing List , ACPI Devel Maling List , Linux Memory Management List , Greg Kroah-Hartman , Dave Hansen 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, Dec 20, 2018 at 2:15 AM Schmauss, Erik wrote: > > > > > -----Original Message----- > > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi- > > owner@vger.kernel.org] On Behalf Of Dan Williams > > Sent: Wednesday, December 19, 2018 4:00 PM > > To: Schmauss, Erik > > Cc: Rafael J. Wysocki ; Busch, Keith > > ; Moore, Robert ; > > Linux Kernel Mailing List ; ACPI Devel > > Maling List ; Linux Memory Management > > List ; Greg Kroah-Hartman > > ; Hansen, Dave > > > > Subject: Re: [PATCHv2 01/12] acpi: Create subtable parsing > > infrastructure > > > > On Wed, Dec 19, 2018 at 3:19 PM Schmauss, Erik > > wrote: > > > > > > > > > > > > > -----Original Message----- > > > > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi- > > > > owner@vger.kernel.org] On Behalf Of Rafael J. Wysocki > > > > Sent: Tuesday, December 11, 2018 1:45 AM > > > > To: Busch, Keith > > > > Cc: Linux Kernel Mailing List ; ACPI > > > > Devel Maling List ; Linux Memory > > > > Management List ; Greg Kroah-Hartman > > > > ; Rafael J. Wysocki > > ; > > > > Hansen, Dave ; Williams, Dan J > > > > > > > > Subject: Re: [PATCHv2 01/12] acpi: Create subtable parsing > > > > infrastructure > > > > > > > > On Tue, Dec 11, 2018 at 2:05 AM Keith Busch > > > > > > wrote: > > > > > > > > > > > Hi Rafael and Bob, > > > > > > > > Parsing entries in an ACPI table had assumed a generic header > > > > > structure that is most common. There is no standard ACPI > > header, > > > > > though, so less common types would need custom parsers if they > > > > > want go through their sub-table entry list. > > > > > > > > It looks like the problem at hand is that acpi_hmat_structure is > > > > incompatible with acpi_subtable_header because of the different > > layout and field sizes. > > > > > > Just out of curiosity, why don't we use ACPICA code to parse static > > > ACPI tables in Linux? > > > > > > We have a disassembler for static tables that parses all supported > > > tables. This seems like a duplication of code/effort... > > > Hi Dan, > > > Oh, I thought acpi_table_parse_entries() was the common code. > > What's the ACPICA duplicate? > > I was thinking AcpiDmDumpTable(). After looking at this ACPICA code, > I realized that the this ACPICA doesn't actually build a parse tree or data structure. > It loops over the data structure to format the input ACPI table to a file. > > To me, it seems like a good idea for Linux and ACPICA to share the same code when > parsing and analyzing these structures. I know that Linux may emit warnings > that are specific to Linux but there are structural analyses that should be the same (such as > checking lengths of tables and subtables so that we don't have out of bounds access). I agree. I guess the reason why it has not been done this way was because nobody thought about it. :-) So a project to consolidate these things might be a good one.