Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support updates via UEFI capsules #509

Open
wants to merge 20 commits into
base: dasharo
Choose a base branch
from
Open

Commits on Oct 7, 2024

  1. configs: bump EDK2 for UEFI capsules support

    Change-Id: I02d917fb5f9c98fd2792e2c7d3cfaaf84b430ffd
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    2ba8e3a View commit details
    Browse the repository at this point in the history
  2. drivers/efi: add optional ESRT-friendly coreboot table tag

    New CONFIG_DRIVERS_EFI_FW_INFO is off by default, enabling it adds
    DRIVERS_EFI_FW_{GUID,VERSION,LSV} to be used to specify firmware
    version/update information.
    
    Existing forms of versions wouldn't be sufficient because there is no
    universal way of conversion to 32-bit unsigned integers and there are no
    GUIDs or lowest supported versions.
    
    Change-Id: Ic1b768d7bed43edf7ca8e41552087734054de033
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    8406b04 View commit details
    Browse the repository at this point in the history
  3. dasharo/uefi_capsules.c: coalesce and store UEFI capsules

    How it approximately works:
    
    (During a normal system run):
    1. OS puts a capsule into RAM and calls UpdateCapsule() function of EFI
       runtime
    2. If applying the update requires a reboot, EFI implementation creates
       a new CapsuleUpdateData* EFI variable pointing at the beginning of
       capsules description (not data, but description of the data) and does
       a warm reboot leaving capsule data and its description in RAM to be
       picked by firmware on the next boot process
    
    (After DEV_INIT:)
    3. Capsules are discovered by checking for CapsuleUpdateData* variables
    4. Capsule description in memory and capsule data is validated for
       sanity
    5. Capsule data is coalesced into a continuous piece of memory
    
    (On BS_WRITE_TABLES via dasharo_add_capsules_to_bootmem() hook:)
    6. Buffer with coalesced capsules is marked as reserved
    
    (On BS_WRITE_TABLES via lb_uefi_capsules() hook:)
    7. coreboot table entry is added for each of the discovered capsules
    
    (In UEFI payload:)
    8. CapsuleUpdateData* get removed
    9. coreboot table is checked for any update capsules which are then
       applied
    
    Change-Id: I162d678ae5c504906084b59c1a8d8c26dadb9433
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    8f36e98 View commit details
    Browse the repository at this point in the history
  4. configs/config.msi_*: enable UEFI capsule updates

    Change-Id: I30058c4b4d43ef622bddfe69892d02ffffc039db
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    eaecb92 View commit details
    Browse the repository at this point in the history
  5. configs/config.emulation_qemu_x86_q35_uefi: enable capsules

    Change-Id: Ic7dbdc044ea7cd799eb29800a8245e67c67b90d1
    Signed-off-by: Krystian Hebel <[email protected]>
    Signed-off-by: Sergii Dmytruk <[email protected]>
    krystian-hebel authored and SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    ded5c6c View commit details
    Browse the repository at this point in the history
  6. drivers/smmstore: add ability to write to whole flash

    With DRIVERS_EFI_UPDATE_CAPSULES enabled, SMMSTORE SMI handler can use
    commands with highest bit (0x80) set to access whole flash instead of
    just the SMMSTORE region. The rest of interface is identical to regular
    SMMSTORE v2.
    
    Change-Id: I7f3dbfa965b9dcbade8b2f06a5bd2ac1345c7972
    Signed-off-by: Krystian Hebel <[email protected]>
    krystian-hebel authored and SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    2272158 View commit details
    Browse the repository at this point in the history
  7. drivers/smmstore: add logic to disable capsule update handling code

    This adds a call to SMMSTORE that saves information about availability
    of capsules in SMM memory. This new call is ignored when run more than
    once, which means that there should be no way of enabling full flash
    handling after it was disabled and vice versa.
    
    The call should be always made by the firmware to lock further calls,
    otherwise OS could gain full flash access. This is done on entry to
    BS_POST_DEVICE, after capsules are obtained in BS_DEV_INIT.
    
    Change-Id: I3dc175ea313aae1edae304520595b82db7206cbb
    Signed-off-by: Krystian Hebel <[email protected]>
    krystian-hebel authored and SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    2ab20ec View commit details
    Browse the repository at this point in the history
  8. Documentation/drivers/smmstorev2.md: describe capsule update API

    This commit adds a description of capsule update commands implemented
    in SMMSTORE in previous patches.
    
    Change-Id: I94761d18be567e5302d1a836f09f0a7eecb4fb00
    Signed-off-by: Krystian Hebel <[email protected]>
    krystian-hebel authored and SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    a36d1dd View commit details
    Browse the repository at this point in the history
  9. payloads/external/edk2: configure capsule updates

    This requires version of EDK2 in use to understand those defines, but
    the build isn't affected negatively if they aren't handled.  Upstream
    EDK2 understands only CAPSULE_SUPPORT at the moment.
    
    Change-Id: I1c684cb8929842a5d3c4b06e8a9c0a748470ea41
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    bf36ab7 View commit details
    Browse the repository at this point in the history
  10. capsule.sh: add script for working with capsules

    Change-Id: Ia72cff286f2dd4399d7874c1defe114ef8d95f33
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    94a5371 View commit details
    Browse the repository at this point in the history
  11. soc/intel/fast_spi/mmap_boot.c: allow mapping whole flash

    Add CONFIG_EXT_BIOS_FILL_UP to make BIOS region include everything
    preceding it in the flash.
    
    Change-Id: I885252a488bd35fc3afef571e6178642a059f883
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    0b8658a View commit details
    Browse the repository at this point in the history
  12. configs/config.msi_ms7e06_*: add CONFIG_OPTION_BACKEND_NONE=y

    UEFI board variants use UEFI variables directly instead of using them
    through options API.  More importantly, be consistent with Z690-A.
    
    Change-Id: I283b2198dbbb81baebf84d2eff33c0cd238b118d
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    5ec0bad View commit details
    Browse the repository at this point in the history
  13. mb/ms{7d25,7e06}/Kconfig: enable MEMORY_MAPPED_TPM

    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    eb5182e View commit details
    Browse the repository at this point in the history
  14. configs/config.msi_*: enable CPU configuration menu

    Allows specifying how many performance/efficiency cores should run and
    whether hyper-threading is enabled.
    
    Change-Id: I540305af30be59652429f44d58f094aed549e9d1
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    1a783c2 View commit details
    Browse the repository at this point in the history
  15. .github: check capsule configuration in defconfigs

    Change-Id: I0e309d79cf4d58e8f5d7468c74eb2281ea4f9857
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    76b8650 View commit details
    Browse the repository at this point in the history
  16. 3rdparty/dasharo-blobs: bump for 0x12B Raptor Lake firmware

    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    7d65447 View commit details
    Browse the repository at this point in the history
  17. soc/alderlake/Makefile.mk: use microcode from dasharo-blobs

    ms7d25 and ms7e06 contain the same microcode.
    
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    29d8004 View commit details
    Browse the repository at this point in the history
  18. configs/config.msi_*: v1.1.4-rc0 and v0.9.2-rc0

    This version is necessary to enable testing capsule updates first
    introduced for these boards.
    
    Change-Id: I9d709c08cf771b5ddecdda936d7507c7f81016a5
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    79e54af View commit details
    Browse the repository at this point in the history
  19. configs/config.msi_*: v1.1.4-rc1 and v0.9.2-rc1

    This is real release candidate for these releases.
    
    Change-Id: I6b48ca82f6fc756b6032ef0695309db06328251f
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    e3152b0 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2024

  1. .github/scripts/capsule-lint.sh: fix location check

    Change-Id: I02687d504f50007463c3813c8a5c9d5604f4ba2b
    Signed-off-by: Sergii Dmytruk <[email protected]>
    SergiiDmytruk committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    b18c294 View commit details
    Browse the repository at this point in the history