linux_dsm_epyc7002/arch/arm64/include/asm
Kees Cook be604c616c arm64: sysreg: Make mrs_s and msr_s macros work with Clang and LTO
Clang's integrated assembler does not allow assembly macros defined
in one inline asm block using the .macro directive to be used across
separate asm blocks. LLVM developers consider this a feature and not a
bug, recommending code refactoring:

  https://bugs.llvm.org/show_bug.cgi?id=19749

As binutils doesn't allow macros to be redefined, this change uses
UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros
in-place and workaround gcc and clang limitations on redefining macros
across different assembler blocks.

Specifically, the current state after preprocessing looks like this:

asm volatile(".macro mXX_s ... .endm");
void f()
{
	asm volatile("mXX_s a, b");
}

With GCC, it gives macro redefinition error because sysreg.h is included
in multiple source files, and assembler code for all of them is later
combined for LTO (I've seen an intermediate file with hundreds of
identical definitions).

With clang, it gives macro undefined error because clang doesn't allow
sharing macros between inline asm statements.

I also seem to remember catching another sort of undefined error with
GCC due to reordering of macro definition asm statement and generated
asm code for function that uses the macro.

The solution with defining and undefining for each use, while certainly
not elegant, satisfies both GCC and clang, LTO and non-LTO.

Co-developed-by: Alex Matveev <alxmtvv@gmail.com>
Co-developed-by: Yury Norov <ynorov@caviumnetworks.com>
Co-developed-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2019-04-25 14:59:49 +01:00
..
xen arm64/xen: fix xen-swiotlb cache flushing 2019-01-23 22:14:56 +01:00
acenv.h
acpi.h arm64: KVM/mm: Move SEA handling behind a single 'claim' interface 2019-02-07 23:10:45 +01:00
alternative.h arm64: alternative: Apply alternatives early in boot process 2019-02-06 10:05:20 +00:00
arch_gicv3.h arm64: gic-v3: Implement arch support for priority masking 2019-02-06 10:05:21 +00:00
arch_timer.h
arm_dsu_pmu.h
arm-cci.h
asm-bug.h
asm-offsets.h
asm-prototypes.h
asm-uaccess.h arm64: Rename get_thread_info() 2019-02-26 16:57:59 +00:00
assembler.h arm64: add CVADP support to the cache maintenance helper 2019-04-16 16:27:58 +01:00
atomic_ll_sc.h Merge branch 'locking/atomics' into locking/core, to pick up WIP commits 2019-02-11 14:27:05 +01:00
atomic_lse.h Merge branch 'locking/atomics' into locking/core, to pick up WIP commits 2019-02-11 14:27:05 +01:00
atomic.h
barrier.h arm64: instrument smp_{load_acquire,store_release} 2019-04-16 16:28:00 +01:00
bitops.h
bitrev.h
boot.h
brk-imm.h arm64: probes: Move magic BRK values into brk-imm.h 2019-04-09 11:21:13 +01:00
bug.h
cache.h kasan, arm64: remove redundant ARCH_SLAB_MINALIGN define 2019-01-16 12:09:11 +00:00
cacheflush.h
checksum.h
clocksource.h
cmpxchg.h Merge branch 'locking/atomics' into locking/core, to pick up WIP commits 2019-02-11 14:27:05 +01:00
compat.h
cpu_ops.h
cpu.h
cpucaps.h arm64: Advertise ARM64_HAS_DCPODP cpu feature 2019-04-16 16:27:59 +01:00
cpufeature.h arm64: HWCAP: encapsulate elf_hwcap 2019-04-16 16:27:35 +01:00
cpuidle.h
cputype.h arm64: Add MIDR encoding for HiSilicon Taishan CPUs 2019-03-19 14:55:10 +00:00
current.h
daifflags.h arm64 updates for 5.1: 2019-03-10 10:17:23 -07:00
dcc.h
debug-monitors.h arm64: probes: Move magic BRK values into brk-imm.h 2019-04-09 11:21:13 +01:00
device.h arm64/xen: fix xen-swiotlb cache flushing 2019-01-23 22:14:56 +01:00
dma-mapping.h dma-mapping: add a kconfig symbol for arch_teardown_dma_ops availability 2019-02-13 19:12:50 +01:00
dmi.h
efi.h arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking 2019-02-06 10:05:19 +00:00
elf.h arm64: compat: Alloc separate pages for vectors and sigpage 2019-04-23 18:01:31 +01:00
esr.h arm64: Handle trapped DC CVADP 2019-04-16 16:27:36 +01:00
exception.h
exec.h
extable.h
fb.h
fixmap.h firmware: arm_sdei: Add ACPI GHES registration helper 2019-02-11 11:07:49 +01:00
fpsimd.h
fpsimdmacros.h
ftrace.h
futex.h
hardirq.h arm64: Fix HCR.TGE status for NMI contexts 2019-02-06 10:05:16 +00:00
hugetlb.h arm64/mm: enable HugeTLB migration for contiguous bit HugeTLB pages 2019-03-05 21:07:15 -08:00
hw_breakpoint.h
hwcap.h arm64: Expose SVE2 features for userspace 2019-04-23 18:02:00 +01:00
hypervisor.h
image.h
insn.h
io.h arm64: io: Hook up __io_par() for inX() ordering 2019-02-28 17:24:27 +00:00
irq_work.h
irq.h
irqflags.h arm64: sysreg: Make mrs_s and msr_s macros work with Clang and LTO 2019-04-25 14:59:49 +01:00
jump_label.h
kasan.h
Kbuild
kernel-pgtable.h
kexec.h
kgdb.h
kprobes.h arm64: kprobes: Avoid calling kprobes debug handlers explicitly 2019-04-09 11:21:13 +01:00
kvm_arm.h
kvm_asm.h
kvm_coproc.h
kvm_emulate.h arm64: KVM: Describe data or unified caches as having 1 set and 1 way 2019-02-19 21:05:49 +00:00
kvm_host.h ARM: some cleanups, direct physical timer assignment, cache sanitization 2019-03-15 15:00:28 -07:00
kvm_hyp.h arm64: sysreg: Make mrs_s and msr_s macros work with Clang and LTO 2019-04-25 14:59:49 +01:00
kvm_mmio.h
kvm_mmu.h KVM: arm/arm64: vgic-its: Take the srcu lock when writing to guest memory 2019-03-19 17:56:56 +00:00
kvm_ras.h arm64: KVM/mm: Move SEA handling behind a single 'claim' interface 2019-02-07 23:10:45 +01:00
linkage.h
lse.h
memory.h arm64: mm: check virtual addr in virt_to_page() if CONFIG_DEBUG_VIRTUAL=y 2019-04-16 16:27:59 +01:00
mmu_context.h
mmu.h arm64: Remove asm/memblock.h 2019-01-21 17:31:15 +00:00
mmzone.h
module.h
neon-intrinsics.h arm64/neon: Disable -Wincompatible-pointer-types when building with Clang 2019-02-18 10:54:47 +00:00
neon.h
numa.h
page-def.h
page.h
paravirt.h
pci.h
percpu.h
perf_event.h
pgalloc.h arm64: mm: enable per pmd page table lock 2019-04-09 11:21:50 +01:00
pgtable-hwdef.h arm64: Add workaround for Fujitsu A64FX erratum 010001 2019-02-28 16:24:25 +00:00
pgtable-prot.h
pgtable-types.h
pgtable.h
pointer_auth.h arm64: Use the correct style for SPDX License Identifier 2019-04-16 16:28:01 +01:00
preempt.h
probes.h
proc-fns.h
processor.h arm64: compat: Reduce address limit 2019-04-10 17:38:12 +01:00
ptdump.h arm64: dump: no need to check return value of debugfs_create functions 2019-01-31 17:38:19 +00:00
ptrace.h arm64: ptrace: Add function argument access API 2019-04-12 17:04:27 +01:00
sdei.h arm64: Use the correct style for SPDX License Identifier 2019-04-16 16:28:01 +01:00
seccomp.h
sections.h
shmparam.h
signal32.h arm64: compat: Alloc separate pages for vectors and sigpage 2019-04-23 18:01:31 +01:00
simd.h
smp_plat.h
smp.h
sparsemem.h
spinlock_types.h
spinlock.h
stack_pointer.h
stackprotector.h
stacktrace.h
stage2_pgtable.h KVM: ARM: Remove pgtable page standard functions from stage-2 page tables 2019-04-09 11:21:50 +01:00
stat.h
string.h
suspend.h
sync_bitops.h
syscall_wrapper.h
syscall.h
sysreg.h arm64: sysreg: Make mrs_s and msr_s macros work with Clang and LTO 2019-04-25 14:59:49 +01:00
system_misc.h arm64: mm: Make show_pte() a static function 2019-04-03 13:36:54 +01:00
thread_info.h arm64: Remove documentation about TIF_USEDFPU 2019-02-26 16:41:10 +00:00
timex.h
tlb.h arm64: mm: enable per pmd page table lock 2019-04-09 11:21:50 +01:00
tlbflush.h
topology.h
traps.h
uaccess.h arm64 updates for 5.1: 2019-03-10 10:17:23 -07:00
unistd32.h y2038: add 64-bit time_t syscalls to all 32-bit architectures 2019-02-07 00:13:28 +01:00
unistd.h y2038: add 64-bit time_t syscalls to all 32-bit architectures 2019-02-07 00:13:28 +01:00
uprobes.h
vdso_datapage.h arm64: vdso: Fix clock_getres() for CLOCK_REALTIME 2019-04-16 18:15:56 +01:00
vdso.h
virt.h
vmap_stack.h arm64: Use the correct style for SPDX License Identifier 2019-04-16 16:28:01 +01:00
word-at-a-time.h
xor.h