From: Dan Williams <dan.j.williams@intel.com>
To: akpm@linux-foundation.org
Cc: Keith Busch <keith.busch@intel.com>,
peterz@infradead.org, dave.hansen@linux.intel.com,
linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org,
mgorman@suse.de
Subject: [PATCH v6 2/6] acpi: Add HMAT to generic parsing tables
Date: Mon, 17 Dec 2018 20:23:33 -0800 [thread overview]
Message-ID: <154510701343.1941238.7745758103869136625.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <154510700291.1941238.817190985966612531.stgit@dwillia2-desk3.amr.corp.intel.com>
From: Keith Busch <keith.busch@intel.com>
The HMAT table header has different field lengths than the existing
parsing uses. Add the HMAT type to the parsing rules so it may be
generically parsed.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
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 e9643b4267c7..bc1addf715dc 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 18805a967c70..4373f5ba0f95 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);
next prev parent reply other threads:[~2018-12-18 4:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-18 4:23 [PATCH v6 0/6] mm: Randomize free memory Dan Williams
2018-12-18 4:23 ` [PATCH v6 1/6] acpi: Create subtable parsing infrastructure Dan Williams
2018-12-18 13:39 ` kbuild test robot
2018-12-18 4:23 ` Dan Williams [this message]
2018-12-18 4:23 ` [PATCH v6 3/6] acpi/numa: Set the memory-side-cache size in memblocks Dan Williams
2018-12-18 8:20 ` kbuild test robot
2018-12-18 4:23 ` [PATCH v6 4/6] mm: Shuffle initial free memory to improve memory-side-cache utilization Dan Williams
2018-12-18 6:30 ` kbuild test robot
2018-12-18 4:23 ` [PATCH v6 5/6] mm: Move buddy list manipulations into helpers Dan Williams
2018-12-18 4:23 ` [PATCH v6 6/6] mm: Maintain randomization of page free lists Dan Williams
2018-12-19 20:32 ` [PATCH v6 0/6] mm: Randomize free memory Michal Hocko
2018-12-19 20:55 ` Dan Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=154510701343.1941238.7745758103869136625.stgit@dwillia2-desk3.amr.corp.intel.com \
--to=dan.j.williams@intel.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@linux.intel.com \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).