diff options
| author | Nate DeSimone <nathaniel.l.desimone@intel.com> | 2026-03-24 16:14:54 -0700 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-03-26 15:59:52 +0100 |
| commit | 8dcb4485e7672d3abe9fac03b843dff7bb8a1582 (patch) | |
| tree | 488e137e4a1212b108ef7b8a812b4650b5181a34 | |
| parent | 9b776ddcf3236f860f81f12ba10864ce6e237ff9 (diff) | |
ACPI: FPDT: expose FBPT and S3PT subtables via sysfs
Add sysfs files at /sys/firmware/acpi/fpdt/FBPT and
/sys/firmware/acpi/fpdt/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.
Link: https://uefi.org/specs/ACPI/6.6/05_ACPI_Software_Programming_Model.html#performance-event-record-types [1]
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
[ rjw: Changelog edits ]
Link: https://patch.msgid.link/20260324231456.701-2-nathaniel.l.desimone@intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| -rw-r--r-- | drivers/acpi/acpi_fpdt.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/acpi/acpi_fpdt.c b/drivers/acpi/acpi_fpdt.c index 271092f2700a..e75dd28d31a9 100644 --- a/drivers/acpi/acpi_fpdt.c +++ b/drivers/acpi/acpi_fpdt.c @@ -141,6 +141,9 @@ static const struct attribute_group boot_attr_group = { .name = "boot", }; +static BIN_ATTR(FBPT, 0400, sysfs_bin_attr_simple_read, NULL, 0); +static BIN_ATTR(S3PT, 0400, sysfs_bin_attr_simple_read, NULL, 0); + static struct kobject *fpdt_kobj; #if defined CONFIG_X86 && defined CONFIG_PHYS_ADDR_T_64BIT @@ -254,9 +257,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(fpdt_kobj, &bin_attr_FBPT); + if (result) + pr_warn("Failed to create FBPT sysfs attribute.\n"); + } else if (subtable_type == SUBTABLE_S3PT) { + bin_attr_S3PT.private = subtable_header; + bin_attr_S3PT.size = length; + result = sysfs_create_bin_file(fpdt_kobj, &bin_attr_S3PT); + if (result) + pr_warn("Failed to create S3PT sysfs attribute.\n"); + } + return 0; err: + if (bin_attr_FBPT.private) { + sysfs_remove_bin_file(fpdt_kobj, &bin_attr_FBPT); + bin_attr_FBPT.private = NULL; + } + + if (bin_attr_S3PT.private) { + sysfs_remove_bin_file(fpdt_kobj, &bin_attr_S3PT); + bin_attr_S3PT.private = NULL; + } + if (record_boot) sysfs_remove_group(fpdt_kobj, &boot_attr_group); |
