public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] ACPI: FPDT: expose FBPT and S3PT subtables via sysfs
@ 2026-02-22  6:30 Nate DeSimone
  2026-02-23 17:54 ` Luck, Tony
  2026-03-10  4:34 ` [PATCH v2 0/2] " Nate DeSimone
  0 siblings, 2 replies; 8+ messages in thread
From: Nate DeSimone @ 2026-02-22  6:30 UTC (permalink / raw)
  To: linux-acpi; +Cc: Rafael J. Wysocki, Len Brown, tony.luck

Add sysfs attributes at /sys/firmware/acpi/fpdt/tables/FBPT and
/sys/firmware/acpi/fpdt/tables/S3PT that expose the raw contents of the
FPDT subtables. Note that /sys/firmware/acpi/tables/FPDT only provides
the top level table, not the subtables. Adding access to the subtables
enables a usage model similar to /sys/firmware/dmi/tables/DMI, allowing
userspace tools to interpret newer record types (e.g. String Event
Records, Microcontroller Boot Performance Data Records, etc.) defined
in recent ACPI specifications[1] without requiring kernel changes.

[1]
https://uefi.org/specs/ACPI/6.6/05_ACPI_Software_Programming_Model.html#performance-event-record-types

Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 drivers/acpi/acpi_fpdt.c | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/drivers/acpi/acpi_fpdt.c b/drivers/acpi/acpi_fpdt.c
index 271092f2700a..aa79b28f3c20 100644
--- a/drivers/acpi/acpi_fpdt.c
+++ b/drivers/acpi/acpi_fpdt.c
@@ -141,7 +141,11 @@ static const struct attribute_group boot_attr_group = {
 	.name = "boot",
 };
 
+static BIN_ATTR(FBPT, 0444, sysfs_bin_attr_simple_read, NULL, 0);
+static BIN_ATTR(S3PT, 0444, sysfs_bin_attr_simple_read, NULL, 0);
+
 static struct kobject *fpdt_kobj;
+static struct kobject *tables_kobj;
 
 #if defined CONFIG_X86 && defined CONFIG_PHYS_ADDR_T_64BIT
 #include <linux/processor.h>
@@ -254,9 +258,34 @@ static int fpdt_process_subtable(u64 address, u32 subtable_type)
 			break;
 		}
 	}
+
+	if (subtable_type == SUBTABLE_FBPT) {
+		bin_attr_FBPT.private = subtable_header;
+		bin_attr_FBPT.size = length;
+		result = sysfs_create_bin_file(tables_kobj, &bin_attr_FBPT);
+		if (result)
+			goto err;
+	} else if (subtable_type == SUBTABLE_S3PT) {
+		bin_attr_S3PT.private = subtable_header;
+		bin_attr_S3PT.size = length;
+		result = sysfs_create_bin_file(tables_kobj, &bin_attr_S3PT);
+		if (result)
+			goto err;
+	}
+
 	return 0;
 
 err:
+	if (bin_attr_FBPT.private) {
+		sysfs_remove_bin_file(tables_kobj, &bin_attr_FBPT);
+		bin_attr_FBPT.private = NULL;
+	}
+
+	if (bin_attr_S3PT.private) {
+		sysfs_remove_bin_file(tables_kobj, &bin_attr_S3PT);
+		bin_attr_S3PT.private = NULL;
+	}
+
 	if (record_boot)
 		sysfs_remove_group(fpdt_kobj, &boot_attr_group);
 
@@ -288,6 +317,12 @@ static int __init acpi_init_fpdt(void)
 		goto err_nomem;
 	}
 
+	tables_kobj = kobject_create_and_add("tables", fpdt_kobj);
+	if (!tables_kobj) {
+		result = -ENOMEM;
+		goto err_tables;
+	}
+
 	while (offset < header->length) {
 		subtable = (void *)header + offset;
 		switch (subtable->type) {
@@ -306,6 +341,9 @@ static int __init acpi_init_fpdt(void)
 	}
 	return 0;
 err_subtable:
+	kobject_put(tables_kobj);
+
+err_tables:
 	kobject_put(fpdt_kobj);
 
 err_nomem:

base-commit: 8bf22c33e7a172fbc72464f4cc484d23a6b412ba
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-03-24 23:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-22  6:30 [PATCH v1] ACPI: FPDT: expose FBPT and S3PT subtables via sysfs Nate DeSimone
2026-02-23 17:54 ` Luck, Tony
2026-02-23 20:32   ` Nate DeSimone
2026-03-10  4:34 ` [PATCH v2 0/2] " Nate DeSimone
2026-03-10  4:34   ` [PATCH v2 1/2] " Nate DeSimone
2026-03-11 13:18     ` Rafael J. Wysocki
2026-03-24 23:20       ` Nate DeSimone
2026-03-10  4:34   ` [PATCH v2 2/2] Documentation: ABI: add FBPT and S3PT entries to sysfs-firmware-acpi Nate DeSimone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox