From: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Rafael J Wysocki <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] ACPI: sysfs: Enable ACPI sysfs support for CCEL records
Date: Wed, 15 Mar 2023 13:48:56 -0700 [thread overview]
Message-ID: <b051ecb7-54d7-9616-5f87-7d6cca1eba6e@linux.intel.com> (raw)
In-Reply-To: <20230302071327.557734-1-sathyanarayanan.kuppuswamy@linux.intel.com>
Hi Rafael,
Gentle ping! Any comments on this patch?
On 3/1/23 11:13 PM, Kuppuswamy Sathyanarayanan wrote:
> The Confidential Computing Event Log (CCEL) table provides the address
> and length of the CCEL records area in UEFI reserved memory. To access
> these records, userspace can use /dev/mem to retrieve them. But
> '/dev/mem' is not enabled on many systems for security reasons.
>
> So to allow user space access these event log records without the
> /dev/mem interface, add support to access it via sysfs interface. The
> ACPI driver has provided read only access to BERT records area via
> '/sys/firmware/acpi/tables/data/BERT' in sysfs. So follow the same way,
> and add support for /sys/firmware/acpi/tables/data/CCEL to enable
> read-only access to the CCEL recorids area.
>
> More details about the CCEL table can be found in ACPI specification
> r6.5, sec titled "CC Event Log ACPI Table".
>
> Original-patch-by: Haibo Xu <haibo1.xu@intel.com>
> [Original patch is for TDEL table, modified it for CCEL support]
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> ---
> drivers/acpi/sysfs.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
> index 7db3b530279b..afeac925b31b 100644
> --- a/drivers/acpi/sysfs.c
> +++ b/drivers/acpi/sysfs.c
> @@ -458,11 +458,28 @@ static int acpi_bert_data_init(void *th, struct acpi_data_attr *data_attr)
> return sysfs_create_bin_file(tables_data_kobj, &data_attr->attr);
> }
>
> +static int acpi_ccel_data_init(void *th, struct acpi_data_attr *data_attr)
> +{
> + struct acpi_table_ccel *ccel = th;
> +
> + if (ccel->header.length < sizeof(struct acpi_table_ccel) ||
> + !(ccel->log_area_start_address) || !(ccel->log_area_minimum_length)) {
> + kfree(data_attr);
> + return -EINVAL;
> + }
> + data_attr->addr = ccel->log_area_start_address;
> + data_attr->attr.size = ccel->log_area_minimum_length;
> + data_attr->attr.attr.name = "CCEL";
> +
> + return sysfs_create_bin_file(tables_data_kobj, &data_attr->attr);
> +}
> +
> static struct acpi_data_obj {
> char *name;
> int (*fn)(void *, struct acpi_data_attr *);
> } acpi_data_objs[] = {
> { ACPI_SIG_BERT, acpi_bert_data_init },
> + { ACPI_SIG_CCEL, acpi_ccel_data_init },
> };
>
> #define NUM_ACPI_DATA_OBJS ARRAY_SIZE(acpi_data_objs)
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
next prev parent reply other threads:[~2023-03-15 20:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-02 7:13 Kuppuswamy Sathyanarayanan
2023-03-15 20:48 ` Sathyanarayanan Kuppuswamy [this message]
2023-03-20 17:15 ` Rafael J. Wysocki
2023-03-20 17:34 ` Sathyanarayanan Kuppuswamy
2023-03-20 17:35 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b051ecb7-54d7-9616-5f87-7d6cca1eba6e@linux.intel.com \
--to=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®