From patchwork Wed Jan 16 17:57:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10766593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 342AA1390 for ; Wed, 16 Jan 2019 17:59:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 252452F0EC for ; Wed, 16 Jan 2019 17:59:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 187482F0F2; Wed, 16 Jan 2019 17:59:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB73B2F0EC for ; Wed, 16 Jan 2019 17:59:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 745758E0004; Wed, 16 Jan 2019 12:59:39 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6A16C8E0002; Wed, 16 Jan 2019 12:59:39 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 541028E0004; Wed, 16 Jan 2019 12:59:39 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by kanga.kvack.org (Postfix) with ESMTP id 133568E0002 for ; Wed, 16 Jan 2019 12:59:39 -0500 (EST) Received: by mail-pf1-f198.google.com with SMTP id 75so5207514pfq.8 for ; Wed, 16 Jan 2019 09:59:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=lqRqlAUixHP/maDucUSoUigQ7wiAfswfBWQi2LO7g6Q=; b=OA5DqOzyQzql/ZDIJkcWp1BZbCDGe7CGyH5Xxwf1aPHuHJkBAJVwk/WpHBni2I/zu+ QSpRVSGmqZgsRq2SPkaxT3xypBZW9d/mOKJzIpAeM2Gp7a/JadgCRIiwVJkMgA7jddFY 52OtRl8c/YDJH0z6PANoKZKnJLmWonhzxonc6QEfNb8hN9uzTAzNnfxeM/YHRXV5xNAm UFCU0th5ywwHPoJdzeKoOceyMuiKK+zQtgvzpywYFEKVI4euicb3W8q0rAxJ7gMbO15q QTfjsdz1DtFFO0tNnNUZVVSuE72fHA8FCOrqGNBuNkXcZDA4k7/kmV1D7R6EnIMUedLo tsfA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of keith.busch@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=keith.busch@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: AJcUukdWDhsnaJMArCQZuvwz0lj/wi8KoeIZq2ZLymNBVFDqrbVeVlaO xzDbzTyeD+IKItMlUg4JjeLzwPrHoKq1YFNir+5zOvwqH8Yyj0YISVcFAP/ihlTLKMqsjZOmxDt cJcOjntNRBFLcBcdPI8z2IHcmQ2JKlHPG1b1eJujBLcBYvCqdT0nIXdhL6+Haigwm5Q== X-Received: by 2002:a62:5444:: with SMTP id i65mr11316076pfb.193.1547661578570; Wed, 16 Jan 2019 09:59:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN7aQp3eJfKpGuLY3eYgTBNGI41GrY6TX8sSQpD6+5Rp5wK48lDQnJ93aGYimmFmie6WDoOI X-Received: by 2002:a62:5444:: with SMTP id i65mr11316000pfb.193.1547661577430; Wed, 16 Jan 2019 09:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547661577; cv=none; d=google.com; s=arc-20160816; b=pBaGJkl+VlbX+xylVK3cJgk94aGrfvP58NtoEG6fhekfOkNHR+BgBNXtQwm1pZdNHY AGuEjHRwFllwp4dpD2v/d9vqc/TZaR1wFwYbwvs/BceSFlLRcQ3/6e8hLYwhEtTbuj/Z DpQd3lsbSI7SB5XvH7ba3ddRc7pF0tTl5pjIWZB4jLdya9zdEN7ul/MjePAs8sGZ64Eg Upvm5bFCBpB2N582xBhVb23Sw5RBvJ8XnlmAfb935wt/O+gPWU/yVrKaGQXrHUJuGmgq Lb3MVlhJG7B3DeBvv11x53+RHA7BHpS9LQm5uV2aehZ22GBkkkd8/zG7c9xwBItAO4kQ N+kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=lqRqlAUixHP/maDucUSoUigQ7wiAfswfBWQi2LO7g6Q=; b=sdWsTPdGgIptM8HAIKg8uTpssV3bcwrz3uWR2z8KXdhIzzV0waTHOtoON9h8d8MKML nDOJ5U1Z2tYbLIinheYA+6Qw5NZ+AVt5BsG0cc5mlg5fuWBnZVe4/IOxF9CsXi0kPH3K vjVdnuYEHL1U52zbZeaZ/+AfQWCl8arSKFlEIElk/PY/bxp1H5n2jckXgJYjExbs6Eba 7fIiGGG9HpNZZQqOVamiVPNJRRllvGJ9/BiaX5ZxUmBlyECmi69pLj50HJemL/fC+uOX Vj9ky3HMx/WWKkGLxRX3KmaZux06jRNSl5I5sPLSbCjn47KOPOQ5PlyEpy4hB/2Gz0O4 KB1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of keith.busch@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=keith.busch@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga01.intel.com (mga01.intel.com. [192.55.52.88]) by mx.google.com with ESMTPS id y8si6735247plr.92.2019.01.16.09.59.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 09:59:37 -0800 (PST) Received-SPF: pass (google.com: domain of keith.busch@intel.com designates 192.55.52.88 as permitted sender) client-ip=192.55.52.88; Authentication-Results: mx.google.com; spf=pass (google.com: domain of keith.busch@intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=keith.busch@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2019 09:59:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,487,1539673200"; d="scan'208";a="117227768" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.69]) by fmsmga008.fm.intel.com with ESMTP; 16 Jan 2019 09:59:36 -0800 From: Keith Busch To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org Cc: Greg Kroah-Hartman , Rafael Wysocki , Dave Hansen , Dan Williams , Keith Busch Subject: [PATCHv4 02/13] acpi: Add HMAT to generic parsing tables Date: Wed, 16 Jan 2019 10:57:53 -0700 Message-Id: <20190116175804.30196-3-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190116175804.30196-1-keith.busch@intel.com> References: <20190116175804.30196-1-keith.busch@intel.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The Heterogeneous Memory Attribute Table (HMAT) header has different field lengths than the existing parsing uses. Add the HMAT type to the parsing rules so it may be generically parsed. Cc: Dan Williams Reviewed-by: Rafael J. Wysocki Signed-off-by: Keith Busch --- drivers/acpi/tables.c | 9 +++++++++ include/linux/acpi.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 967e1168becf..d9911cd55edc 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -51,6 +51,7 @@ static int acpi_apic_instance __initdata; enum acpi_subtable_type { ACPI_SUBTABLE_COMMON, + ACPI_SUBTABLE_HMAT, }; struct acpi_subtable_entry { @@ -232,6 +233,8 @@ acpi_get_entry_type(struct acpi_subtable_entry *entry) switch (entry->type) { case ACPI_SUBTABLE_COMMON: return entry->hdr->common.type; + case ACPI_SUBTABLE_HMAT: + return entry->hdr->hmat.type; } return 0; } @@ -242,6 +245,8 @@ acpi_get_entry_length(struct acpi_subtable_entry *entry) switch (entry->type) { case ACPI_SUBTABLE_COMMON: return entry->hdr->common.length; + case ACPI_SUBTABLE_HMAT: + return entry->hdr->hmat.length; } return 0; } @@ -252,6 +257,8 @@ acpi_get_subtable_header_length(struct acpi_subtable_entry *entry) switch (entry->type) { case ACPI_SUBTABLE_COMMON: return sizeof(entry->hdr->common); + case ACPI_SUBTABLE_HMAT: + return sizeof(entry->hdr->hmat); } return 0; } @@ -259,6 +266,8 @@ acpi_get_subtable_header_length(struct acpi_subtable_entry *entry) static enum acpi_subtable_type __init acpi_get_subtable_type(char *id) { + if (strncmp(id, ACPI_SIG_HMAT, 4) == 0) + return ACPI_SUBTABLE_HMAT; return ACPI_SUBTABLE_COMMON; } diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 7c3c4ebaded6..53f93dff171c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -143,6 +143,7 @@ enum acpi_address_range_id { /* Table Handlers */ union acpi_subtable_headers { struct acpi_subtable_header common; + struct acpi_hmat_structure hmat; }; typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table);