linux-stable/arch/parisc/include/asm
Linus Torvalds f70efe54b9 work around gcc bugs with 'asm goto' with outputs
commit 68fb3ca0e4 upstream.

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'.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:12:28 +01:00
..
Kbuild parisc: syscalls: switch to generic syscalltbl.sh 2021-04-27 09:43:56 +02:00
agp.h agp: define proper stubs for empty helpers 2022-01-29 22:24:25 +01:00
alternative.h parisc: Mark altinstructions read-only and 32-bit aligned 2023-12-08 08:51:16 +01:00
asm-offsets.h
asmregs.h
assembly.h parisc: Mark ex_table entries 32-bit aligned in assembly.h 2023-12-08 08:51:15 +01:00
atomic.h locking/atomic: parisc: move to ARCH_ATOMIC 2021-05-26 13:20:51 +02:00
barrier.h parisc: Add alternative patching to synchronize_caches define 2020-10-15 08:10:38 +02:00
bitops.h Revert "parisc: Show error if wrong 32/64-bit compiler is being used" 2022-08-22 11:09:17 +02:00
bug.h parisc: Fix asm operand number out of range build error in bug table 2023-12-13 18:39:24 +01:00
cache.h parisc: Don't enforce DMA completion order in cache flushes 2022-05-23 13:44:24 +02:00
cacheflush.h parisc: Fix flush_dcache_page() for usage from irq context 2023-05-30 14:03:18 +01:00
checksum.h saner calling conventions for csum_and_copy_..._user() 2020-08-20 15:45:15 -04:00
cmpxchg.h locking/atomic: parisc: move to ARCH_ATOMIC 2021-05-26 13:20:51 +02:00
compat.h asm-generic: compat: Cleanup duplicate definitions 2022-04-26 13:35:54 -07:00
compat_ucontext.h
current.h parisc: Reduce code size by optimizing get_current() function calls 2022-03-11 19:49:31 +01:00
delay.h
dma-mapping.h
dma.h PCI: Move isa_dma_bridge_buggy out of asm/dma.h 2022-07-22 17:24:47 -05:00
dwarf.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
eisa_bus.h
eisa_eeprom.h
elf.h parisc: Add vDSO support 2022-03-11 19:49:30 +01:00
fb.h parisc/stifb: Fix fb_is_primary_device() only available with CONFIG_FB_STI 2022-06-07 13:01:17 +02:00
fixmap.h parisc: Don't hardcode assembler bit definitions in tmpalias code 2022-05-23 13:44:24 +02:00
floppy.h arch/*/: remove CONFIG_VIRT_TO_BUS 2022-06-28 13:20:21 +02:00
ftrace.h parisc/ftrace: Add ARCH_SUPPORTS_FTRACE_OPS support 2019-08-03 08:56:57 +02:00
futex.h uaccess: remove CONFIG_SET_FS 2022-02-25 09:36:06 +01:00
grfioctl.h
hardirq.h softirq: Move __ARCH_HAS_DO_SOFTIRQ to Kconfig 2021-02-10 23:34:16 +01:00
hardware.h parisc: Avoid printing the hardware path twice 2022-10-31 15:37:14 +01:00
hash.h
hugetlb.h mm: change huge_ptep_clear_flush() to return the original pte 2022-05-13 16:48:55 -07:00
ide.h parisc: Drop ifdef __KERNEL__ from non-uapi kernel headers 2021-11-01 07:36:00 +01:00
io.h parisc: hide ioread64 declaration on 32-bit 2022-09-12 21:27:19 +02:00
irq.h parisc: Remove leftover reference to the power_tasklet 2021-01-26 19:57:26 +01:00
irqflags.h
jump_label.h work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:12:28 +01:00
kbdleds.h
kexec.h parisc: fix compilation when KEXEC=n and KEXEC_FILE=y 2019-12-15 21:05:38 +01:00
kfence.h parisc: Add KFENCE support 2021-10-30 23:11:00 +02:00
kgdb.h
kprobes.h parisc: Avoid using hardware single-step in kprobes 2022-03-18 09:10:14 +01:00
ldcw.h parisc: Mark lock_aligned variables 16-byte aligned on SMP 2023-12-08 08:51:15 +01:00
led.h parisc: led: Fix LAN receive and transmit LEDs 2023-09-19 12:27:57 +02:00
linkage.h
machdep.h
mckinley.h parisc: Drop ifdef __KERNEL__ from non-uapi kernel headers 2021-11-01 07:36:00 +01:00
mmu.h parisc: Add vDSO support 2022-03-11 19:49:30 +01:00
mmu_context.h parisc: Use constants to encode the space registers like SR_KERNEL 2022-03-11 19:49:31 +01:00
mmzone.h
module.h
page.h parisc: Rewrite cache flush code for PA8800/PA8900 2022-05-17 21:52:47 +02:00
parisc-device.h parisc: Make struct parisc_driver::remove() return void 2021-08-30 10:18:25 +02:00
parport.h
patch.h parisc: add support for patching multiple words 2019-06-08 12:56:25 +02:00
pci.h PCI: Remove pci_get_legacy_ide_irq() and asm-generic/pci.h 2022-07-22 17:23:45 -05:00
pdc.h parisc: Replace regular spinlock with spin_trylock on panic path 2023-05-24 17:32:42 +01:00
pdc_chassis.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
pdcpat.h parisc: Add PDC locking functions for rendezvous code 2022-03-29 21:37:12 +02:00
perf.h
perf_event.h
pgalloc.h parisc: rename PGD_ORDER to PGD_TABLE_ORDER 2022-07-17 17:14:43 -07:00
pgtable.h parisc: Drop PMD_SHIFT from calculation in pgtable.h 2023-01-07 11:11:56 +01:00
prefetch.h
processor.h kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
psw.h parisc: asm: psw.h: missing header guard 2019-06-25 14:52:26 +02:00
ptrace.h parisc: Use PRIV_USER and PRIV_KERNEL in ptrace.h 2021-11-01 07:36:00 +01:00
ropes.h parisc: sba: Fix compile warning wrt list of SBA devices 2023-10-06 14:56:51 +02:00
rt_sigframe.h parisc: Add vDSO support 2022-03-11 19:49:30 +01:00
runway.h parisc: Drop ifdef __KERNEL__ from non-uapi kernel headers 2021-11-01 07:36:00 +01:00
seccomp.h parisc: Enable seccomp architecture tracking 2020-11-20 11:16:34 -08:00
sections.h asm-generic: Refactor dereference_[kernel]_function_descriptor() 2022-02-16 23:25:11 +11:00
serial.h
shmparam.h
signal.h signal/parisc: Remove parisc specific definition of __ARCH_UAPI_SA_FLAGS 2020-11-30 13:43:35 -06:00
smp.h parisc: Implement __cpu_die() and __cpu_disable() for CPU hotplugging 2022-03-29 21:37:12 +02:00
socket.h parisc: Define O_NONBLOCK to become 000200000 2020-10-15 08:10:38 +02:00
sparsemem.h
special_insns.h parisc: Add constants for control registers and clean up mfctl() 2022-03-29 21:37:12 +02:00
spinlock.h locking: Remove spin_lock_flags() etc 2021-10-30 16:37:28 +02:00
spinlock_types.h parisc: Restore __ldcw_align for PA-RISC 2.0 processors 2023-10-10 22:00:45 +02:00
string.h Revert "parisc: Add assembly implementations for memset, strlen, strcpy, strncpy and strcat" 2021-08-29 10:13:32 -07:00
superio.h
switch_to.h
syscall.h parisc: define syscall_get_error() 2019-07-16 19:23:24 -07:00
thread_info.h parisc: move CPU field back into thread_info 2021-11-04 11:21:47 +01:00
timex.h parisc: define get_cycles macro for arch-override 2022-05-13 23:59:23 +02:00
tlb.h parisc: use pgtable-nopXd instead of 4level-fixup 2019-12-04 19:44:15 -08:00
tlbflush.h parisc: Add vDSO support 2022-03-11 19:49:30 +01:00
topology.h parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY 2022-03-29 21:37:12 +02:00
traps.h parisc: Fix handling off probe non-access faults 2022-03-11 19:49:30 +01:00
uaccess.h parisc: Mark ex_table entries 32-bit aligned in uaccess.h 2023-12-08 08:51:15 +01:00
ucontext.h
unaligned.h parisc: Drop ifdef __KERNEL__ from non-uapi kernel headers 2021-11-01 07:36:00 +01:00
unistd.h RISC-V Patches for the 5.19 Merge Window, Part 1 2022-05-31 14:10:54 -07:00
unwind.h
vdso.h parisc: Add vDSO support 2022-03-11 19:49:30 +01:00
vmalloc.h mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00