提交 d6ea81d3 编写于 作者: K Keith Busch 提交者: Joseph Qi

ICX: acpi/hmat: Register memory side cache attributes

commit d9e8844c7d8165d97848950ae6bf66b2be86ef06 upstream.

Register memory side cache attributes with the memory's node if HMAT
provides the side cache iniformation table.
Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.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: NJeffle Xu <jefflexu@linux.alibaba.com>
Acked-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Acked-by: NCaspar Zhang <caspar@linux.alibaba.com>
上级 f27fb08e
...@@ -314,6 +314,7 @@ static __init int hmat_parse_cache(union acpi_subtable_headers *header, ...@@ -314,6 +314,7 @@ static __init int hmat_parse_cache(union acpi_subtable_headers *header,
const unsigned long end) const unsigned long end)
{ {
struct acpi_hmat_cache *cache = (void *)header; struct acpi_hmat_cache *cache = (void *)header;
struct node_cache_attrs cache_attrs;
u32 attrs; u32 attrs;
if (cache->header.length < sizeof(*cache)) { if (cache->header.length < sizeof(*cache)) {
...@@ -327,6 +328,37 @@ static __init int hmat_parse_cache(union acpi_subtable_headers *header, ...@@ -327,6 +328,37 @@ static __init int hmat_parse_cache(union acpi_subtable_headers *header,
cache->memory_PD, cache->cache_size, attrs, cache->memory_PD, cache->cache_size, attrs,
cache->number_of_SMBIOShandles); cache->number_of_SMBIOShandles);
cache_attrs.size = cache->cache_size;
cache_attrs.level = (attrs & ACPI_HMAT_CACHE_LEVEL) >> 4;
cache_attrs.line_size = (attrs & ACPI_HMAT_CACHE_LINE_SIZE) >> 16;
switch ((attrs & ACPI_HMAT_CACHE_ASSOCIATIVITY) >> 8) {
case ACPI_HMAT_CA_DIRECT_MAPPED:
cache_attrs.indexing = NODE_CACHE_DIRECT_MAP;
break;
case ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING:
cache_attrs.indexing = NODE_CACHE_INDEXED;
break;
case ACPI_HMAT_CA_NONE:
default:
cache_attrs.indexing = NODE_CACHE_OTHER;
break;
}
switch ((attrs & ACPI_HMAT_WRITE_POLICY) >> 12) {
case ACPI_HMAT_CP_WB:
cache_attrs.write_policy = NODE_CACHE_WRITE_BACK;
break;
case ACPI_HMAT_CP_WT:
cache_attrs.write_policy = NODE_CACHE_WRITE_THROUGH;
break;
case ACPI_HMAT_CP_NONE:
default:
cache_attrs.write_policy = NODE_CACHE_WRITE_OTHER;
break;
}
node_add_cache(pxm_to_node(cache->memory_PD), &cache_attrs);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册