coreboot/src/security
Sean Rhodes 468f8131ec security/tcg/opal_s3: hook into default SMI/resume paths
Provide common entry points for the OPAL S3 unlock feature and wire them
into the generic x86 SMM and S3 resume code.

- Add opal_s3_smi_{apmc,sleep,sleep_finalize} helpers.
- Call these helpers from the default weak mainboard SMI hooks when
  CONFIG(TCG_OPAL_S3_UNLOCK) is enabled. This keeps the feature usable
  without forcing boards to implement new SMI handlers.
- Trigger the SMM unlock on S3 resume from arch/x86/acpi_s3.c.

Select SMM_OPAL_S3_STATE_SMRAM so the secret is persisted across SMM
handler reload. Add a delay and retry loop before unlock, and restore
NVMe BAR0 if the device loses PCI config state across S3.

The SMM side continues to whitelist only the OPAL service and unlock
APMC commands and fails closed if any invariant is violated.

TEST=tested with rest of patch train

Change-Id: I86a44760a189219a95914bd3549997880fb0242b
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91045
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2026-03-27 18:14:05 +00:00
..
intel include/cpu/x86/msr.h: Add MCA related MSRs 2026-01-08 18:24:23 +00:00
lockdown soc/intel/common: Add opt-in runtime control for BIOS SMM write 2026-01-29 14:41:46 +00:00
memory drivers/efi/uefi_capsules.c: coalesce and store UEFI capsules 2024-08-30 15:48:25 +00:00
tcg security/tcg/opal_s3: hook into default SMI/resume paths 2026-03-27 18:14:05 +00:00
tpm drivers/amd/ftpm: Add fTPM driver for PSP emulated CRB TPMs 2026-01-14 17:02:47 +00:00
vboot security/vboot: Add option for enabling ADB via GBB flag 2026-03-19 16:09:24 +00:00
Kconfig security/tcg: add OPAL S3 unlock Kconfig 2026-03-19 14:07:18 +00:00
Makefile.mk security/tcg: add OPAL S3 unlock Kconfig 2026-03-19 14:07:18 +00:00