linux-stable/arch/arm64
Fangrui Song c9a4ef6645 arm64: Delete the space separator in __emit_inst
In assembly, many instances of __emit_inst(x) expand to a directive. In
a few places __emit_inst(x) is used as an assembler macro argument. For
example, in arch/arm64/kvm/hyp/entry.S

  ALTERNATIVE(nop, SET_PSTATE_PAN(1), ARM64_HAS_PAN, CONFIG_ARM64_PAN)

expands to the following by the C preprocessor:

  alternative_insn nop, .inst (0xd500401f | ((0) << 16 | (4) << 5) | ((!!1) << 8)), 4, 1

Both comma and space are separators, with an exception that content
inside a pair of parentheses/quotes is not split, so the clang
integrated assembler splits the arguments to:

   nop, .inst, (0xd500401f | ((0) << 16 | (4) << 5) | ((!!1) << 8)), 4, 1

GNU as preprocesses the input with do_scrub_chars(). Its arm64 backend
(along with many other non-x86 backends) sees:

  alternative_insn nop,.inst(0xd500401f|((0)<<16|(4)<<5)|((!!1)<<8)),4,1
  # .inst(...) is parsed as one argument

while its x86 backend sees:

  alternative_insn nop,.inst (0xd500401f|((0)<<16|(4)<<5)|((!!1)<<8)),4,1
  # The extra space before '(' makes the whole .inst (...) parsed as two arguments

The non-x86 backend's behavior is considered unintentional
(https://sourceware.org/bugzilla/show_bug.cgi?id=25750).
So drop the space separator inside `.inst (...)` to make the clang
integrated assembler work.

Suggested-by: Ilie Halip <ilie.halip@gmail.com>
Signed-off-by: Fangrui Song <maskray@google.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/939
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2020-04-15 13:07:12 +01:00
..
boot ARM: devicetree updates for v5.7 2020-04-03 15:22:05 -07:00
configs ARM: defconfig updates 2020-04-03 15:15:10 -07:00
crypto SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
include arm64: Delete the space separator in __emit_inst 2020-04-15 13:07:12 +01:00
kernel arm64: vdso: don't free unallocated pages 2020-04-15 11:13:16 +01:00
kvm virtio: fixes, vdpa 2020-04-08 10:51:53 -07:00
lib arm64: fix spelling mistake "ca not" -> "cannot" 2020-03-17 18:22:40 +00:00
mm mm/memory_hotplug: add pgprot_t to mhp_params 2020-04-10 15:36:21 -07:00
net
xen arm64: xen: Use modern annotations for assembly functions 2020-01-09 16:09:42 +00:00
Kbuild
Kconfig arm64 fixes: 2020-04-09 11:04:16 -07:00
Kconfig.debug arm64: remove CONFIG_DEBUG_ALIGN_RODATA feature 2020-04-01 21:44:43 +01:00
Kconfig.platforms ARM: SoC updates 2020-04-03 15:02:35 -07:00
Makefile arm64: Always force a branch protection mode when the compiler has one 2020-04-01 21:23:40 +01:00