public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Ard Biesheuvel <ardb+git@google.com>
Cc: linux-efi@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [PATCH 2/4] efi/libstub: Add Confidential Computing (CC) measurement typedefs
Date: Tue, 5 Mar 2024 11:27:19 -0800	[thread overview]
Message-ID: <1425355b-d3b8-4066-acd9-aba5067d4afa@linux.intel.com> (raw)
In-Reply-To: <CAC_iWjKeKBd3O-i8Lodv4m5e8n=0Bss0N_mjc+jCj2QNgmaQzA@mail.gmail.com>


On 3/5/24 10:00 AM, Ilias Apalodimas wrote:
> Hi Ard,
>
> On Mon, 4 Mar 2024 at 12:44, Ard Biesheuvel <ardb+git@google.com> wrote:
>> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>
>> If the virtual firmware implements TPM support, TCG2 protocol will be
>> used for kernel measurements and event logging support. But in CC
>> environment, not all platforms support or enable the TPM feature. UEFI
>> specification [1] exposes protocol and interfaces used for kernel
>> measurements in CC platforms without TPM support.
>>
>> More details about the EFI CC measurements and logging can be found
>> in [1].
>>
>> Link: https://uefi.org/specs/UEFI/2.10/38_Confidential_Computing.html#efi-cc-measurement-protocol [1]
>> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>> [ardb: Drop code changes, keep typedefs and #define's only]
>> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
>> ---
>>  drivers/firmware/efi/libstub/efistub.h | 79 ++++++++++++++++++++
>>  include/linux/efi.h                    |  1 +
>>  2 files changed, 80 insertions(+)
>>
> [...]
>
>> +
>> +struct efi_cc_event {
>> +       u32 event_size;
>> +       struct {
>> +               u32 header_size;
>> +               u16 header_version;
>> +               u32 mr_index;
>> +               u32 event_type;
>> +       } __packed event_header;
>> +       u8 event_data[0];
> We should define this as a flexible array member instead of a zero-length array?
> The spec is funny and defines this as event_data[1]. I think we aren't
> using the sizeof(struct efi_cc_event) anywhere, so if this struct is
> not used as a member of another struct or an array we can omit it
> entirely.

Flexible array is also fine or we can just add a comment like "u8[] event follows here"
like in struct efi_tcg2_event .

>
> [...]
>
> Cheers
> /Ilias

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


  reply	other threads:[~2024-03-05 19:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 10:44 [PATCH 0/4] efi/libstub: Fall back to CC proto for measurement Ard Biesheuvel
2024-03-04 10:44 ` [PATCH 1/4] efi/libstub: Fold efi_tcg2_tagged_event into efi_measured_event Ard Biesheuvel
2024-03-05  4:30   ` Kuppuswamy Sathyanarayanan
2024-03-05  8:21     ` Ard Biesheuvel
2024-03-05 19:19       ` Kuppuswamy Sathyanarayanan
2024-03-04 10:44 ` [PATCH 2/4] efi/libstub: Add Confidential Computing (CC) measurement typedefs Ard Biesheuvel
2024-03-05 18:00   ` Ilias Apalodimas
2024-03-05 19:27     ` Kuppuswamy Sathyanarayanan [this message]
2024-03-05 19:59       ` Ilias Apalodimas
2024-03-04 10:44 ` [PATCH 3/4] efi/libstub: Measure into CC protocol if TCG2 protocol is absent Ard Biesheuvel
2024-03-05 17:34   ` Dionna Amalie Glaze
2024-03-05 17:47     ` Ard Biesheuvel
2024-03-05 17:55       ` Ilias Apalodimas
2024-03-05 18:00       ` Dionna Amalie Glaze
2024-03-05 18:33         ` Kuppuswamy Sathyanarayanan
2024-03-05 18:46           ` Dionna Amalie Glaze
2024-03-05 19:36             ` Kuppuswamy Sathyanarayanan
2024-03-05 21:28               ` Dionna Amalie Glaze
2024-03-05 21:28             ` Ard Biesheuvel
2024-03-05 21:39   ` Kuppuswamy Sathyanarayanan
2024-03-04 10:44 ` [PATCH 4/4] efi/libstub: Add get_event_log() support for CC platforms Ard Biesheuvel

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=1425355b-d3b8-4066-acd9-aba5067d4afa@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=ardb+git@google.com \
    --cc=ardb@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=linux-efi@vger.kernel.org \
    /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