mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: mmu: ensure PTE is written at once
@ 2025-05-21 17:41 Ahmad Fatoum
  2025-05-21 17:41 ` [PATCH 1/4] arch: sync READ_ONCE/WRITE_ONCE with Linux Ahmad Fatoum
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2025-05-21 17:41 UTC (permalink / raw)
  To: barebox

Writing the PTE with a normal non-volatile access is a bad idea, because
speculation may already use a partially written entry.

Use WRITE_ONCE to turn this into a volatile write via a new set_pte
helper. The extra helper is useful for type enforcement and for future
extension when we start to consistently apply break-before-make[1].

Ahmad Fatoum (4):
  arch: sync READ_ONCE/WRITE_ONCE with Linux
  ARM64: mmu: document granule size calculation
  ARM: mmu: ensure PTE is written at once
  WIP: break before make and don't invalidate uncached regions being
    remapped

 Documentation/devel/porting.rst     |   2 +
 arch/arm/cpu/mmu_32.c               | 247 +++++++++++++++++++++++-----
 arch/arm/cpu/mmu_64.c               |  38 ++++-
 arch/arm/include/asm/barrier.h      |   8 +
 arch/kvx/include/asm/barrier.h      |   2 +
 arch/mips/include/asm/barrier.h     |   8 +
 arch/openrisc/include/asm/barrier.h |   8 +
 arch/powerpc/include/asm/barrier.h  |   8 +
 arch/sandbox/include/asm/barrier.h  |   8 +
 arch/x86/include/asm/barrier.h      |   8 +
 include/asm-generic/barrier.h       |  24 +++
 include/asm-generic/rwonce.h        |  87 ++++++++++
 include/linux/bitops.h              |   2 +-
 include/linux/compiler.h            |  94 -----------
 include/linux/compiler_types.h      |  46 ++++++
 include/linux/list.h                |   1 +
 16 files changed, 449 insertions(+), 142 deletions(-)
 create mode 100644 arch/arm/include/asm/barrier.h
 create mode 100644 arch/mips/include/asm/barrier.h
 create mode 100644 arch/openrisc/include/asm/barrier.h
 create mode 100644 arch/powerpc/include/asm/barrier.h
 create mode 100644 arch/sandbox/include/asm/barrier.h
 create mode 100644 arch/x86/include/asm/barrier.h
 create mode 100644 include/asm-generic/barrier.h
 create mode 100644 include/asm-generic/rwonce.h

-- 
2.39.5




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

end of thread, other threads:[~2025-05-26 13:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-21 17:41 [PATCH 0/4] ARM: mmu: ensure PTE is written at once Ahmad Fatoum
2025-05-21 17:41 ` [PATCH 1/4] arch: sync READ_ONCE/WRITE_ONCE with Linux Ahmad Fatoum
2025-05-21 17:41 ` [PATCH 2/4] ARM64: mmu: document granule size calculation Ahmad Fatoum
2025-05-21 17:41 ` [PATCH 3/4] ARM: mmu: ensure PTE is written at once Ahmad Fatoum
2025-05-21 17:41 ` [PATCH 4/4] WIP: break before make and don't invalidate uncached regions being remapped Ahmad Fatoum
2025-05-26 13:51 ` (subset) [PATCH 0/4] ARM: mmu: ensure PTE is written at once Sascha Hauer

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