linux/arch/arm/include/asm
Mark Rutland ea1432a402 locking/atomic: arm: fix sync ops
[ Upstream commit dda5f312bb ]

The sync_*() ops on arch/arm are defined in terms of the regular bitops
with no special handling. This is not correct, as UP kernels elide
barriers for the fully-ordered operations, and so the required ordering
is lost when such UP kernels are run under a hypervsior on an SMP
system.

Fix this by defining sync ops with the required barriers.

Note: On 32-bit arm, the sync_*() ops are currently only used by Xen,
which requires ARMv7, but the semantics can be implemented for ARMv6+.

Fixes: e54d2f6152 ("xen/arm: sync_bitops")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230605070124.3741859-2-mark.rutland@arm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-19 16:21:02 +02:00
..
hardware ARM: footbridge: remove custom DMA address handling 2022-09-15 15:59:16 +02:00
mach ARM: footbridge: move isa-dma support into footbridge 2022-09-09 17:14:34 +02:00
vdso
xen arm/xen: Introduce xen_setup_dma_ops() 2022-06-06 08:54:33 +02:00
arch_gicv3.h irqchip/gic-v3: Refactor ISB + EOIR at ack time 2022-05-15 16:38:25 +01:00
arch_timer.h clocksource/drivers/arm_arch_timer: Drop unnecessary ISB on CVAL programming 2021-10-17 21:47:44 +02:00
archrandom.h random: remove CONFIG_ARCH_RANDOM 2022-07-18 15:03:37 +02:00
arm-cci.h
asm-offsets.h
assembler.h locking/atomic: arm: fix sync ops 2023-07-19 16:21:02 +02:00
atomic.h locking/atomic: arm: move to ARCH_ATOMIC 2021-05-26 13:20:50 +02:00
auxvec.h
barrier.h
bitops.h arm: align find_bit declarations with generic kernel 2022-07-14 15:21:43 -07:00
bitrev.h
bL_switcher.h
bug.h arm: print alloc free paths for address in registers 2021-05-07 00:26:34 -07:00
bugs.h
cache.h
cacheflush.h ARM development updates for 5.18: 2022-03-23 17:35:57 -07:00
cachetype.h
checksum.h
clocksource.h
cmpxchg.h locking/atomic: arm: move to ARCH_ATOMIC 2021-05-26 13:20:50 +02:00
compiler.h
cp15.h
cpu.h
cpufeature.h
cpuidle.h arm64 updates for 5.14 2021-06-28 14:04:24 -07:00
cputype.h
cti.h
current.h ARM: make get_current() and __my_cpu_offset() __always_inline 2022-01-31 16:06:35 +01:00
dcc.h
delay.h
device.h ARM/dma-mapping: remove the dma_coherent member of struct dev_archdata 2022-10-06 14:31:08 +02:00
div64.h ARM: 9118/1: div64: Remove always-true __div64_const32_is_OK() duplicate 2021-08-20 11:39:28 +01:00
dma-iommu.h
dma.h ARM: footbridge: remove custom DMA address handling 2022-09-15 15:59:16 +02:00
dmi.h
domain.h ARM: 9211/1: domain: drop modify_domain() 2022-07-06 22:44:49 +01:00
ecard.h
edac.h
efi.h efi/arm: libstub: move ARM specific code out of generic routines 2022-09-27 13:26:16 +02:00
elf.h ARM: module: implement support for PC-relative group relocations 2021-12-06 12:49:16 +01:00
exception.h
fb.h
fiq.h
firmware.h
fixmap.h ARM updates for 5.11: 2020-12-22 13:34:27 -08:00
floppy.h
fncpy.h
fpstate.h ARM: 9228/1: vfp: kill vfp_flush/release_thread() 2022-08-31 14:50:08 +01:00
ftrace.h ARM: 9184/1: return_address: disable again for CONFIG_ARM_UNWIND=y 2022-03-07 11:43:12 +00:00
futex.h
glue-cache.h
glue-df.h
glue-pf.h
glue-proc.h
glue.h
gpio.h ARM: 9103/1: Drop ARCH_NR_GPIOS definition 2021-08-10 12:16:07 +01:00
hardirq.h
highmem.h
hugetlb-3level.h
hugetlb.h
hw_breakpoint.h
hw_irq.h
hwcap.h
hypervisor.h arm/arm64: Probe for the presence of KVM hypervisor 2021-03-31 09:16:55 +01:00
ide.h
idmap.h
insn.h ARM: 9176/1: avoid literal references in inline assembly 2022-01-06 12:58:58 +00:00
io.h ARM: mm: kill unused runtime hook arch_iounmap() 2022-06-27 12:21:09 +01:00
irq_work.h ARM: 9217/1: add definition of arch_irq_work_raise() 2022-07-28 15:09:15 +01:00
irq.h ARM: remove old-style irq entry 2021-12-06 12:49:11 +01:00
irqflags.h
jump_label.h
kasan_def.h
kasan.h
Kbuild local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
kexec-internal.h ARM: kexec: fix oops after TLB are invalidated 2021-02-05 10:23:29 +00:00
kexec.h ARM: 9060/1: kexec: Remove unused kexec_reinit callback 2021-03-09 10:25:35 +00:00
kfence.h ARM: 9166/1: Support KFENCE for ARM 2021-12-17 11:34:38 +00:00
kgdb.h
kprobes.h
krait-l2-accessors.h
linkage.h
mc146818rtc.h
mcpm.h
mcs_spinlock.h
memblock.h
memory.h ARM: footbridge: remove custom DMA address handling 2022-09-15 15:59:16 +02:00
mmu_context.h ARM: mm: make vmalloc_seq handling SMP safe 2022-01-25 09:53:52 +01:00
mmu.h ARM: mm: make vmalloc_seq handling SMP safe 2022-01-25 09:53:52 +01:00
module.h ARM: 9204/2: module: Add all unwind tables when load module 2022-05-20 12:34:55 +01:00
module.lds.h
mpu.h
mtd-xip.h
neon.h
nwflash.h
opcodes-sec.h
opcodes-virt.h
opcodes.h ARM: 9145/1: patch: fix BE32 compilation 2021-10-25 13:12:36 +01:00
outercache.h
page-nommu.h
page.h ARM: mm: make vmalloc_seq handling SMP safe 2022-01-25 09:53:52 +01:00
paravirt_api_clock.h sched/headers: ARM needs asm/paravirt_api_clock.h too 2022-03-22 08:53:10 +01:00
paravirt.h x86/paravirt: Switch time pvops functions to use static_call() 2021-03-11 16:17:52 +01:00
patch.h
pci.h PCI: Remove pci_get_legacy_ide_irq() and asm-generic/pci.h 2022-07-22 17:23:45 -05:00
percpu.h ARM: make get_current() and __my_cpu_offset() __always_inline 2022-01-31 16:06:35 +01:00
perf_event.h ARM: 9251/1: perf: Fix stacktraces for tracepoint events in THUMB2 kernels 2022-11-07 14:16:43 +00:00
pgalloc.h mm/thp: define default pmd_pgtable() 2021-07-01 11:06:03 -07:00
pgtable-2level-hwdef.h
pgtable-2level-types.h
pgtable-2level.h arch: Add pmd_pfn() where it is missing 2022-03-21 12:59:02 -04:00
pgtable-3level-hwdef.h
pgtable-3level-types.h
pgtable-3level.h mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t * 2021-07-08 11:48:22 -07:00
pgtable-hwdef.h
pgtable-nommu.h ARM: 9266/1: mm: fix no-MMU ZERO_PAGE() implementation 2022-11-07 14:16:44 +00:00
pgtable.h ARM: 9266/1: mm: fix no-MMU ZERO_PAGE() implementation 2022-11-07 14:16:44 +00:00
probes.h
proc-fns.h
processor.h kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
procinfo.h
prom.h
psci.h
ptdump.h
ptrace.h ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction 2022-07-06 22:44:49 +01:00
seccomp.h
sections.h
secure_cntvoff.h
set_memory.h ARM: 9164/1: mm: Provide set_memory_valid() 2021-12-17 11:34:36 +00:00
setup.h ARM: 9147/1: add printf format attribute to early_print() 2021-10-25 13:12:37 +01:00
shmparam.h
signal.h
smp_plat.h
smp_scu.h
smp_twd.h
smp.h ARM: remove some dead code 2021-12-03 15:11:31 +01:00
sparsemem.h
spectre.h ARM: Spectre-BHB: provide empty stub for non-config 2022-03-11 12:42:49 -08:00
spinlock_types.h locking: Allow to include asm/spinlock_types.h from linux/spinlock_types_raw.h 2021-12-07 15:14:12 +01:00
spinlock.h locking: Fix typos in comments 2021-03-22 02:45:52 +01:00
stackprotector.h gcc-plugins: arm-ssp: Prepare for THREAD_INFO_IN_TASK support 2021-09-27 16:54:01 +02:00
stacktrace.h ARM: 9234/1: stacktrace: Avoid duplicate saving of exception PC value 2022-10-04 11:09:47 +01:00
string.h
suspend.h
swab.h
switch_to.h ARM development updates for 5.18: 2022-03-23 17:35:57 -07:00
sync_bitops.h locking/atomic: arm: fix sync ops 2023-07-19 16:21:02 +02:00
syscall.h arch: remove unused function syscall_set_arguments() 2021-09-14 16:06:20 +02:00
system_info.h
system_misc.h ARM: 9096/1: Remove arm_pm_restart() 2021-06-13 18:16:48 +01:00
tcm.h
therm.h
thread_info.h ARM: renumber bits related to _TIF_WORK_MASK 2023-01-12 12:01:55 +01:00
thread_notify.h
timex.h arm: use fallback for random_get_entropy() instead of zero 2022-05-13 23:59:23 +02:00
tlb.h
tlbflush.h mm: update legacy flush_tlb_* to use vma 2021-06-29 10:53:52 -07:00
tls.h ARM: smp: elide HWCAP_TLS checks or __entry_task updates on SMP+v6 2022-01-25 09:53:52 +01:00
topology.h arch_topology: Remove unused topology_set_thermal_pressure() and related 2021-11-23 15:10:26 +05:30
traps.h
uaccess-asm.h ARM: 9113/1: uaccess: remove set_fs() implementation 2021-08-20 11:39:27 +01:00
uaccess.h uaccess: generalize access_ok() 2022-02-25 09:36:05 +01:00
ucontext.h ARM: ep93xx: remove MaverickCrunch support 2021-08-04 13:30:04 +02:00
unified.h ARM: 9116/1: unified: Remove check for gcc < 4 2021-08-20 11:39:28 +01:00
unistd.h
unwind.h ARM: 9204/2: module: Add all unwind tables when load module 2022-05-20 12:34:55 +01:00
uprobes.h
user.h asm/user.h: killed unused macros 2022-01-30 21:17:00 -05:00
v7m.h irqchip: nvic: Use GENERIC_IRQ_MULTI_HANDLER 2021-12-06 12:49:16 +01:00
vdso_datapage.h
vdso.h
vermagic.h
vfp.h
vfpmacros.h
vga.h
virt.h
vmalloc.h
vmlinux.lds.h ARM: Do not use NOCROSSREFS directive with ld.lld 2022-03-09 14:14:16 -08:00
word-at-a-time.h
xor.h lib/xor: make xor prototypes more friendly to compiler vectorization 2022-02-11 20:39:39 +11:00