linux/arch/parisc/include/asm
Linus Torvalds 4356e9f841 work around gcc bugs with 'asm goto' with outputs
We've had issues with gcc and 'asm goto' before, and we created a
'asm_volatile_goto()' macro for that in the past: see commits
3f0116c323 ("compiler/gcc4: Add quirk for 'asm goto' miscompilation
bug") and a9f180345f ("compiler/gcc4: Make quirk for
asm_volatile_goto() unconditional").

Then, much later, we ended up removing the workaround in commit
43c249ea0b ("compiler-gcc.h: remove ancient workaround for gcc PR
58670") because we no longer supported building the kernel with the
affected gcc versions, but we left the macro uses around.

Now, Sean Christopherson reports a new version of a very similar
problem, which is fixed by re-applying that ancient workaround.  But the
problem in question is limited to only the 'asm goto with outputs'
cases, so instead of re-introducing the old workaround as-is, let's
rename and limit the workaround to just that much less common case.

It looks like there are at least two separate issues that all hit in
this area:

 (a) some versions of gcc don't mark the asm goto as 'volatile' when it
     has outputs:

        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98619
        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110420

     which is easy to work around by just adding the 'volatile' by hand.

 (b) Internal compiler errors:

        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110422

     which are worked around by adding the extra empty 'asm' as a
     barrier, as in the original workaround.

but the problem Sean sees may be a third thing since it involves bad
code generation (not an ICE) even with the manually added 'volatile'.

but the same old workaround works for this case, even if this feels a
bit like voodoo programming and may only be hiding the issue.

Reported-and-tested-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/all/20240208220604.140859-1-seanjc@google.com/
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Uros Bizjak <ubizjak@gmail.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Andrew Pinski <quic_apinski@quicinc.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-02-09 15:57:48 -08:00
..
alternative.h parisc: Mark altinstructions read-only and 32-bit aligned 2023-11-25 09:43:17 +01:00
asm-offsets.h
asmregs.h
assembly.h parisc: Fix random data corruption from exception handler 2024-01-30 17:18:58 +01:00
atomic.h locking/atomic: parisc: add preprocessor symbols 2023-06-05 09:57:16 +02:00
barrier.h
bitops.h
bug.h parisc: Fix asm operand number out of range build error in bug table 2023-11-27 11:01:38 +01:00
cache.h parisc: BTLB: Initialize BTLB tables at CPU startup 2023-09-07 09:12:20 +02:00
cacheflush.h mm: Introduce flush_cache_vmap_early() 2023-12-14 00:23:17 -08:00
checksum.h
cmpxchg.h locking/arch: Rename all internal __xchg() names to __arch_xchg() 2023-04-29 09:08:44 +02:00
compat.h
compat_ucontext.h
current.h
delay.h
dma-mapping.h
dma.h parisc: dma: Add prototype for pcxl_dma_start 2023-08-10 19:12:16 +02:00
dwarf.h
eisa_bus.h
eisa_eeprom.h
elf.h parisc: fix mmap_base calculation when stack grows upwards 2023-11-15 15:30:09 -08:00
extable.h parisc: Fix random data corruption from exception handler 2024-01-30 17:18:58 +01:00
fb.h arch/parisc: Implement <asm/fb.h> with generic helpers 2023-04-20 10:05:01 +02:00
fixmap.h
floppy.h
ftrace.h parisc: ftrace: Add declaration for ftrace_function_trampoline() 2023-08-10 22:51:54 +02:00
futex.h
grfioctl.h parisc: Drop HP-UX constants and structs from grfioctl.h 2023-05-03 17:43:26 +02:00
hardirq.h
hardware.h
hash.h
hugetlb.h mm: hugetlb: add huge page size param to set_huge_pte_at() 2023-09-29 17:20:47 -07:00
io.h asm/io: remove unnecessary xlate_dev_mem_ptr() and unxlate_dev_mem_ptr() 2023-11-23 10:37:40 +01:00
irq.h
irqflags.h parisc: Check if IRQs are disabled when calling arch_local_irq_restore() 2023-06-30 17:14:13 +02:00
jump_label.h work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
kbdleds.h
Kbuild
kexec.h
kfence.h
kgdb.h parisc: Limit amount of kgdb breakpoints on parisc 2023-05-03 17:41:21 +02:00
kprobes.h
ldcw.h parisc: Mark lock_aligned variables 16-byte aligned on SMP 2023-11-25 09:43:17 +01:00
led.h parisc: led: Rewrite LED/LCD driver to utilizize Linux LED subsystem 2023-08-28 17:58:14 +02:00
linkage.h
mmu.h
mmu_context.h
mmzone.h
module.h
page.h
parisc-device.h
parport.h
patch.h
pci.h
pdc.h parisc: firmware: Simplify calling non-PA20 functions 2023-09-07 09:12:20 +02:00
pdc_chassis.h
pdcpat.h
perf.h
perf_event.h
pgalloc.h
pgtable.h Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
prefetch.h
processor.h parisc: fix mmap_base calculation when stack grows upwards 2023-11-15 15:30:09 -08:00
psw.h
ptrace.h
ropes.h parisc: sba-iommu: Fix sparse warnigs 2023-08-31 21:42:42 +02:00
rt_sigframe.h
runway.h parisc: ccio-dma: Create private runway procfs root entry 2023-08-28 18:00:27 +02:00
seccomp.h
sections.h
serial.h
shmparam.h parisc: shmparam.h: Document aliasing requirements of PA-RISC 2023-09-07 08:00:32 +02:00
signal.h
smp.h
socket.h
sparsemem.h
special_insns.h parisc: Fix random data corruption from exception handler 2024-01-30 17:18:58 +01:00
spinlock.h parisc: Fix lightweight spinlock checks to not break futexes 2023-08-10 17:32:09 +02:00
spinlock_types.h parisc: Restore __ldcw_align for PA-RISC 2.0 processors 2023-10-07 20:30:16 +02:00
string.h
superio.h
switch_to.h
syscall.h
thread_info.h
timex.h
tlb.h
tlbflush.h
topology.h
traps.h
uaccess.h parisc: Fix random data corruption from exception handler 2024-01-30 17:18:58 +01:00
ucontext.h
unaligned.h
unistd.h
unwind.h
vdso.h
vmalloc.h