[PATCH 0/6] resource: record memory type/attrs on all SDRAM

Ahmad Fatoum a.fatoum at barebox.org
Wed May 21 05:53:03 PDT 2025


When running as EFI loader, barebox is expected to provide a virtual
memory map that describes the memory regions known to barebox as well as
attributes like whether regions are write-back cached (usable as normal
memory) or reserved (e.g., for OP-TEE).

>From a security point of view, it's useful to have this information
always to inform MMU attributes, so let's make it mandatory.

Ahmad Fatoum (6):
  memory: export inside_barebox_area
  resource: record EFI memory type and attributes
  resource: add MEMATTRS_ definitions for common attribute sets
  drivers: tee: optee: separate local variables for each resource
  resource: supply memory type/attrs on all SDRAM requests
  resource: retire IORESOURCE_BUSY in favor of resource::type

 arch/arm/cpu/armv7r-mpu.c       |  5 ++-
 arch/arm/cpu/bootm-fip.c        |  3 +-
 arch/arm/cpu/cpu.c              |  3 +-
 arch/arm/cpu/mmu_32.c           | 13 ++++--
 arch/arm/cpu/mmu_64.c           |  7 ++-
 arch/arm/cpu/start.c            |  3 +-
 arch/arm/lib32/bootm.c          | 18 +++++---
 arch/arm/lib32/bootz.c          |  4 +-
 arch/mips/lib/cpu-probe.c       |  3 +-
 arch/powerpc/mach-mpc5xxx/cpu.c |  3 +-
 arch/powerpc/mach-mpc85xx/cpu.c |  2 +-
 arch/riscv/boot/start.c         |  2 +-
 arch/riscv/cpu/core.c           |  2 +-
 commands/iomemport.c            |  2 +-
 common/bootm.c                  |  9 ++--
 common/elf.c                    |  3 +-
 common/memory.c                 | 57 +++++++++++++++++-------
 common/memtest.c                |  4 +-
 common/oftree.c                 |  2 +-
 common/pe.c                     |  4 +-
 common/uimage.c                 |  6 ++-
 drivers/tee/optee/of_fixup.c    | 33 +++++++-------
 fs/pstore/ram_core.c            |  6 ++-
 include/efi.h                   | 37 +--------------
 include/efi/memtype.h           | 79 +++++++++++++++++++++++++++++++++
 include/linux/ioport.h          | 67 +++++++++++++++++++++++++++-
 include/memory.h                | 33 +++++++++++---
 lib/Kconfig.hardening           |  7 +++
 lib/libfile.c                   | 13 +++++-
 pbl/handoff-data.c              |  3 +-
 30 files changed, 320 insertions(+), 113 deletions(-)
 create mode 100644 include/efi/memtype.h

-- 
2.39.5




More information about the barebox mailing list