Skip to contentSkip to conversation

ACPI: PPTT: Dump PPTT table when error detected

PATCH In review Feng Tang 4 participants 19 messages Dec 31, 2025 – Jan 15 ACPI

lore
Share & tools
lore

Feng Tang

author
#0 lore raw

PATCH v2 1/1 ACPI: PPTT: Dump PPTT table when error detected

There was warning message about PPTT table:

"ACPI PPTT: PPTT table found, but unable to locate core 1 (1)",

and it in turn caused scheduler warnings when building up the system. It took a while to root cause the problem be related a broken PPTT table which has wrong cache information.

To speedup debugging similar issues, dump the PPTT table, which makes the warning more noticeable and helps bug hunting.

The dumped info format on a ARM server is like:

    ACPI PPTT: Processors:
    P[  0][0x0024]: parent=0x0000 acpi_proc_id=  0 num_res=1 flags=0x11(package)
    P[  1][0x005a]: parent=0x0024 acpi_proc_id=  0 num_res=1 flags=0x12()
    P[  2][0x008a]: parent=0x005a acpi_proc_id=  0 num_res=3 flags=0x1a(leaf)
    P[  3][0x00f2]: parent=0x005a acpi_proc_id=  1 num_res=3 flags=0x1a(leaf)
    P[  4][0x015a]: parent=0x005a acpi_proc_id=  2 num_res=3 flags=0x1a(leaf)
    ...
    ACPI PPTT: Caches:
    C[   0][0x0072]: flags=0x7f next_level=0x0000 size=0x4000000  sets=65536  way=16 attribute=0xa  line_size=64
    C[   1][0x00aa]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x4  line_size=64
    C[   2][0x00c2]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x2  line_size=64
    C[   3][0x00da]: flags=0x7f next_level=0x0000 size=0x100000   sets=2048   way=8  attribute=0xa  line_size=64
    ...

It provides a global and straightforward view of the hierarchy of the processor and caches info of the platform, and from the offset info (the 3rd column), the child-parent relation could be checked.

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

---
Changelog:

v2
* rebase againt 6.19 and refine the commit log

 drivers/acpi/pptt.c | 75 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)
drivers/acpi/pptt.c +75 -0
index de5f8c018333..e00abedcd786 100644
@@ -529,6 +529,79 @@ static void acpi_pptt_warn_missing(void)
 	pr_warn_once("No PPTT table found, CPU and cache topology may be inaccurate\n");
 }
 
+static void acpi_dump_pptt_table(struct acpi_table_header *table_hdr)
+{
+	struct acpi_subtable_header *entry, *entry_start;
+	unsigned long end;
+	struct acpi_pptt_processor *cpu;
+	struct acpi_pptt_cache *cache;
+	u32 entry_sz, i;
+	u8 len;
+	static bool dumped;
+
+	/* PPTT table could be pretty big, no need to dump it twice */
+	if (dumped)
+		return;
+	dumped = true;
+
+	end = (unsigned long)table_hdr + table_hdr->length;
+	entry_start = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,
+			     sizeof(struct acpi_table_pptt));
+
+	pr_info("Processors:\n");
+	entry_sz = sizeof(struct acpi_pptt_processor);
+	entry = entry_start;
+	i = 0;
+	while ((unsigned long)entry + entry_sz <= end) {
+		len = entry->length;
+		if (!len) {
+			pr_warn("Invalid zero length subtable\n");
+			return;
+		}
+
+		cpu = (struct acpi_pptt_processor *)entry;
+		entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry, len);
+
+		if (cpu->header.type != ACPI_PPTT_TYPE_PROCESSOR)
+			continue;
+
+		printk(KERN_INFO "P[%3d][0x%04lx]: parent=0x%04x acpi_proc_id=%3d num_res=%d flags=0x%02x(%s%s%s)\n",
+			i++, (unsigned long)cpu - (unsigned long)table_hdr,
+			cpu->parent, cpu->acpi_processor_id,
+			cpu->number_of_priv_resources, cpu->flags,
+			cpu->flags & ACPI_PPTT_PHYSICAL_PACKAGE ? "package" : "",
+			cpu->flags & ACPI_PPTT_ACPI_LEAF_NODE ? "leaf" : "",
+			cpu->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD ? ", thread" : ""
+			);
+
+	}
+
+	pr_info("Caches:\n");
+	entry_sz = sizeof(struct acpi_pptt_cache);
+	entry = entry_start;
+	i = 0;
+	while ((unsigned long)entry + entry_sz <= end) {
+		len = entry->length;
+		if (!len) {
+			pr_warn("Invalid zero length subtable\n");
+			return;
+		}
+
+		cache = (struct acpi_pptt_cache *)entry;
+		entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry, len);
+
+		if (cache->header.type != ACPI_PPTT_TYPE_CACHE)
+			continue;
+
+		printk(KERN_INFO "C[%4d][0x%04lx]: flags=0x%02x next_level=0x%04x size=0x%-8x sets=%-6d way=%-2d attribute=0x%-2x line_size=%d\n",
+			i++, (unsigned long)cache - (unsigned long)table_hdr,
+			cache->flags, cache->next_level_of_cache, cache->size,
+			cache->number_of_sets, cache->associativity,
+			cache->attributes, cache->line_size
+			);
+	}
+}
+
 /**
  * topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
  * @table: Pointer to the head of the PPTT table
@@ -565,6 +638,8 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
 	}
 	pr_warn_once("PPTT table found, but unable to locate core %d (%d)\n",
 		    cpu, acpi_cpu_id);
+
+	acpi_dump_pptt_table(table);
 	return -ENOENT;
 }
 

base-commit: c8ebd433459bcbf068682b09544e830acd7ed222

Signature · 1 line
2.39.5 (Apple Git-154)
#1 lore raw

Hi Feng Tang,

Quoted 10 lines · Feng Tang

There was warning message about PPTT table:

"ACPI PPTT: PPTT table found, but unable to locate core 1 (1)",

and it in turn caused scheduler warnings when building up the system. It took a while to root cause the problem be related a broken PPTT table which has wrong cache information.

To speedup debugging similar issues, dump the PPTT table, which makes the warning more noticeable and helps bug hunting.

Agreed, I think it was useful for debugging.

Quoted 17 lines

The dumped info format on a ARM server is like:

     ACPI PPTT: Processors:
     P[  0][0x0024]: parent=0x0000 acpi_proc_id=  0 num_res=1 flags=0x11(package)
     P[  1][0x005a]: parent=0x0024 acpi_proc_id=  0 num_res=1 flags=0x12()
     P[  2][0x008a]: parent=0x005a acpi_proc_id=  0 num_res=3 flags=0x1a(leaf)
     P[  3][0x00f2]: parent=0x005a acpi_proc_id=  1 num_res=3 flags=0x1a(leaf)
     P[  4][0x015a]: parent=0x005a acpi_proc_id=  2 num_res=3 flags=0x1a(leaf)
     ...
     ACPI PPTT: Caches:
     C[   0][0x0072]: flags=0x7f next_level=0x0000 size=0x4000000  sets=65536  way=16 attribute=0xa  line_size=64
     C[   1][0x00aa]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x4  line_size=64
     C[   2][0x00c2]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x2  line_size=64
     C[   3][0x00da]: flags=0x7f next_level=0x0000 size=0x100000   sets=2048   way=8  attribute=0xa  line_size=64
     ...
Quoted 7 lines

It provides a global and straightforward view of the hierarchy of the processor and caches info of the platform, and from the offset info (the 3rd column), the child-parent relation could be checked.

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

Just a discussion, can we just dump the raw PPTT table via acpidump in user space when we meet the problem? With the raw PPTT table, we can go though the content to see if we have problems.

Quoted 46 lines

---
Changelog:

v2
* rebase againt 6.19 and refine the commit log

  drivers/acpi/pptt.c | 75 +++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 75 insertions(+)
drivers/acpi/pptt.c +27 -0
index de5f8c018333..e00abedcd786 100644
@@ -529,6 +529,79 @@ static void acpi_pptt_warn_missing(void)
  	pr_warn_once("No PPTT table found, CPU and cache topology may be inaccurate\n");
  }
 
+static void acpi_dump_pptt_table(struct acpi_table_header *table_hdr)
+{
+	struct acpi_subtable_header *entry, *entry_start;
+	unsigned long end;
+	struct acpi_pptt_processor *cpu;
+	struct acpi_pptt_cache *cache;
+	u32 entry_sz, i;
+	u8 len;
+	static bool dumped;
+
+	/* PPTT table could be pretty big, no need to dump it twice */
+	if (dumped)
+		return;
+	dumped = true;
+
+	end = (unsigned long)table_hdr + table_hdr->length;
+	entry_start = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,
+			     sizeof(struct acpi_table_pptt));
+
+	pr_info("Processors:\n");
+	entry_sz = sizeof(struct acpi_pptt_processor);
+	entry = entry_start;
+	i = 0;
+	while ((unsigned long)entry + entry_sz <= end) {
+		len = entry->length;
+		if (!len) {
+			pr_warn("Invalid zero length subtable\n");

drivers/acpi/pptt.c static void acpi_pptt_warn_missing(void) · line 568

Quoted 10 lines
drivers/acpi/pptt.c +10 -0
+			return;
+		}
+
+		cpu = (struct acpi_pptt_processor *)entry;
+		entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry, len);
+
+		if (cpu->header.type != ACPI_PPTT_TYPE_PROCESSOR)
+			continue;
+
+		printk(KERN_INFO "P[%3d][0x%04lx]: parent=0x%04x acpi_proc_id=%3d num_res=%d flags=0x%02x(%s%s%s)\n",

pr_info() please.

Quoted 18 lines
drivers/acpi/pptt.c +18 -0
+			i++, (unsigned long)cpu - (unsigned long)table_hdr,
+			cpu->parent, cpu->acpi_processor_id,
+			cpu->number_of_priv_resources, cpu->flags,
+			cpu->flags & ACPI_PPTT_PHYSICAL_PACKAGE ? "package" : "",
+			cpu->flags & ACPI_PPTT_ACPI_LEAF_NODE ? "leaf" : "",
+			cpu->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD ? ", thread" : ""
+			);
+
+	}
+
+	pr_info("Caches:\n");
+	entry_sz = sizeof(struct acpi_pptt_cache);
+	entry = entry_start;
+	i = 0;
+	while ((unsigned long)entry + entry_sz <= end) {
+		len = entry->length;
+		if (!len) {
+			pr_warn("Invalid zero length subtable\n");

drivers/acpi/pptt.c static void acpi_pptt_warn_missing(void) · line 596

Quoted 10 lines
drivers/acpi/pptt.c +10 -0
+			return;
+		}
+
+		cache = (struct acpi_pptt_cache *)entry;
+		entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry, len);
+
+		if (cache->header.type != ACPI_PPTT_TYPE_CACHE)
+			continue;
+
+		printk(KERN_INFO "C[%4d][0x%04lx]: flags=0x%02x next_level=0x%04x size=0x%-8x sets=%-6d way=%-2d attribute=0x%-2x line_size=%d\n",

Same here.

Quoted 12 lines
drivers/acpi/pptt.c +8 -0
+			i++, (unsigned long)cache - (unsigned long)table_hdr,
+			cache->flags, cache->next_level_of_cache, cache->size,
+			cache->number_of_sets, cache->associativity,
+			cache->attributes, cache->line_size
+			);
+	}
+}
+
  /**
   * topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
   * @table: Pointer to the head of the PPTT table

drivers/acpi/pptt.c static int topology_get_acpi_cpu_tag(struct acpi_table_header *table, · line 642

Quoted 5 lines
drivers/acpi/pptt.c +2 -0
@@ -565,6 +638,8 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
  	}
  	pr_warn_once("PPTT table found, but unable to locate core %d (%d)\n",
  		    cpu, acpi_cpu_id);
+
+	acpi_dump_pptt_table(table);

I think it would be good to dump it as needed, as a debug feature.

Thanks
Hanjun

author
#2 lore raw

Hi Hanjun,

Thanks for the review!

Quoted 37 lines · Hanjun Guo

Hi Feng Tang,

Quoted 10 lines · Feng Tang

There was warning message about PPTT table:

"ACPI PPTT: PPTT table found, but unable to locate core 1 (1)",

and it in turn caused scheduler warnings when building up the system. It took a while to root cause the problem be related a broken PPTT table which has wrong cache information.

To speedup debugging similar issues, dump the PPTT table, which makes the warning more noticeable and helps bug hunting.

Agreed, I think it was useful for debugging.

Quoted 21 lines

The dumped info format on a ARM server is like:

     ACPI PPTT: Processors:
     P[  0][0x0024]: parent=0x0000 acpi_proc_id=  0 num_res=1 flags=0x11(package)
     P[  1][0x005a]: parent=0x0024 acpi_proc_id=  0 num_res=1 flags=0x12()
     P[  2][0x008a]: parent=0x005a acpi_proc_id=  0 num_res=3 flags=0x1a(leaf)
     P[  3][0x00f2]: parent=0x005a acpi_proc_id=  1 num_res=3 flags=0x1a(leaf)
     P[  4][0x015a]: parent=0x005a acpi_proc_id=  2 num_res=3 flags=0x1a(leaf)
     ...
     ACPI PPTT: Caches:
     C[   0][0x0072]: flags=0x7f next_level=0x0000 size=0x4000000  sets=65536  way=16 attribute=0xa  line_size=64
     C[   1][0x00aa]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x4  line_size=64
     C[   2][0x00c2]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x2  line_size=64
     C[   3][0x00da]: flags=0x7f next_level=0x0000 size=0x100000   sets=2048   way=8  attribute=0xa  line_size=64
     ...

It provides a global and straightforward view of the hierarchy of the processor and caches info of the platform, and from the offset info (the 3rd column), the child-parent relation could be checked.

Quoted 7 lines
Quoted 3 lines

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

Just a discussion, can we just dump the raw PPTT table via acpidump in user space when we meet the problem? With the raw PPTT table, we can go though the content to see if we have problems.

Good point! We can use iasl to decode the PPTT table. And this dump is still useful as:
* when enabling new silicon or new firmware (APCI tables), sometimes it can't make to boot to user space when the issue happens.
* This dump shows the processor and cache items separately and cleanly, while the P[]/C[] index imply the numbers. In an 128 core product ARM sever, the print with this patch is about 500 line, while the acpidump is about 10,000 lines and harder to parse.

Quoted 50 lines
Quoted 50 lines

---
Changelog:

v2
* rebase againt 6.19 and refine the commit log

  drivers/acpi/pptt.c | 75 +++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 75 insertions(+)
drivers/acpi/pptt.c +31 -0
index de5f8c018333..e00abedcd786 100644
@@ -529,6 +529,79 @@ static void acpi_pptt_warn_missing(void)
  	pr_warn_once("No PPTT table found, CPU and cache topology may be inaccurate\n");
  }
+static void acpi_dump_pptt_table(struct acpi_table_header *table_hdr)
+{
+	struct acpi_subtable_header *entry, *entry_start;
+	unsigned long end;
+	struct acpi_pptt_processor *cpu;
+	struct acpi_pptt_cache *cache;
+	u32 entry_sz, i;
+	u8 len;
+	static bool dumped;
+
+	/* PPTT table could be pretty big, no need to dump it twice */
+	if (dumped)
+		return;
+	dumped = true;
+
+	end = (unsigned long)table_hdr + table_hdr->length;
+	entry_start = ACPI_ADD_PTR(struct acpi_subtable_header, table_hdr,
+			     sizeof(struct acpi_table_pptt));
+
+	pr_info("Processors:\n");
+	entry_sz = sizeof(struct acpi_pptt_processor);
+	entry = entry_start;
+	i = 0;
+	while ((unsigned long)entry + entry_sz <= end) {
+		len = entry->length;
+		if (!len) {
+			pr_warn("Invalid zero length subtable\n");
+			return;
+		}
+
+		cpu = (struct acpi_pptt_processor *)entry;
Quoted 8 lines

drivers/acpi/pptt.c static void acpi_pptt_warn_missing(void) · line 568

Quoted 6 lines
drivers/acpi/pptt.c +6 -0
+		entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry, len);
+
+		if (cpu->header.type != ACPI_PPTT_TYPE_PROCESSOR)
+			continue;
+
+		printk(KERN_INFO "P[%3d][0x%04lx]: parent=0x%04x acpi_proc_id=%3d num_res=%d flags=0x%02x(%s%s%s)\n",

pr_info() please.

Will change.

Quoted 22 lines
Quoted 22 lines
drivers/acpi/pptt.c +22 -0
+			i++, (unsigned long)cpu - (unsigned long)table_hdr,
+			cpu->parent, cpu->acpi_processor_id,
+			cpu->number_of_priv_resources, cpu->flags,
+			cpu->flags & ACPI_PPTT_PHYSICAL_PACKAGE ? "package" : "",
+			cpu->flags & ACPI_PPTT_ACPI_LEAF_NODE ? "leaf" : "",
+			cpu->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD ? ", thread" : ""
+			);
+
+	}
+
+	pr_info("Caches:\n");
+	entry_sz = sizeof(struct acpi_pptt_cache);
+	entry = entry_start;
+	i = 0;
+	while ((unsigned long)entry + entry_sz <= end) {
+		len = entry->length;
+		if (!len) {
+			pr_warn("Invalid zero length subtable\n");
+			return;
+		}
+
+		cache = (struct acpi_pptt_cache *)entry;
Quoted 8 lines

drivers/acpi/pptt.c static void acpi_pptt_warn_missing(void) · line 596

Quoted 6 lines
drivers/acpi/pptt.c +6 -0
+		entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry, len);
+
+		if (cache->header.type != ACPI_PPTT_TYPE_CACHE)
+			continue;
+
+		printk(KERN_INFO "C[%4d][0x%04lx]: flags=0x%02x next_level=0x%04x size=0x%-8x sets=%-6d way=%-2d attribute=0x%-2x line_size=%d\n",

Same here.

Yes.

Quoted 11 lines
Quoted 11 lines
drivers/acpi/pptt.c +8 -0
+			i++, (unsigned long)cache - (unsigned long)table_hdr,
+			cache->flags, cache->next_level_of_cache, cache->size,
+			cache->number_of_sets, cache->associativity,
+			cache->attributes, cache->line_size
+			);
+	}
+}
+
  /**
   * topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
   * @table: Pointer to the head of the PPTT table
Quoted 8 lines

drivers/acpi/pptt.c static int topology_get_acpi_cpu_tag(struct acpi_table_header *table, · line 642

Quoted 6 lines
drivers/acpi/pptt.c +2 -0
@@ -565,6 +638,8 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
  	}
  	pr_warn_once("PPTT table found, but unable to locate core %d (%d)\n",
  		    cpu, acpi_cpu_id);
+
+	acpi_dump_pptt_table(table);

I think it would be good to dump it as needed, as a debug feature.

Makes sense to me. Should I add a kernel config option or a module parameter for it, or just change the pr_info to pr_debug (it's in a unlikely error path)?

Thanks,
Feng

Quoted 2 lines

Thanks
Hanjun

#3 lore raw
Quoted 2 lines · Feng Tang

Hi Hanjun,

[...]

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines

It provides a global and straightforward view of the hierarchy of the processor and caches info of the platform, and from the offset info (the 3rd column), the child-parent relation could be checked.

Quoted 7 lines
Quoted 3 lines

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

Just a discussion, can we just dump the raw PPTT table via acpidump in user space when we meet the problem? With the raw PPTT table, we can go though the content to see if we have problems.

Quoted 8 lines

Good point! We can use iasl to decode the PPTT table. And this dump is still useful as:
* when enabling new silicon or new firmware (APCI tables), sometimes it can't make to boot to user space when the issue happens.
* This dump shows the processor and cache items separately and cleanly, while the P[]/C[] index imply the numbers. In an 128 core product ARM sever, the print with this patch is about 500 line, while the acpidump is about 10,000 lines and harder to parse.

Thanks for the user case, it makes sense to me.

Quoted 1 line

[...]

Quoted 12 lines
Quoted 11 lines

drivers/acpi/pptt.c static int topology_get_acpi_cpu_tag(struct acpi_table_header *table, · line 642

Quoted 9 lines

/**
* topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
* @table: Pointer to the head of the PPTT table

drivers/acpi/pptt.c +2 -0
@@ -565,6 +638,8 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
   	}
   	pr_warn_once("PPTT table found, but unable to locate core %d (%d)\n",
   		    cpu, acpi_cpu_id);
+
+	acpi_dump_pptt_table(table);

I think it would be good to dump it as needed, as a debug feature.

Quoted 3 lines

Makes sense to me. Should I add a kernel config option or a module parameter for it, or just change the pr_info to pr_debug (it's in a unlikely error path)?

PPTT driver can not be compiled as a module, I would like to add a kernel config for it.

Thanks
Hanjun

#4 lore raw
In reply to Feng Tang
Quoted 27 lines · Feng Tang

There was warning message about PPTT table:

"ACPI PPTT: PPTT table found, but unable to locate core 1 (1)",

and it in turn caused scheduler warnings when building up the system. It took a while to root cause the problem be related a broken PPTT table which has wrong cache information.

To speedup debugging similar issues, dump the PPTT table, which makes the warning more noticeable and helps bug hunting.

The dumped info format on a ARM server is like:

    ACPI PPTT: Processors:
    P[  0][0x0024]: parent=0x0000 acpi_proc_id=  0 num_res=1 flags=0x11(package)
    P[  1][0x005a]: parent=0x0024 acpi_proc_id=  0 num_res=1 flags=0x12()
    P[  2][0x008a]: parent=0x005a acpi_proc_id=  0 num_res=3 flags=0x1a(leaf)
    P[  3][0x00f2]: parent=0x005a acpi_proc_id=  1 num_res=3 flags=0x1a(leaf)
    P[  4][0x015a]: parent=0x005a acpi_proc_id=  2 num_res=3 flags=0x1a(leaf)
    ...
    ACPI PPTT: Caches:
    C[   0][0x0072]: flags=0x7f next_level=0x0000 size=0x4000000  sets=65536  way=16 attribute=0xa  line_size=64
    C[   1][0x00aa]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x4  line_size=64
    C[   2][0x00c2]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x2  line_size=64
    C[   3][0x00da]: flags=0x7f next_level=0x0000 size=0x100000   sets=2048   way=8  attribute=0xa  line_size=64
    ...
Quoted 8 lines

It provides a global and straightforward view of the hierarchy of the processor and caches info of the platform, and from the offset info (the 3rd column), the child-parent relation could be checked.

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

While this may sound like a good idea, it deviates from how errors in other table-parsing code are handled. Instead of dumping the entire table, it would be preferable to report the specific issue encountered during parsing.

I do not have a strong objection if Rafael is comfortable with this approach; however, it does differ from the established pattern used by similar code. Dumping the entire table in a custom manner is not the standard way of handling parsing errors. Just my opinion.

Signature · 2 lines
Regards,
Sudeep
author
#5 lore raw

Hi Sudeep,

Thanks for the reviews!

Quoted 37 lines · Sudeep Holla
Quoted 27 lines · Feng Tang

There was warning message about PPTT table:

"ACPI PPTT: PPTT table found, but unable to locate core 1 (1)",

and it in turn caused scheduler warnings when building up the system. It took a while to root cause the problem be related a broken PPTT table which has wrong cache information.

To speedup debugging similar issues, dump the PPTT table, which makes the warning more noticeable and helps bug hunting.

The dumped info format on a ARM server is like:

    ACPI PPTT: Processors:
    P[  0][0x0024]: parent=0x0000 acpi_proc_id=  0 num_res=1 flags=0x11(package)
    P[  1][0x005a]: parent=0x0024 acpi_proc_id=  0 num_res=1 flags=0x12()
    P[  2][0x008a]: parent=0x005a acpi_proc_id=  0 num_res=3 flags=0x1a(leaf)
    P[  3][0x00f2]: parent=0x005a acpi_proc_id=  1 num_res=3 flags=0x1a(leaf)
    P[  4][0x015a]: parent=0x005a acpi_proc_id=  2 num_res=3 flags=0x1a(leaf)
    ...
    ACPI PPTT: Caches:
    C[   0][0x0072]: flags=0x7f next_level=0x0000 size=0x4000000  sets=65536  way=16 attribute=0xa  line_size=64
    C[   1][0x00aa]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x4  line_size=64
    C[   2][0x00c2]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x2  line_size=64
    C[   3][0x00da]: flags=0x7f next_level=0x0000 size=0x100000   sets=2048   way=8  attribute=0xa  line_size=64
    ...
Quoted 8 lines

It provides a global and straightforward view of the hierarchy of the processor and caches info of the platform, and from the offset info (the 3rd column), the child-parent relation could be checked.

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

Quoted 8 lines

While this may sound like a good idea, it deviates from how errors in other table-parsing code are handled. Instead of dumping the entire table, it would be preferable to report the specific issue encountered during parsing.

I do not have a strong objection if Rafael is comfortable with this approach; however, it does differ from the established pattern used by similar code. Dumping the entire table in a custom manner is not the standard way of handling parsing errors. Just my opinion.

Yes, it's a fair point about the error handling. Actually for the issue we met, the PPTT table complies with ACPI spec and PPTT table spec nicely, that it has no checksum or format issue, the only problem is some items are missing.

So I would say the dump itself doesn't break any existing ACPI table error handling, or change anything. As Hanjun suggested, it could be put under a CONFIG_ACPI_PPTT_ERR_DUMP option as a PPTT specific debug method, and not related to general ACPI table error handling.

We have had this in our tree for a while, and the good part is it gives a direct overview of all the processors and caches in system, you get to know the rough number of them from the index, and items are listed side by side so that some minor error could be very obvious in this comparing mode.

Thanks,
Feng

Quoted 4 lines
Signature · 3 lines
-- 
Regards,
Sudeep
#6 lore raw
Quoted 51 lines · Feng Tang

Hi Sudeep,

Thanks for the reviews!

Quoted 37 lines · Sudeep Holla
Quoted 27 lines · Feng Tang

There was warning message about PPTT table:

"ACPI PPTT: PPTT table found, but unable to locate core 1 (1)",

and it in turn caused scheduler warnings when building up the system. It took a while to root cause the problem be related a broken PPTT table which has wrong cache information.

To speedup debugging similar issues, dump the PPTT table, which makes the warning more noticeable and helps bug hunting.

The dumped info format on a ARM server is like:

    ACPI PPTT: Processors:
    P[  0][0x0024]: parent=0x0000 acpi_proc_id=  0 num_res=1 flags=0x11(package)
    P[  1][0x005a]: parent=0x0024 acpi_proc_id=  0 num_res=1 flags=0x12()
    P[  2][0x008a]: parent=0x005a acpi_proc_id=  0 num_res=3 flags=0x1a(leaf)
    P[  3][0x00f2]: parent=0x005a acpi_proc_id=  1 num_res=3 flags=0x1a(leaf)
    P[  4][0x015a]: parent=0x005a acpi_proc_id=  2 num_res=3 flags=0x1a(leaf)
    ...
    ACPI PPTT: Caches:
    C[   0][0x0072]: flags=0x7f next_level=0x0000 size=0x4000000  sets=65536  way=16 attribute=0xa  line_size=64
    C[   1][0x00aa]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x4  line_size=64
    C[   2][0x00c2]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x2  line_size=64
    C[   3][0x00da]: flags=0x7f next_level=0x0000 size=0x100000   sets=2048   way=8  attribute=0xa  line_size=64
    ...
Quoted 8 lines

It provides a global and straightforward view of the hierarchy of the processor and caches info of the platform, and from the offset info (the 3rd column), the child-parent relation could be checked.

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

Quoted 8 lines

While this may sound like a good idea, it deviates from how errors in other table-parsing code are handled. Instead of dumping the entire table, it would be preferable to report the specific issue encountered during parsing.

I do not have a strong objection if Rafael is comfortable with this approach; however, it does differ from the established pattern used by similar code. Dumping the entire table in a custom manner is not the standard way of handling parsing errors. Just my opinion.

Quoted 5 lines

Yes, it's a fair point about the error handling. Actually for the issue we met, the PPTT table complies with ACPI spec and PPTT table spec nicely, that it has no checksum or format issue, the only problem is some items are missing.

Agreed, but how is this any different from other tables that contain optional entries the ASL compiler cannot detect?

Quoted 5 lines

So I would say the dump itself doesn't break any existing ACPI table error handling, or change anything. As Hanjun suggested, it could be put under a CONFIG_ACPI_PPTT_ERR_DUMP option as a PPTT specific debug method, and not related to general ACPI table error handling.

Sure, that could be an option as long as CONFIG_ACPI_PPTT_ERR_DUMP is default off and are enabled only when debugging and not always like in distro images. Does that work for you ?

Quoted 6 lines

We have had this in our tree for a while, and the good part is it gives a direct overview of all the processors and caches in system, you get to know the rough number of them from the index, and items are listed side by side so that some minor error could be very obvious in this comparing mode.

Agreed, but all this info are available to userspace in some form already. What does this dump give other than debugging a broken PPTT ?

Signature · 2 lines
Regards,
Sudeep
author
#7 lore raw

Hi Sudeep,

On Tue, Jan 13, 2026 at 02:40:56PM +0000, Sudeep Holla wrote:
[...]

Quoted 30 lines
Quoted 15 lines
Quoted 6 lines
Quoted 5 lines

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

Quoted 8 lines

While this may sound like a good idea, it deviates from how errors in other table-parsing code are handled. Instead of dumping the entire table, it would be preferable to report the specific issue encountered during parsing.

I do not have a strong objection if Rafael is comfortable with this approach; however, it does differ from the established pattern used by similar code. Dumping the entire table in a custom manner is not the standard way of handling parsing errors. Just my opinion.

Quoted 5 lines

Yes, it's a fair point about the error handling. Actually for the issue we met, the PPTT table complies with ACPI spec and PPTT table spec nicely, that it has no checksum or format issue, the only problem is some items are missing.

Agreed, but how is this any different from other tables that contain optional entries the ASL compiler cannot detect?

Quoted 5 lines

So I would say the dump itself doesn't break any existing ACPI table error handling, or change anything. As Hanjun suggested, it could be put under a CONFIG_ACPI_PPTT_ERR_DUMP option as a PPTT specific debug method, and not related to general ACPI table error handling.

Quoted 3 lines

Sure, that could be an option as long as CONFIG_ACPI_PPTT_ERR_DUMP is default off and are enabled only when debugging and not always like in distro images. Does that work for you ?

Yes. It sounds great to me.

Quoted 9 lines
Quoted 6 lines

We have had this in our tree for a while, and the good part is it gives a direct overview of all the processors and caches in system, you get to know the rough number of them from the index, and items are listed side by side so that some minor error could be very obvious in this comparing mode.

Agreed, but all this info are available to userspace in some form already. What does this dump give other than debugging a broken PPTT ?

It is mainly for debugging issues. Though we locally has option to dump it on boot unconditionally to help kernel/BIOS devleoper to have a quick overview of the PPTT table, as the table gets updated from time to time, or sometime the kernel could fail before booting to user space.

Thanks,
Feng

Quoted 3 lines
Signature · 2 lines
Regards,
Sudeep
#8 lore raw
Quoted 48 lines · Feng Tang

Hi Sudeep,

On Tue, Jan 13, 2026 at 02:40:56PM +0000, Sudeep Holla wrote:
[...]

Quoted 30 lines
Quoted 15 lines
Quoted 6 lines
Quoted 5 lines

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

Quoted 8 lines

While this may sound like a good idea, it deviates from how errors in other table-parsing code are handled. Instead of dumping the entire table, it would be preferable to report the specific issue encountered during parsing.

I do not have a strong objection if Rafael is comfortable with this approach; however, it does differ from the established pattern used by similar code. Dumping the entire table in a custom manner is not the standard way of handling parsing errors. Just my opinion.

Quoted 5 lines

Yes, it's a fair point about the error handling. Actually for the issue we met, the PPTT table complies with ACPI spec and PPTT table spec nicely, that it has no checksum or format issue, the only problem is some items are missing.

Agreed, but how is this any different from other tables that contain optional entries the ASL compiler cannot detect?

Quoted 5 lines

So I would say the dump itself doesn't break any existing ACPI table error handling, or change anything. As Hanjun suggested, it could be put under a CONFIG_ACPI_PPTT_ERR_DUMP option as a PPTT specific debug method, and not related to general ACPI table error handling.

Quoted 3 lines

Sure, that could be an option as long as CONFIG_ACPI_PPTT_ERR_DUMP is default off and are enabled only when debugging and not always like in distro images. Does that work for you ?

Yes. It sounds great to me.

Quoted 7 lines
Quoted 6 lines

We have had this in our tree for a while, and the good part is it gives a direct overview of all the processors and caches in system, you get to know the rough number of them from the index, and items are listed side by side so that some minor error could be very obvious in this comparing mode.

Quoted 7 lines
Quoted 2 lines

Agreed, but all this info are available to userspace in some form already. What does this dump give other than debugging a broken PPTT ?

It is mainly for debugging issues. Though we locally has option to dump it on boot unconditionally to help kernel/BIOS devleoper to have a quick overview of the PPTT table, as the table gets updated from time to time, or sometime the kernel could fail before booting to user space.

The kernel message buffer is not a great place for dumping ACPI tables though.

If an invalid PPTT prevents the system from booting, print out enough information to identify the cause of the failure.

For everything else, use the tools in user space.

author
#9 lore raw
Quoted 16 lines · Rafael J. Wysocki
Quoted 16 lines
Quoted 3 lines

Sure, that could be an option as long as CONFIG_ACPI_PPTT_ERR_DUMP is default off and are enabled only when debugging and not always like in distro images. Does that work for you ?

Yes. It sounds great to me.

Quoted 9 lines
Quoted 6 lines

We have had this in our tree for a while, and the good part is it gives a direct overview of all the processors and caches in system, you get to know the rough number of them from the index, and items are listed side by side so that some minor error could be very obvious in this comparing mode.

Agreed, but all this info are available to userspace in some form already. What does this dump give other than debugging a broken PPTT ?

Quoted 6 lines
Quoted 4 lines

It is mainly for debugging issues. Though we locally has option to dump it on boot unconditionally to help kernel/BIOS devleoper to have a quick overview of the PPTT table, as the table gets updated from time to time, or sometime the kernel could fail before booting to user space.

The kernel message buffer is not a great place for dumping ACPI tables though.

Yes.

Quoted 2 lines

If an invalid PPTT prevents the system from booting, print out enough information to identify the cause of the failure.

Good suggestion! We do have some cases that wrong or missing info of some ACPI table entries cause boot failure like IORT table.

As for the original issue where kernel printed the error message " ACPI PPTT: PPTT table found, but unable to locate core 1 (1)", can we just printed out all the CPU entries of the PPTT table? which is much cleaner and smaller, and have the enough information for quickly identifying the root cause. As the number of cache items is usually 3X of number of CPUs.

Quoted 2 lines

For everything else, use the tools in user space.

OK.

Thanks,
Feng

#10 lore raw
Quoted 30 lines · Feng Tang
Quoted 16 lines · Rafael J. Wysocki
Quoted 16 lines
Quoted 3 lines

Sure, that could be an option as long as CONFIG_ACPI_PPTT_ERR_DUMP is default off and are enabled only when debugging and not always like in distro images. Does that work for you ?

Yes. It sounds great to me.

Quoted 9 lines
Quoted 6 lines

We have had this in our tree for a while, and the good part is it gives a direct overview of all the processors and caches in system, you get to know the rough number of them from the index, and items are listed side by side so that some minor error could be very obvious in this comparing mode.

Agreed, but all this info are available to userspace in some form already. What does this dump give other than debugging a broken PPTT ?

Quoted 6 lines
Quoted 4 lines

It is mainly for debugging issues. Though we locally has option to dump it on boot unconditionally to help kernel/BIOS devleoper to have a quick overview of the PPTT table, as the table gets updated from time to time, or sometime the kernel could fail before booting to user space.

The kernel message buffer is not a great place for dumping ACPI tables though.

Yes.

Quoted 2 lines

If an invalid PPTT prevents the system from booting, print out enough information to identify the cause of the failure.

Quoted 6 lines

Good suggestion! We do have some cases that wrong or missing info of some ACPI table entries cause boot failure like IORT table.

As for the original issue where kernel printed the error message " ACPI PPTT: PPTT table found, but unable to locate core 1 (1)", can we just printed out all the CPU entries of the PPTT table?

As I said, print enough information to allow the problem to be identified. Please avoid excessive verbosity though.

#11 lore raw
In reply to Feng Tang
Quoted 7 lines · Feng Tang

As for the original issue where kernel printed the error message " ACPI PPTT: PPTT table found, but unable to locate core 1 (1)", can we just printed out all the CPU entries of the PPTT table? which is much cleaner and smaller, and have the enough information for quickly identifying the root cause. As the number of cache items is usually 3X of number of CPUs.

I am still not sure what additional value is gained by listing all those CPU entries. On a 512-CPU system, for example, if an issue is identified with the entry for CPU 256, what extra information is obtained by listing all the other CPUs, such as those sharing the same L3 cache or entire list of CPUs on this system?

The message above already indicates that something is wrong with core (n = 1 in above case). If that is not sufficiently clear, it should be improved to be more specific about the issue. Simply listing all CPUs in the PPTT provides no additional insight and only results in an unnecessarily long and distracting CPU list in the kernel log.

Signature · 2 lines
Regards,
Sudeep
#12 lore raw
Quoted 16 lines · Sudeep Holla
Quoted 7 lines · Feng Tang

As for the original issue where kernel printed the error message " ACPI PPTT: PPTT table found, but unable to locate core 1 (1)", can we just printed out all the CPU entries of the PPTT table? which is much cleaner and smaller, and have the enough information for quickly identifying the root cause. As the number of cache items is usually 3X of number of CPUs.

I am still not sure what additional value is gained by listing all those CPU entries. On a 512-CPU system, for example, if an issue is identified with the entry for CPU 256, what extra information is obtained by listing all the other CPUs, such as those sharing the same L3 cache or entire list of CPUs on this system?

Quoted 5 lines

The message above already indicates that something is wrong with core (n = 1 in above case). If that is not sufficiently clear, it should be improved to be more specific about the issue. Simply listing all CPUs in the PPTT provides no additional insight and only results in an unnecessarily long and distracting CPU list in the kernel log.

Fair enough.

author
#13 lore raw
In reply to Sudeep Holla

Hi Sudeep,

Quoted 9 lines · Sudeep Holla
Quoted 7 lines · Feng Tang

As for the original issue where kernel printed the error message " ACPI PPTT: PPTT table found, but unable to locate core 1 (1)", can we just printed out all the CPU entries of the PPTT table? which is much cleaner and smaller, and have the enough information for quickly identifying the root cause. As the number of cache items is usually 3X of number of CPUs.

Quoted 5 lines

I am still not sure what additional value is gained by listing all those CPU entries. On a 512-CPU system, for example, if an issue is identified with the entry for CPU 256, what extra information is obtained by listing all the other CPUs, such as those sharing the same L3 cache or entire list of CPUs on this system?

My bad that I didn't make it clear. As for the original issue, the platform has 8 CPUs, but the PPTT table only has 4 CPUs, while the MADT and other tables are correct about the CPU numbers, and kernel does successfully bringup all 8 CPUs. The PPTT message
" ACPI PPTT: PPTT table found, but unable to locate core 1 (1)" is kind of modest and didn't caught our much attention as all 8 CPUS were onlined fine. So with the "print only necessary info" suggestion from Rafael, it will print out only 4 CPUS, which should immediately show the PPTT table itself is wrong, and worth deeper check.

Quoted 6 lines

The message above already indicates that something is wrong with core (n = 1 in above case). If that is not sufficiently clear, it should be improved to be more specific about the issue. Simply listing all CPUs in the PPTT provides no additional insight and only results in an unnecessarily long and distracting CPU list in the kernel log.

As the print will be embedded under a default-no kernel config as we discussed, and only be printed when error is detects, it may still be acceptable regarding kernel log buffer? Or, any suggestion on how to check the PPTT table to help future debugging? thanks!

- Feng

#14 lore raw
Quoted 18 lines · Feng Tang

Hi Sudeep,

Quoted 9 lines · Sudeep Holla
Quoted 7 lines · Feng Tang

As for the original issue where kernel printed the error message " ACPI PPTT: PPTT table found, but unable to locate core 1 (1)", can we just printed out all the CPU entries of the PPTT table? which is much cleaner and smaller, and have the enough information for quickly identifying the root cause. As the number of cache items is usually 3X of number of CPUs.

Quoted 5 lines

I am still not sure what additional value is gained by listing all those CPU entries. On a 512-CPU system, for example, if an issue is identified with the entry for CPU 256, what extra information is obtained by listing all the other CPUs, such as those sharing the same L3 cache or entire list of CPUs on this system?

Quoted 10 lines

My bad that I didn't make it clear. As for the original issue, the platform has 8 CPUs, but the PPTT table only has 4 CPUs, while the MADT and other tables are correct about the CPU numbers, and kernel does successfully bringup all 8 CPUs. The PPTT message
" ACPI PPTT: PPTT table found, but unable to locate core 1 (1)" is kind of modest and didn't caught our much attention as all 8 CPUS were onlined fine. So with the "print only necessary info" suggestion from Rafael, it will print out only 4 CPUS, which should immediately show the PPTT table itself is wrong, and worth deeper check.

To be clear, listing CPUs is annoying on large systems. In your case, it may be only 4 CPUs and that seems fine, but imagine if one CPU entry is missing on a 512 CPU system - dumping a list of 511 CPUs is not only irritating, but also largely useless for diagnosing the issue.

In my view, for the scenario above, the error should say something along the lines of: the PPTT CPU entry count does not match the system CPU count.

Signature · 2 lines
Regards,
Sudeep
author
#15 lore raw
Quoted 30 lines · Sudeep Holla
Quoted 18 lines · Feng Tang

Hi Sudeep,

Quoted 9 lines · Sudeep Holla
Quoted 7 lines · Feng Tang

As for the original issue where kernel printed the error message " ACPI PPTT: PPTT table found, but unable to locate core 1 (1)", can we just printed out all the CPU entries of the PPTT table? which is much cleaner and smaller, and have the enough information for quickly identifying the root cause. As the number of cache items is usually 3X of number of CPUs.

Quoted 5 lines

I am still not sure what additional value is gained by listing all those CPU entries. On a 512-CPU system, for example, if an issue is identified with the entry for CPU 256, what extra information is obtained by listing all the other CPUs, such as those sharing the same L3 cache or entire list of CPUs on this system?

Quoted 10 lines

My bad that I didn't make it clear. As for the original issue, the platform has 8 CPUs, but the PPTT table only has 4 CPUs, while the MADT and other tables are correct about the CPU numbers, and kernel does successfully bringup all 8 CPUs. The PPTT message
" ACPI PPTT: PPTT table found, but unable to locate core 1 (1)" is kind of modest and didn't caught our much attention as all 8 CPUS were onlined fine. So with the "print only necessary info" suggestion from Rafael, it will print out only 4 CPUS, which should immediately show the PPTT table itself is wrong, and worth deeper check.

Quoted 7 lines

To be clear, listing CPUs is annoying on large systems. In your case, it may be only 4 CPUs and that seems fine, but imagine if one CPU entry is missing on a 512 CPU system - dumping a list of 511 CPUs is not only irritating, but also largely useless for diagnosing the issue.

In my view, for the scenario above, the error should say something along the lines of: the PPTT CPU entry count does not match the system CPU count.

This makes sense to me, thanks for the suggestion! Will check how to implement it and test. The error happens in early boot phase, and I guess only '__cpu_possible_mask' could be used for 'system CPU count'.

Thanks,
Feng

#16 lore raw
In reply to Sudeep Holla
Quoted 38 lines · Sudeep Holla
Quoted 27 lines · Feng Tang

There was warning message about PPTT table:

"ACPI PPTT: PPTT table found, but unable to locate core 1 (1)",

and it in turn caused scheduler warnings when building up the system. It took a while to root cause the problem be related a broken PPTT table which has wrong cache information.

To speedup debugging similar issues, dump the PPTT table, which makes the warning more noticeable and helps bug hunting.

The dumped info format on a ARM server is like:

    ACPI PPTT: Processors:
    P[  0][0x0024]: parent=0x0000 acpi_proc_id=  0 num_res=1 flags=0x11(package)
    P[  1][0x005a]: parent=0x0024 acpi_proc_id=  0 num_res=1 flags=0x12()
    P[  2][0x008a]: parent=0x005a acpi_proc_id=  0 num_res=3 flags=0x1a(leaf)
    P[  3][0x00f2]: parent=0x005a acpi_proc_id=  1 num_res=3 flags=0x1a(leaf)
    P[  4][0x015a]: parent=0x005a acpi_proc_id=  2 num_res=3 flags=0x1a(leaf)
    ...
    ACPI PPTT: Caches:
    C[   0][0x0072]: flags=0x7f next_level=0x0000 size=0x4000000  sets=65536  way=16 attribute=0xa  line_size=64
    C[   1][0x00aa]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x4  line_size=64
    C[   2][0x00c2]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x2  line_size=64
    C[   3][0x00da]: flags=0x7f next_level=0x0000 size=0x100000   sets=2048   way=8  attribute=0xa  line_size=64
    ...
Quoted 8 lines

It provides a global and straightforward view of the hierarchy of the processor and caches info of the platform, and from the offset info (the 3rd column), the child-parent relation could be checked.

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

Quoted 5 lines

While this may sound like a good idea, it deviates from how errors in other table-parsing code are handled. Instead of dumping the entire table, it would be preferable to report the specific issue encountered during parsing.

I do not have a strong objection if Rafael is comfortable with this approach;

I'm not a big fan of it TBH.

Quoted 3 lines

however, it does differ from the established pattern used by similar code. Dumping the entire table in a custom manner is not the standard way of handling parsing errors. Just my opinion.

I agree.

author
#17 lore raw

Hi Rafael,

Thanks for the review!

Quoted 45 lines · Rafael J. Wysocki
Quoted 38 lines · Sudeep Holla
Quoted 27 lines · Feng Tang

There was warning message about PPTT table:

"ACPI PPTT: PPTT table found, but unable to locate core 1 (1)",

and it in turn caused scheduler warnings when building up the system. It took a while to root cause the problem be related a broken PPTT table which has wrong cache information.

To speedup debugging similar issues, dump the PPTT table, which makes the warning more noticeable and helps bug hunting.

The dumped info format on a ARM server is like:

    ACPI PPTT: Processors:
    P[  0][0x0024]: parent=0x0000 acpi_proc_id=  0 num_res=1 flags=0x11(package)
    P[  1][0x005a]: parent=0x0024 acpi_proc_id=  0 num_res=1 flags=0x12()
    P[  2][0x008a]: parent=0x005a acpi_proc_id=  0 num_res=3 flags=0x1a(leaf)
    P[  3][0x00f2]: parent=0x005a acpi_proc_id=  1 num_res=3 flags=0x1a(leaf)
    P[  4][0x015a]: parent=0x005a acpi_proc_id=  2 num_res=3 flags=0x1a(leaf)
    ...
    ACPI PPTT: Caches:
    C[   0][0x0072]: flags=0x7f next_level=0x0000 size=0x4000000  sets=65536  way=16 attribute=0xa  line_size=64
    C[   1][0x00aa]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x4  line_size=64
    C[   2][0x00c2]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x2  line_size=64
    C[   3][0x00da]: flags=0x7f next_level=0x0000 size=0x100000   sets=2048   way=8  attribute=0xa  line_size=64
    ...
Quoted 8 lines

It provides a global and straightforward view of the hierarchy of the processor and caches info of the platform, and from the offset info (the 3rd column), the child-parent relation could be checked.

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

Quoted 5 lines

While this may sound like a good idea, it deviates from how errors in other table-parsing code are handled. Instead of dumping the entire table, it would be preferable to report the specific issue encountered during parsing.

I do not have a strong objection if Rafael is comfortable with this approach;

Quoted 7 lines

I'm not a big fan of it TBH.

Quoted 3 lines

however, it does differ from the established pattern used by similar code. Dumping the entire table in a custom manner is not the standard way of handling parsing errors. Just my opinion.

I agree.

I understand the concern of this could be kind of special, Hanjun and Sudeep have the same feeling.

The reason for the patch is:
* The apcidump tool follow the standard general format to dump each item, without grouping them according to type, the number of lines of acpidump is about 20X more than this, making it harder to parse
* In rare cases like for silicon enabling, sometimes the kernel can fail early where the user space checking is not available. If HW debugger is not available either, the kernel dumping is the only way to debug.

Does the proposal of putting it under a kernel config look doable to you? If not, I will keeep the code local for now.

Thanks,
Feng

#18 lore raw
Quoted 59 lines · Feng Tang

Hi Rafael,

Thanks for the review!

Quoted 45 lines · Rafael J. Wysocki
Quoted 38 lines · Sudeep Holla
Quoted 27 lines · Feng Tang

There was warning message about PPTT table:

"ACPI PPTT: PPTT table found, but unable to locate core 1 (1)",

and it in turn caused scheduler warnings when building up the system. It took a while to root cause the problem be related a broken PPTT table which has wrong cache information.

To speedup debugging similar issues, dump the PPTT table, which makes the warning more noticeable and helps bug hunting.

The dumped info format on a ARM server is like:

    ACPI PPTT: Processors:
    P[  0][0x0024]: parent=0x0000 acpi_proc_id=  0 num_res=1 flags=0x11(package)
    P[  1][0x005a]: parent=0x0024 acpi_proc_id=  0 num_res=1 flags=0x12()
    P[  2][0x008a]: parent=0x005a acpi_proc_id=  0 num_res=3 flags=0x1a(leaf)
    P[  3][0x00f2]: parent=0x005a acpi_proc_id=  1 num_res=3 flags=0x1a(leaf)
    P[  4][0x015a]: parent=0x005a acpi_proc_id=  2 num_res=3 flags=0x1a(leaf)
    ...
    ACPI PPTT: Caches:
    C[   0][0x0072]: flags=0x7f next_level=0x0000 size=0x4000000  sets=65536  way=16 attribute=0xa  line_size=64
    C[   1][0x00aa]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x4  line_size=64
    C[   2][0x00c2]: flags=0x7f next_level=0x00da size=0x10000    sets=256    way=4  attribute=0x2  line_size=64
    C[   3][0x00da]: flags=0x7f next_level=0x0000 size=0x100000   sets=2048   way=8  attribute=0xa  line_size=64
    ...
Quoted 8 lines

It provides a global and straightforward view of the hierarchy of the processor and caches info of the platform, and from the offset info (the 3rd column), the child-parent relation could be checked.

With this, the root cause of the original issue was pretty obvious, that there were some caches items missing which caused the issue when building up scheduler domain.

Quoted 5 lines

While this may sound like a good idea, it deviates from how errors in other table-parsing code are handled. Instead of dumping the entire table, it would be preferable to report the specific issue encountered during parsing.

I do not have a strong objection if Rafael is comfortable with this approach;

Quoted 7 lines

I'm not a big fan of it TBH.

Quoted 3 lines

however, it does differ from the established pattern used by similar code. Dumping the entire table in a custom manner is not the standard way of handling parsing errors. Just my opinion.

I agree.

Quoted 7 lines

I understand the concern of this could be kind of special, Hanjun and Sudeep have the same feeling.

The reason for the patch is:
* The apcidump tool follow the standard general format to dump each item, without grouping them according to type, the number of lines of acpidump is about 20X more than this, making it harder to parse

But you can develop a PPTT parser.

All ACPI tables are exposed verbatim via /sys/firmware/acpi/tables/.

Quoted 3 lines

* In rare cases like for silicon enabling, sometimes the kernel can fail early where the user space checking is not available. If HW debugger is not available either, the kernel dumping is the only way to debug.

But I don't think you need to dump the entire table in those cases.

Quoted 1 line

Does the proposal of putting it under a kernel config look doable to you?

That would mean extra code that's almost never used and needs to be taken into account when making changes that may affect it. Thanks, but no thanks.