Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Nov 24, 2024
    • Tom Rini's avatar
      Merge patch series "Fix device removal order for Apple dart iommu" · 880fcc49
      Tom Rini authored
      Janne Grunau <j@jannau.net> says:
      
      Starting with v2024.10 dev_iommu_dma_unmap calls during device removal
      trigger a NULL pointer dereference in the Apple dart iommu driver. The
      iommu device is removed before its user. The sparsely used DM_FLAG_VITAL
      flag is intended to describe this dependency. Add it to the driver.
      
      Adding this flag is unfortunately not enough since the boot routines
      except the arm one simply remove all drivers. Add and use a new function
      which calls
          dm_remove_devioce_flags(DM_REMOVE_ACTIVE_ALL | DM_REMOVE_NON_VITAL);
          dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL);
      to ensure this order dependency is head consistently.
      
      Link: https://lore.kernel.org/r/20241123-iommu_apple_dart_ordering-v2-0-cc2ade6dde97@jannau.net
      880fcc49
    • Janne Grunau's avatar
      dm: Add dm_remove_devices_active() for ordered device removal · dabaa4ae
      Janne Grunau authored
      
      This replaces dm_remove_devices_flags() calls in all boot
      implementations to ensure non vital devices are consistently removed
      first. All boot implementation except arch/arm/lib/bootm.c currently
      just call dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL). This can result
      in crashes when dependencies between devices exists. The driver model's
      design document describes DM_FLAG_VITAL as "indicates that the device is
      'vital' to the operation of other devices". Device removal at boot
      should follow this.
      
      Instead of adding dm_remove_devices_flags() with (DM_REMOVE_ACTIVE_ALL |
      DM_REMOVE_NON_VITAL) everywhere add dm_remove_devices_active() which
      does this.
      
      Fixes a NULL pointer deref in the apple dart IOMMU driver during EFI
      boot. The xhci-pci (driver which depends on the IOMMU to work) removes
      its mapping on removal. This explodes when the IOMMU device was removed
      first.
      
      dm_remove_devices_flags() is kept since it is used for testing of
      device_remove() calls in dm.
      
      Signed-off-by: default avatarJanne Grunau <j@jannau.net>
      dabaa4ae
    • Janne Grunau's avatar
      iommu: apple: Mark device with DM_FLAG_VITAL · 544a76ba
      Janne Grunau authored
      
      Avoids NULL pointer dereferences in apple_dart_unmap when the iommu
      device is removed before its user. U-boot's device model does not track
      dependencies between devices.
      Observed on a M1 Ultra Mac Studio with v2024.10.
      
      Acked-by: default avatarMark Kettenis <kettenis@openbsd.org>
      Signed-off-by: default avatarJanne Grunau <j@jannau.net>
      544a76ba
    • Tom Rini's avatar
      Merge tag 'efi-2025-01-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi · 6c791b66
      Tom Rini authored
      CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/23529
      
      - Documentation:
        - Document wget syntax enhancements with lwIP network stack
        - Move README.kconfig to HTML documentation
        - Remove redundant README.TPL
      - UEFI:
        - Simplify efi_tcg2_hash_log_extend_event()
        - Allow EFI_LOADER_BOUNCE_BUFFER on all architectures
        - Correctly unmap and free memory on errors
      - Other:
       - Enable EFI_LOADER_BOUNCE_BUFFER on StarFive VisionFive 2
      6c791b66
    • Ilias Apalodimas's avatar
      lmb: Correctly unmap and free memory on errors · 967d57ab
      Ilias Apalodimas authored
      
      We never free and unmap the memory on errors and we never unmap it when
      freeing it. The latter won't cause any problems even on sandbox, but for
      consistency always use unmap_sysmem()
      
      Fixes: commit 22f2c9ed ("efi: memory: use the lmb API's for allocating and freeing memory")
      Reviewed-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      Signed-off-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      967d57ab
  2. Nov 23, 2024
  3. Nov 22, 2024
  4. Nov 20, 2024
Loading