提交 8ef18751 编写于 作者: K Keith Busch 提交者: Yang Yingliang

Intel: acpi: Add HMAT to generic parsing tables

mainline inclusion
from mainline-v5.2-rc1
commit 3bc0e8eb
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I47H3V
CVE: NA

--------------------------------

commit 3bc0e8eb upstream.

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.
Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Tested-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: NKeith Busch <keith.busch@intel.com>
Tested-by: NBrice Goglin <Brice.Goglin@inria.fr>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NFan Du <fan.du@intel.com>
Signed-off-by: NJackie Liu <liuyun01@kylinos.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8fa1f4e4
...@@ -52,6 +52,7 @@ static int acpi_apic_instance __initdata; ...@@ -52,6 +52,7 @@ static int acpi_apic_instance __initdata;
enum acpi_subtable_type { enum acpi_subtable_type {
ACPI_SUBTABLE_COMMON, ACPI_SUBTABLE_COMMON,
ACPI_SUBTABLE_HMAT,
}; };
struct acpi_subtable_entry { struct acpi_subtable_entry {
...@@ -233,6 +234,8 @@ acpi_get_entry_type(struct acpi_subtable_entry *entry) ...@@ -233,6 +234,8 @@ acpi_get_entry_type(struct acpi_subtable_entry *entry)
switch (entry->type) { switch (entry->type) {
case ACPI_SUBTABLE_COMMON: case ACPI_SUBTABLE_COMMON:
return entry->hdr->common.type; return entry->hdr->common.type;
case ACPI_SUBTABLE_HMAT:
return entry->hdr->hmat.type;
} }
return 0; return 0;
} }
...@@ -243,6 +246,8 @@ acpi_get_entry_length(struct acpi_subtable_entry *entry) ...@@ -243,6 +246,8 @@ acpi_get_entry_length(struct acpi_subtable_entry *entry)
switch (entry->type) { switch (entry->type) {
case ACPI_SUBTABLE_COMMON: case ACPI_SUBTABLE_COMMON:
return entry->hdr->common.length; return entry->hdr->common.length;
case ACPI_SUBTABLE_HMAT:
return entry->hdr->hmat.length;
} }
return 0; return 0;
} }
...@@ -253,6 +258,8 @@ acpi_get_subtable_header_length(struct acpi_subtable_entry *entry) ...@@ -253,6 +258,8 @@ acpi_get_subtable_header_length(struct acpi_subtable_entry *entry)
switch (entry->type) { switch (entry->type) {
case ACPI_SUBTABLE_COMMON: case ACPI_SUBTABLE_COMMON:
return sizeof(entry->hdr->common); return sizeof(entry->hdr->common);
case ACPI_SUBTABLE_HMAT:
return sizeof(entry->hdr->hmat);
} }
return 0; return 0;
} }
...@@ -260,6 +267,8 @@ acpi_get_subtable_header_length(struct acpi_subtable_entry *entry) ...@@ -260,6 +267,8 @@ acpi_get_subtable_header_length(struct acpi_subtable_entry *entry)
static enum acpi_subtable_type __init static enum acpi_subtable_type __init
acpi_get_subtable_type(char *id) acpi_get_subtable_type(char *id)
{ {
if (strncmp(id, ACPI_SIG_HMAT, 4) == 0)
return ACPI_SUBTABLE_HMAT;
return ACPI_SUBTABLE_COMMON; return ACPI_SUBTABLE_COMMON;
} }
......
...@@ -143,6 +143,7 @@ enum acpi_address_range_id { ...@@ -143,6 +143,7 @@ enum acpi_address_range_id {
/* Table Handlers */ /* Table Handlers */
union acpi_subtable_headers { union acpi_subtable_headers {
struct acpi_subtable_header common; struct acpi_subtable_header common;
struct acpi_hmat_structure hmat;
}; };
typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table); typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册