mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v4 00/13] ARM: Map sections RO/XN
@ 2025-08-04 17:22 Ahmad Fatoum
  2025-08-04 17:22 ` [PATCH v4 01/13] mmu: explicitly map executable non-SDRAM regions with MAP_CODE Ahmad Fatoum
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2025-08-04 17:22 UTC (permalink / raw)
  To: barebox

This series replaces 7 patches that are in next to fix a barebox hang
when used together with OP-TEE.

Root cause is that we need to consider both reserved memory entries
and the text area at once, otherwise mapping non-reserved regions
cached would map the text area eXecute never

Changes in v4:
- skip TLB invalidation if remapping zero bytes
- share common memory bank remapping code
- fix reserved memory at end of RAM mapping barebox text
  eXecute Never
- add range helpers to make especially v4 code clearer
- pass map type not pte flags to early_remap_range

Changes in v3:
- rework create_sections() for Ahmads comments
- mention CR_S bit and DOMAIN_CLIENT in commit message
- Link to v2: https://lore.barebox.org/20250617-mmu-xn-ro-v2-0-3c7aa9046b67@pengutronix.de

Changes in v2:
- Tested and fixed for ARMv5
- merge create_pages() and create_sections() into one functions (ahmad)
- introduce function to create mapping flags based on CONFIG_ARM_MMU_PERMISSIONS
- Link to v1: https://lore.barebox.org/20250606-mmu-xn-ro-v1-0-7ee6ddd134d4@pengutronix.de

Ahmad Fatoum (8):
  mmu: explicitly map executable non-SDRAM regions with MAP_CODE
  ARM: mmu: skip TLB invalidation if remapping zero bytes
  ARM: mmu: provide setup_trap_pages for both 32- and 64-bit
  ARM: mmu: share common memory bank remapping code
  ARM: mmu: make mmu_remap_memory_banks clearer with helper
  partition: rename region_overlap_end to region_overlap_end_inclusive
  partition: define new region_overlap_end_exclusive helper
  ARM: mmu64: map text segment ro and data segments execute never

Sascha Hauer (5):
  ARM: pass barebox base to mmu_early_enable()
  ARM: mmu: move ARCH_MAP_WRITECOMBINE to header
  ARM: mmu: map memory for barebox proper pagewise
  ARM: mmu: map text segment ro and data segments execute never
  ARM: mmu64: map memory for barebox proper pagewise

 arch/arm/Kconfig                 |  12 ++++
 arch/arm/cpu/lowlevel_32.S       |   1 +
 arch/arm/cpu/mmu-common.c        |  69 +++++++++++++++++++++
 arch/arm/cpu/mmu-common.h        |  21 +++++++
 arch/arm/cpu/mmu_32.c            | 101 ++++++++++++++++++-------------
 arch/arm/cpu/mmu_64.c            |  88 ++++++++++++++++-----------
 arch/arm/cpu/uncompress.c        |   9 ++-
 arch/arm/include/asm/mmu.h       |   2 +-
 arch/arm/include/asm/pgtable64.h |   1 +
 arch/arm/lib32/barebox.lds.S     |   3 +-
 arch/arm/lib64/barebox.lds.S     |   5 +-
 arch/arm/mach-imx/romapi.c       |   3 +-
 commands/iomemport.c             |   2 +-
 common/memory.c                  |   7 ++-
 common/partitions.c              |   6 +-
 drivers/firmware/socfpga.c       |   4 ++
 drivers/hab/habv4.c              |   2 +-
 include/mmu.h                    |   1 +
 include/range.h                  |  30 +++++++--
 19 files changed, 268 insertions(+), 99 deletions(-)

-- 
2.39.5




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-08-05 10:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-04 17:22 [PATCH v4 00/13] ARM: Map sections RO/XN Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 01/13] mmu: explicitly map executable non-SDRAM regions with MAP_CODE Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 02/13] ARM: pass barebox base to mmu_early_enable() Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 03/13] ARM: mmu: move ARCH_MAP_WRITECOMBINE to header Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 04/13] ARM: mmu: map memory for barebox proper pagewise Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 05/13] ARM: mmu: skip TLB invalidation if remapping zero bytes Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 06/13] ARM: mmu: provide setup_trap_pages for both 32- and 64-bit Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 07/13] ARM: mmu: share common memory bank remapping code Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 08/13] ARM: mmu: make mmu_remap_memory_banks clearer with helper Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 09/13] partition: rename region_overlap_end to region_overlap_end_inclusive Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 10/13] partition: define new region_overlap_end_exclusive helper Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 11/13] ARM: mmu: map text segment ro and data segments execute never Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 12/13] ARM: mmu64: map memory for barebox proper pagewise Ahmad Fatoum
2025-08-04 17:22 ` [PATCH v4 13/13] ARM: mmu64: map text segment ro and data segments execute never Ahmad Fatoum
2025-08-05 10:18 ` [PATCH v4 00/13] ARM: Map sections RO/XN Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox