All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/6] Fix page permission on arm64 architectures
@ 2025-02-05  7:16 Ilias Apalodimas
  2025-02-05  7:16 ` [PATCH v1 1/6] meminfo: add memory details for armv8 Ilias Apalodimas
                   ` (7 more replies)
  0 siblings, 8 replies; 46+ messages in thread
From: Ilias Apalodimas @ 2025-02-05  7:16 UTC (permalink / raw)
  To: xypron.glpk, trini
  Cc: Ilias Apalodimas, Alexey Brodkin, Eugeniy Paltsev, Caleb Connolly,
	Neil Armstrong, Sumit Garg, Huan Wang, Angelo Dureghello,
	Thomas Chou, Rick Chen, Leo, Marek Vasut, Nobuhiro Iwamatsu,
	Max Filippov, Simon Glass, Sughosh Ganu, Sam Protsenko,
	Pierre-Clément Tosi, Peng Fan, Richard Henderson,
	Sam Edwards, Jerome Forissier, Andre Przywara, Peter Hoyes,
	Patrick Rudolph, Sam Day, Mayuresh Chitale, Mattijs Korpershoek,
	Stefan Roese, Joshua Watt, Alex Shumsky, Jiaxun Yang, Jagan Teki,
	Evgeny Bachinin, Christian Marangi, Michal Simek, Jonas Jelonek,
	uboot-snps-arc, u-boot, u-boot-qcom

Hi!
This is v1 of [0].

This is an attempt to map the U-Boot binary properly, but leave the
area we load binaries unaffected and RWX.

There's a few changes since the RFC
- Fixed the alignment of meminfo command when printing regions
- 'meminfo' now prints arch specific attributes e.g PXN, UXN etc for arm
  instead of RW, RO, RX
- Since we don't set the permissions of EFI runtime services yet and keep
  them as RWX, I removed the linker alignment changes which makes patch #3
  easier to review. It's worth noting that qemu-arm sbsa was crashing with
  the efi services page aligned. This is probably due to a mismatch of
  memory, since the crash is only reproducible with QEMU instances that
  have < 2 GB of RAM. I'll fix that along with the efi runtime services
- Defined memory attribute changes properly with an enum for RW, RO, RX
  instead of the hardcoded '1,2,3' I had on the RFC
- Enabling mappings is now under a Kconfig (CONFIG_MMU_PGPROT), since
  peope reported crashes when testing this, which are orthogonal to this
  patch. We still have places in U-Boot where we define and later write
  const variables. This will lead to a crash now as const variables are
  properly managed and places in RO memory
- Split patches to be easier to review
- Added a patch updating 'meminfo'
- Picked up acked-by tags from Jerome

patch #1 adds printing capabilities for page mappings in 'meminfo'
patch #2 adds documention in 'meminfo' command
patch #3 prepares linker scripts, aligns sections in page boundaries etc
patch #4 prepares an internal function to change the PTEs
patch #5 adds function definitions & stubs for all archs
patch #6 wires up the changes in U-Boot after it relocates

[0] https://lore.kernel.org/u-boot/20250130072100.27297-1-ilias.apalodimas@linaro.org/

Ilias Apalodimas (6):
  meminfo: add memory details for armv8
  doc: update meminfo with arch specific information
  arm: Prepare linker scripts for memory permissions
  arm64: mmu_change_region_attr() add an option not to break PTEs
  treewide: Add a function to change page permissions
  arm64: Enable RW, RX and RO mappings for the relocated binary

 arch/arc/lib/cache.c                    |  2 +
 arch/arm/cpu/arm926ejs/cache.c          |  2 +
 arch/arm/cpu/armv7/cache_v7.c           |  1 +
 arch/arm/cpu/armv7m/cache.c             |  2 +
 arch/arm/cpu/armv8/cache_v8.c           | 54 +++++++++++++++++--
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 10 ++--
 arch/arm/cpu/armv8/u-boot.lds           | 29 +++++-----
 arch/arm/include/asm/armv8/mmu.h        |  2 +
 arch/arm/include/asm/system.h           | 11 +++-
 arch/arm/lib/cache.c                    |  2 +
 arch/arm/mach-snapdragon/board.c        |  2 +-
 arch/m68k/lib/cache.c                   |  2 +
 arch/nios2/lib/cache.c                  |  2 +
 arch/powerpc/lib/cache.c                |  2 +
 arch/riscv/lib/cache.c                  |  2 +
 arch/sh/cpu/sh4/cache.c                 |  2 +
 arch/xtensa/lib/cache.c                 |  2 +
 cmd/meminfo.c                           |  5 ++
 common/Kconfig                          | 13 +++++
 common/board_r.c                        | 20 +++++++
 doc/usage/cmd/meminfo.rst               | 71 ++++++++++++++++++-------
 include/asm-generic/sections.h          |  2 +
 include/cpu_func.h                      | 16 ++++++
 23 files changed, 215 insertions(+), 41 deletions(-)

--
2.47.2


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

end of thread, other threads:[~2025-02-20 13:50 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-05  7:16 [PATCH v1 0/6] Fix page permission on arm64 architectures Ilias Apalodimas
2025-02-05  7:16 ` [PATCH v1 1/6] meminfo: add memory details for armv8 Ilias Apalodimas
2025-02-05  9:27   ` Jerome Forissier
2025-02-05 10:32     ` Ilias Apalodimas
2025-02-11 21:08   ` Caleb Connolly
2025-02-05  7:16 ` [PATCH v1 2/6] doc: update meminfo with arch specific information Ilias Apalodimas
2025-02-05 17:22   ` Tom Rini
2025-02-05 17:35     ` Ilias Apalodimas
2025-02-06 12:31   ` Simon Glass
2025-02-06 12:32     ` Ilias Apalodimas
2025-02-05  7:16 ` [PATCH v1 3/6] arm: Prepare linker scripts for memory permissions Ilias Apalodimas
2025-02-05  8:22   ` Ilias Apalodimas
2025-02-05 12:41     ` Michal Simek
2025-02-05 13:11       ` Ilias Apalodimas
2025-02-05 19:03       ` Tom Rini
2025-02-05 17:23   ` Richard Henderson
2025-02-05 17:34     ` Ilias Apalodimas
2025-02-05 17:33   ` Tom Rini
2025-02-05 19:18     ` Ilias Apalodimas
2025-02-05 19:25       ` Tom Rini
2025-02-05 21:35         ` Ilias Apalodimas
2025-02-05  7:16 ` [PATCH v1 4/6] arm64: mmu_change_region_attr() add an option not to break PTEs Ilias Apalodimas
2025-02-05  7:16 ` [PATCH v1 5/6] treewide: Add a function to change page permissions Ilias Apalodimas
2025-02-05 16:47   ` Heinrich Schuchardt
2025-02-05 16:54     ` Ilias Apalodimas
2025-02-06  9:42       ` Ilias Apalodimas
2025-02-06 10:38         ` Heinrich Schuchardt
2025-02-06 12:30       ` Simon Glass
2025-02-06 12:51         ` Ilias Apalodimas
2025-02-06 12:58           ` Simon Glass
2025-02-06 15:15             ` Ilias Apalodimas
2025-02-06 15:47               ` Simon Glass
2025-02-06 16:21                 ` Ilias Apalodimas
2025-02-09 14:35                   ` Simon Glass
2025-02-09 16:36                     ` Tom Rini
2025-02-09 16:39                 ` Tom Rini
2025-02-09 20:15                   ` Simon Glass
2025-02-09 20:27                     ` Heinrich Schuchardt
2025-02-20  9:22                       ` Ilias Apalodimas
2025-02-09 16:37         ` Tom Rini
2025-02-05  7:16 ` [PATCH v1 6/6] arm64: Enable RW, RX and RO mappings for the relocated binary Ilias Apalodimas
2025-02-05  9:57   ` Jerome Forissier
2025-02-05 10:31     ` Ilias Apalodimas
2025-02-05 19:17       ` Tom Rini
2025-02-06  8:33 ` [PATCH v1 0/6] Fix page permission on arm64 architectures Neil Armstrong
2025-02-06 12:33 ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.