Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: sysfs: Enable ACPI sysfs support for CCEL records

The Confidential Computing Event Log (CCEL) table provides the address
and length of the CCEL records area in UEFI reserved memory.

To allow user space access to these records, expose a sysfs interface
similar to the BERT table.

More details about the CCEL table can be found in the ACPI specification
r6.5 [1], sec 5.2.34.

Link: https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#cc-event-log-acpi-table # [1]
Co-developed-by: Haibo Xu <haibo1.xu@intel.com>
Signed-off-by: Haibo Xu <haibo1.xu@intel.com>
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Kuppuswamy Sathyanarayanan and committed by
Rafael J. Wysocki
4f855dce 197b6b60

+17
+17
drivers/acpi/sysfs.c
··· 458 458 return sysfs_create_bin_file(tables_data_kobj, &data_attr->attr); 459 459 } 460 460 461 + static int acpi_ccel_data_init(void *th, struct acpi_data_attr *data_attr) 462 + { 463 + struct acpi_table_ccel *ccel = th; 464 + 465 + if (ccel->header.length < sizeof(struct acpi_table_ccel) || 466 + !ccel->log_area_start_address || !ccel->log_area_minimum_length) { 467 + kfree(data_attr); 468 + return -EINVAL; 469 + } 470 + data_attr->addr = ccel->log_area_start_address; 471 + data_attr->attr.size = ccel->log_area_minimum_length; 472 + data_attr->attr.attr.name = "CCEL"; 473 + 474 + return sysfs_create_bin_file(tables_data_kobj, &data_attr->attr); 475 + } 476 + 461 477 static struct acpi_data_obj { 462 478 char *name; 463 479 int (*fn)(void *, struct acpi_data_attr *); 464 480 } acpi_data_objs[] = { 465 481 { ACPI_SIG_BERT, acpi_bert_data_init }, 482 + { ACPI_SIG_CCEL, acpi_ccel_data_init }, 466 483 }; 467 484 468 485 #define NUM_ACPI_DATA_OBJS ARRAY_SIZE(acpi_data_objs)