Skip to contentSkip to conversation

acpi/hmat: ACPI_HMAT_MEMORY_PD_VALID is deprecated in ACPI-6.3

PATCH Applied Daniel Black 4 participants 6 messages Aug 6, 2019 – Oct 10, 2019 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi/hmat: ACPI_HMAT_MEMORY_PD_VALID is deprecated in ACPI-6.3

ACPI-6.3 corresponds to when hmat revision was bumped from 1 to 2. In this version ACPI_HMAT_MEMORY_PD_VALID was deprecated and made reserved.

As such in revision 2+ we shouldn't be testing this flag.

This is as per ACPI-6.3, 5.2.27.3, Table 5-145 "Memory Proximity Domain Attributes Structure" for Flags.

---
 drivers/acpi/hmat/hmat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/hmat/hmat.c +1 -1
index 96b7d39a97c6..e938e34673d9 100644
@@ -382,7 +382,7 @@ static int __init hmat_parse_proximity_domain(union acpi_subtable_headers *heade
 		pr_info("HMAT: Memory Flags:%04x Processor Domain:%d Memory Domain:%d\n",
 			p->flags, p->processor_PD, p->memory_PD);
 
-	if (p->flags & ACPI_HMAT_MEMORY_PD_VALID) {
+	if (p->flags & ACPI_HMAT_MEMORY_PD_VALID && hmat_revision == 1) {
 		target = find_mem_target(p->memory_PD);
 		if (!target) {
 			pr_debug("HMAT: Memory Domain missing from SRAT\n");
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Daniel Black

ACPI-6.3 corresponds to when hmat revision was bumped from 1 to 2. In this version ACPI_HMAT_MEMORY_PD_VALID was deprecated and made reserved.

As such in revision 2+ we shouldn't be testing this flag.

This is as per ACPI-6.3, 5.2.27.3, Table 5-145 "Memory Proximity Domain Attributes Structure" for Flags.

Looks good to me.

Quoted 20 lines
---
  drivers/acpi/hmat/hmat.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/hmat/hmat.c +1 -1
index 96b7d39a97c6..e938e34673d9 100644
@@ -382,7 +382,7 @@ static int __init hmat_parse_proximity_domain(union acpi_subtable_headers *heade
  		pr_info("HMAT: Memory Flags:%04x Processor Domain:%d Memory Domain:%d\n",
  			p->flags, p->processor_PD, p->memory_PD);
 
-	if (p->flags & ACPI_HMAT_MEMORY_PD_VALID) {
+	if (p->flags & ACPI_HMAT_MEMORY_PD_VALID && hmat_revision == 1) {
  		target = find_mem_target(p->memory_PD);
  		if (!target) {
  			pr_debug("HMAT: Memory Domain missing from SRAT\n");
#2 lore raw
In reply to Daniel Black
Quoted 5 lines · Daniel Black

ACPI-6.3 corresponds to when hmat revision was bumped from 1 to 2. In this version ACPI_HMAT_MEMORY_PD_VALID was deprecated and made reserved.

Quoted 7 lines

As such in revision 2+ we shouldn't be testing this flag.

This is as per ACPI-6.3, 5.2.27.3, Table 5-145 "Memory Proximity Domain Attributes Structure" for Flags.

Keith, any comments?

Quoted 20 lines
---
 drivers/acpi/hmat/hmat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/hmat/hmat.c +1 -2
index 96b7d39a97c6..e938e34673d9 100644
@@ -382,7 +382,7 @@ static int __init hmat_parse_proximity_domain(union acpi_subtable_headers *heade
                pr_info("HMAT: Memory Flags:%04x Processor Domain:%d Memory Domain:%d\n",
                        p->flags, p->processor_PD, p->memory_PD);
 
-       if (p->flags & ACPI_HMAT_MEMORY_PD_VALID) {
+       if (p->flags & ACPI_HMAT_MEMORY_PD_VALID && hmat_revision == 1) {
                target = find_mem_target(p->memory_PD);
                if (!target) {
                        pr_debug("HMAT: Memory Domain missing from SRAT\n");
--

2.21.0

#3 lore raw
Quoted 8 lines · On Mon, 2 Sep 2019 23:28:50 +0200 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 7 lines · Daniel Black

ACPI-6.3 corresponds to when hmat revision was bumped from 1 to 2. In this version ACPI_HMAT_MEMORY_PD_VALID was deprecated and made reserved.

As such in revision 2+ we shouldn't be testing this flag.

Quoted 7 lines
Quoted 5 lines

This is as per ACPI-6.3, 5.2.27.3, Table 5-145 "Memory Proximity Domain Attributes Structure" for Flags.

Keith, any comments?

FYI this was found when I was testing Tao Xu's qemu implementation of HMAT ACPI-6.3 which has no implementation of ACPI_HMAT_MEMORY_PD_VALID.

Current patch implementing Memory Proximity Domain Attributes Structure:
https://patchwork.kernel.org/patch/11125301/

#4 lore raw
Quoted 23 lines · On Tue, 3 Sep 2019 11:03:45 +1000 Daniel Black <[email protected]> wrote:
Quoted 8 lines · On Mon, 2 Sep 2019 23:28:50 +0200 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 7 lines · Daniel Black

ACPI-6.3 corresponds to when hmat revision was bumped from 1 to 2. In this version ACPI_HMAT_MEMORY_PD_VALID was deprecated and made reserved.

As such in revision 2+ we shouldn't be testing this flag.

Quoted 7 lines
Quoted 5 lines

This is as per ACPI-6.3, 5.2.27.3, Table 5-145 "Memory Proximity Domain Attributes Structure" for Flags.

Keith, any comments?

FYI this was found when I was testing Tao Xu's qemu implementation of HMAT ACPI-6.3 which has no implementation of ACPI_HMAT_MEMORY_PD_VALID.

Current patch implementing Memory Proximity Domain Attributes Structure:
https://patchwork.kernel.org/patch/11125301/

Quoted 4 lines · On Mon, 12 Aug 2019 16:03:15 +0800 Tao Xu <[email protected]> wrote:

Looks good to me.

Ping. Any comments?

#5 lore raw
In reply to Daniel Black
Quoted 21 lines · CEST Daniel Black

ACPI-6.3 corresponds to when hmat revision was bumped from 1 to 2. In this version ACPI_HMAT_MEMORY_PD_VALID was deprecated and made reserved.

As such in revision 2+ we shouldn't be testing this flag.

This is as per ACPI-6.3, 5.2.27.3, Table 5-145 "Memory Proximity Domain Attributes Structure" for Flags.

---
 drivers/acpi/hmat/hmat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/hmat/hmat.c +0 -0
index 96b7d39a97c6..e938e34673d9 100644

drivers/acpi/hmat/hmat.c static int __init hmat_parse_proximity_domain(union acpi_subtable_headers *heade · line 388

Quoted 8 lines
drivers/acpi/hmat/hmat.c +1 -1
@@ -382,7 +382,7 @@ static int __init hmat_parse_proximity_domain(union acpi_subtable_headers *heade
 		pr_info("HMAT: Memory Flags:%04x Processor Domain:%d Memory Domain:%d\n",
 			p->flags, p->processor_PD, p->memory_PD);
 
-	if (p->flags & ACPI_HMAT_MEMORY_PD_VALID) {
+	if (p->flags & ACPI_HMAT_MEMORY_PD_VALID && hmat_revision == 1) {
 		target = find_mem_target(p->memory_PD);
 		if (!target) {
 			pr_debug("HMAT: Memory Domain missing from SRAT\n");

Applied as a fix for 5.4, thanks!