• Ard Biesheuvel's avatar
    efi: runtime: avoid EFIv2 runtime services on Apple x86 machines · f5390cd0
    Ard Biesheuvel authored
    Aditya reports [0] that his recent MacbookPro crashes in the firmware
    when using the variable services at runtime. The culprit appears to be a
    call to QueryVariableInfo(), which we did not use to call on Apple x86
    machines in the past as they only upgraded from EFI v1.10 to EFI v2.40
    firmware fairly recently, and QueryVariableInfo() (along with
    UpdateCapsule() et al) was added in EFI v2.00.
    
    The only runtime service introduced in EFI v2.00 that we actually use in
    Linux is QueryVariableInfo(), as the capsule based ones are optional,
    generally not used at runtime (all the LVFS/fwupd firmware update
    infrastructure uses helper EFI programs that invoke capsule update at
    boot time, not runtime), and not implemented by Apple machines in the
    first place. QueryVariableInfo() is used to 'safely' set variables,
    i.e., only when there is enough space. This prevents machines with buggy
    firmwares from corrupting their NVRAMs when they run out of space.
    
    Gi...
    f5390cd0
efi.c 26.3 KB