Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: d23edb21a3571ddbf119fdfac9271022c2873a1b
      
https://github.com/tianocore/edk2/commit/d23edb21a3571ddbf119fdfac9271022c2873a1b
  Author: Patrick Rudolph <patrick.rudo...@9elements.com>
  Date:   2025-04-09 (Wed, 09 Apr 2025)

  Changed paths:
    M UefiPayloadPkg/Include/Coreboot.h

  Log Message:
  -----------
  UefiPayloadPkg/Include/Coreboot: Add definitions for SMMSTOREv2 table

Since commit bc744f5893fc4d53275ed26dd8d968011c6a09c1 coreboot supports
the SMMSTORE v2 feature. It implements an SMI handler that is able to
write, read and erase pages in the boot media (SPI flash).
The existence of this optional feature is advertised by a coreboot
table.

Add the tag and header definition to be able to parse the table.

Signed-off-by: Patrick Rudolph <patrick.rudo...@9elements.com>
Signed-off-by: Sergii Dmytruk <sergii.dmyt...@3mdeb.com>


  Commit: c67d975cfca4ecefeba34b593ec35b29d5a313ec
      
https://github.com/tianocore/edk2/commit/c67d975cfca4ecefeba34b593ec35b29d5a313ec
  Author: Patrick Rudolph <patrick.rudo...@9elements.com>
  Date:   2025-04-09 (Wed, 09 Apr 2025)

  Changed paths:
    A UefiPayloadPkg/Include/Guid/SmmStoreInfoGuid.h
    A UefiPayloadPkg/Include/Library/SmmStoreParseLib.h
    M UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
    M UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
    M UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
    M UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
    M UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
    M UefiPayloadPkg/UefiPayloadPkg.dec

  Log Message:
  -----------
  UefiPayloadPkg: Add SmmStoreInfoGuid

Add a new InfoHob that contains the SmmStore information passed from
coreboot tables when the SMMSTOREV2 feature is enabled.

This will be used to implement the FVB on top of the SMI installed by
coreboot.

Signed-off-by: Patrick Rudolph <patrick.rudo...@9elements.com>
Signed-off-by: Sergii Dmytruk <sergii.dmyt...@3mdeb.com>


  Commit: 034de59fb7a0048525109eeaba76d78d48b21ef5
      
https://github.com/tianocore/edk2/commit/034de59fb7a0048525109eeaba76d78d48b21ef5
  Author: Patrick Rudolph <patrick.rudo...@9elements.com>
  Date:   2025-04-09 (Wed, 09 Apr 2025)

  Changed paths:
    A UefiPayloadPkg/Include/Library/SmmStoreLib.h
    A UefiPayloadPkg/Library/SmmStoreLib/SmmStore.c
    A UefiPayloadPkg/Library/SmmStoreLib/SmmStore.h
    A UefiPayloadPkg/Library/SmmStoreLib/SmmStoreLib.inf
    A UefiPayloadPkg/Library/SmmStoreLib/X64/SmmStore.nasm
    M UefiPayloadPkg/UefiPayloadPkg.dsc

  Log Message:
  -----------
  UefiPayloadPkg: Add SmmStoreLib

Implement all of the FVB protocol functions on top of the SmmStore
as a library. The library consumes the introduced
gEfiSmmStoreInfoHobGuid.

The SMI handler uses a fixed communication buffer in reserved DRAM.
To initiate a transaction you must write to the I/O APM_CNT port.

Tests on Intel(R) Xeon(R) E-2288G CPU @ 3.70G showed that the SMI isn't
triggered with a probability of 1:40 of all cases when called in a tight
loop. The CPU continues running and the SMI is triggered asynchronously
a few clock cycles later. coreboot only handles synchronous APM request
and does nothing on asynchronous APM triggers.

As there's no livesign from SMM it's impossible to tell if the handler
has run. Just wait a bit and try again to trigger a synchronous SMI.

Tests confirmed that out of 5 million tries the SMI is now always
handled.

When a synchronous SMI happens with the correct write to the APM_CNT
port, the ebx register is checked first that it doesn't point to SMRAM.
If it doesn't it's used to read in the arguments that define an SmmStore
transaction.

The SMI handler will only operate on a predefined and memory mapped
region in the boot media.

Signed-off-by: Patrick Rudolph <patrick.rudo...@9elements.com>
Signed-off-by: Sergii Dmytruk <sergii.dmyt...@3mdeb.com>


  Commit: d8531a1e1a3e97b6d6fc926b141cea0a540f41e1
      
https://github.com/tianocore/edk2/commit/d8531a1e1a3e97b6d6fc926b141cea0a540f41e1
  Author: Sean Rhodes <sean@starlabs.systems>
  Date:   2025-04-09 (Wed, 09 Apr 2025)

  Changed paths:
    A UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.c
    A UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.h
    A UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntimeDxe.c
    A UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntimeDxe.inf
    M UefiPayloadPkg/UefiPayloadPkg.dsc
    M UefiPayloadPkg/UefiPayloadPkg.fdf

  Log Message:
  -----------
  UefiPayloadPkg: Add support for Firmware Volume Block Protocol

This adds support for FVB in order to support a platform-independent
non-volatile variable store on UefiPayloadPkg. The variable store makes
use of the SmmStoreLib to provide an unauthenticated variable store.

Since commit bc744f5893fc4d53275ed26dd8d968011c6a09c1 coreboot supports
the SMMSTORE v2 feature. It implements an SMI handler that is able to
write, read and erase pages in the boot media (SPI flash).
The communication is done using a fixed communication buffer that is
allocated in CBMEM. The existence of this optional feature is advertised
by a coreboot table. When the SMMSTORE feature is not available, the
variable emulation is used by setting PcdEmuVariableNvModeEnable to
TRUE.

The DXE component provides runtime services and takes care of virtual to
physical mapping the communication buffers between SMM and OS.

The contents of the variable store can be accessed and modified by any
privileged application. As authentication is done by runtime services
only the store shouldn't be used to store authenticated variables.

Tested on Linux and Windows on a variety of real hardware.
This can also be tested in QEMU starting with coreboot 24.12 using
qemu-q35 board.

Signed-off-by: Patrick Rudolph <patrick.rudo...@9elements.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Matt DeVillier <matt.devill...@gmail.com>
Signed-off-by: Sergii Dmytruk <sergii.dmyt...@3mdeb.com>


Compare: https://github.com/tianocore/edk2/compare/70df56728f71...d8531a1e1a3e

To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to