linux-stable/arch/arm
Linus Torvalds aaff74d886 work around gcc bugs with 'asm goto' with outputs
commit 4356e9f841 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'.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:24:47 +01:00
..
boot ARM: dts: imx23/28: Fix the DMA controller node name 2024-02-05 20:14:23 +00:00
common ARM: 9318/1: locomo: move kernel-doc to prevent warnings 2023-08-14 12:17:00 +01:00
configs Kbuild updates for v6.6 2023-09-05 11:01:47 -07:00
crypto
include work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:24:47 +01:00
kernel kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP 2023-12-13 18:45:19 +01:00
lib ARM: 9321/1: memset: cast the constant byte to unsigned char 2023-11-20 11:59:20 +01:00
mach-actions
mach-airoha
mach-alpine ARM: alpine: Drop unused includes 2023-08-12 10:30:59 +02:00
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 ARM: at91: Explicitly include correct DT includes 2023-07-29 16:56:04 +03:00
mach-axxia
mach-bcm ARM: bcm: Drop unused includes 2023-07-21 10:01:47 -07:00
mach-berlin ARM: berlin: Drop unused includes 2023-08-12 10:30:59 +02:00
mach-clps711x
mach-davinci ARM: 9330/1: davinci: also select PINCTRL 2024-01-25 15:35:49 -08:00
mach-digicolor
mach-dove ARM: dove: Drop unused includes 2023-08-12 10:30:59 +02:00
mach-ep93xx
mach-exynos ARM: SoC changes for 6.5 2023-06-29 15:28:33 -07:00
mach-footbridge
mach-gemini
mach-highbank
mach-hisi ARM: hisi: Drop unused includes 2023-07-19 06:29:04 +00:00
mach-hpe ARM: hpe: Drop unused includes 2023-08-12 10:30:59 +02:00
mach-imx ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init 2023-12-13 18:45:18 +01:00
mach-ixp4xx
mach-keystone ARM: keystone: Merge PM function into main support file 2023-08-01 23:57:28 -05:00
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson ARM: meson: Drop unused includes 2023-07-31 11:58:18 +02:00
mach-milbeaut
mach-mmp ARM: mmp: Drop unused includes 2023-08-12 10:31:00 +02:00
mach-moxart
mach-mstar
mach-mv78xx0
mach-mvebu ARM: mvebu: Explicitly include correct DT includes 2023-08-12 10:31:00 +02:00
mach-mxs ARM: 9298/1: Drop custom mdesc->handle_irq() 2023-06-19 09:35:48 +01:00
mach-nomadik ARM: nomadik: Drop unused includes 2023-08-12 10:31:00 +02:00
mach-npcm ARM: npcm: Drop unused includes 2023-08-12 10:31:00 +02:00
mach-nspire ARM: nspire: Remove unused header file mmio.h 2023-08-12 11:49:32 +02:00
mach-omap1 ARM: OMAP1: ams-delta: Fix MODEM initialization failure 2023-10-13 10:59:48 +03:00
mach-omap2 ARM: OMAP2+: Fix null pointer dereference and memory leak in omap_soc_device_init 2024-01-01 12:42:26 +00:00
mach-orion5x
mach-pxa ARM: SoC cleanups for 6.6 2023-08-30 16:49:40 -07:00
mach-qcom
mach-rda
mach-realtek
mach-rockchip ARM: rockchip: Drop unused includes 2023-08-12 10:31:00 +02:00
mach-rpc
mach-s3c
mach-s5pv210 ARM: s5pv210: Explicitly include correct DT includes 2023-08-14 18:15:48 +02:00
mach-sa1100 ARM: locomo: fix locomolcd_power declaration 2023-09-28 09:15:51 +02:00
mach-shmobile ARM: shmobile: rcar-gen2: Drop unused OF includes 2023-07-25 11:11:42 +02:00
mach-socfpga ARM: socfpga: Explicitly include correct DT includes 2023-07-20 14:38:38 -05:00
mach-spear ARM: spear: Explicitly include correct DT includes 2023-08-12 10:31:01 +02:00
mach-sti ARM: sti: Drop unused includes 2023-08-12 10:30:59 +02:00
mach-stm32
mach-sunplus
mach-sunxi ARM: sun9i: smp: fix return code check of of_property_match_string 2024-01-20 11:51:47 +01:00
mach-tegra
mach-uniphier
mach-ux500 ARM: ux500: Move power-domain driver to the genpd dir 2023-07-14 10:41:59 +02:00
mach-versatile ARM: versatile: Drop unused includes 2023-08-12 10:31:00 +02:00
mach-vt8500
mach-zynq ARM: zynq: Explicitly include correct DT includes 2023-07-20 17:06:50 +02:00
mm ARM: uniphier: fix cache kernel-doc warnings 2023-09-27 11:02:14 +02:00
net
nwfpe
plat-orion
probes ARM: 9303/1: kprobes: avoid missing-declaration warnings 2023-06-19 09:35:51 +01:00
tools arch: Register fchmodat2, usually as syscall 452 2023-07-27 12:25:35 +02:00
vdso ARM: 9313/1: vdso: add missing prototypes 2023-06-19 09:35:58 +01:00
vfp Merge branch 'devel-stable' into for-next 2023-08-14 12:18:06 +01:00
xen arm/xen: fix xen_vcpu_info allocation alignment 2023-12-03 07:33:05 +01:00
Kbuild
Kconfig treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
Kconfig-nommu
Kconfig.assembler
Kconfig.debug
Makefile