Skip to content

Commit 4f855dc

Browse files
Kuppuswamy Sathyanarayananrafaeljw
authored andcommitted
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>
1 parent 197b6b6 commit 4f855dc

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

drivers/acpi/sysfs.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,28 @@ static int acpi_bert_data_init(void *th, struct acpi_data_attr *data_attr)
458458
return sysfs_create_bin_file(tables_data_kobj, &data_attr->attr);
459459
}
460460

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+
461477
static struct acpi_data_obj {
462478
char *name;
463479
int (*fn)(void *, struct acpi_data_attr *);
464480
} acpi_data_objs[] = {
465481
{ ACPI_SIG_BERT, acpi_bert_data_init },
482+
{ ACPI_SIG_CCEL, acpi_ccel_data_init },
466483
};
467484

468485
#define NUM_ACPI_DATA_OBJS ARRAY_SIZE(acpi_data_objs)

0 commit comments

Comments
 (0)