1. 27 Dec, 2021 3 commits
    • Chen Yu's avatar
      ACPI: Introduce Platform Firmware Runtime Telemetry driver · b0013e03
      Chen Yu authored
      This driver allows user space to fetch telemetry data from the
      firmware with the help of the Platform Firmware Runtime Telemetry
      interface.
      
      Both PFRU and PFRT are based on ACPI _DSM interfaces located under
      special device objects in the ACPI Namespace, but these interfaces
      are different from each other, so it is better to provide a separate
      driver from each of them, even though they share some common
      definitions and naming conventions.
      Tested-by: default avatarHongyu Ning <hongyu.ning@intel.com>
      Signed-off-by: default avatarChen Yu <yu.c.chen@intel.com>
      [ rjw: Subject and changelog edits ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b0013e03
    • Chen Yu's avatar
      ACPI: Introduce Platform Firmware Runtime Update device driver · 0db89fa2
      Chen Yu authored
      Introduce the pfr_update driver which can be used for Platform Firmware
      Runtime code injection and driver update [1].
      
      The user is expected to provide the EFI capsule, and pass it to the
      driver by writing the capsule to a device special file. The capsule
      is transferred by the driver to the platform firmware with the help
      of an ACPI _DSM method under the special ACPI Platform Firmware
      Runtime Update device (INTC1080), and the actual firmware update is
      carried out by the low-level Management Mode code in the platform
      firmware.
      
      This change allows certain pieces of the platform firmware to be
      updated on the fly while the system is running (runtime) without the
      need to restart it, which is key in the cases when the system needs to
      be available 100% of the time and it cannot afford the downtime related
      to restarting it, or when the work carried out by the system is
      particularly important, so it cannot be interrupted, and it is not
      practical to wait until it is complete.
      
      Link: https://uefi.org/sites/default/files/resources/Intel_MM_OS_Interface_Spec_Rev100.pdf # [1]
      Tested-by: default avatarHongyu Ning <hongyu.ning@intel.com>
      Signed-off-by: default avatarChen Yu <yu.c.chen@intel.com>
      [ rjw: Subject and changelog edits ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0db89fa2
    • Chen Yu's avatar
      efi: Introduce EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER and corresponding structures · 1882de7f
      Chen Yu authored
      Platform Firmware Runtime Update image starts with UEFI headers, and the
      headers are defined in UEFI specification, but some of them have not been
      defined in the kernel yet.
      
      For example, the header layout of a capsule file looks like this:
      
      EFI_CAPSULE_HEADER
      EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER
      EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER
      EFI_FIRMWARE_IMAGE_AUTHENTICATION
      
      These structures would be used by the Platform Firmware Runtime Update
      driver to parse the format of capsule file to verify if the corresponding
      version number is valid. In this way, if the user provides an invalid
      capsule image, the kernel could be used as a guard to reject it, without
      switching to the Management Mode (which might be costly).
      
      EFI_CAPSULE_HEADER has been defined in the kernel, but the other
      structures have not been defined yet, so do that. Besides,
      EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER and
      EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER are required to be packed
      in the uefi specification. For this reason, use the __packed attribute
      to indicate to the compiler that the entire structure can appear
      misaligned in memory (as suggested by Ard) in case one of them follows
      the other directly in a capsule header.
      Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarChen Yu <yu.c.chen@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1882de7f
  2. 26 Dec, 2021 4 commits
  3. 25 Dec, 2021 12 commits
  4. 24 Dec, 2021 3 commits
  5. 23 Dec, 2021 18 commits