mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 14:33:30 +07:00
be604c616c
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> |
||
---|---|---|
.. | ||
xen | ||
acenv.h | ||
acpi.h | ||
alternative.h | ||
arch_gicv3.h | ||
arch_timer.h | ||
arm_dsu_pmu.h | ||
arm-cci.h | ||
asm-bug.h | ||
asm-offsets.h | ||
asm-prototypes.h | ||
asm-uaccess.h | ||
assembler.h | ||
atomic_ll_sc.h | ||
atomic_lse.h | ||
atomic.h | ||
barrier.h | ||
bitops.h | ||
bitrev.h | ||
boot.h | ||
brk-imm.h | ||
bug.h | ||
cache.h | ||
cacheflush.h | ||
checksum.h | ||
clocksource.h | ||
cmpxchg.h | ||
compat.h | ||
cpu_ops.h | ||
cpu.h | ||
cpucaps.h | ||
cpufeature.h | ||
cpuidle.h | ||
cputype.h | ||
current.h | ||
daifflags.h | ||
dcc.h | ||
debug-monitors.h | ||
device.h | ||
dma-mapping.h | ||
dmi.h | ||
efi.h | ||
elf.h | ||
esr.h | ||
exception.h | ||
exec.h | ||
extable.h | ||
fb.h | ||
fixmap.h | ||
fpsimd.h | ||
fpsimdmacros.h | ||
ftrace.h | ||
futex.h | ||
hardirq.h | ||
hugetlb.h | ||
hw_breakpoint.h | ||
hwcap.h | ||
hypervisor.h | ||
image.h | ||
insn.h | ||
io.h | ||
irq_work.h | ||
irq.h | ||
irqflags.h | ||
jump_label.h | ||
kasan.h | ||
Kbuild | ||
kernel-pgtable.h | ||
kexec.h | ||
kgdb.h | ||
kprobes.h | ||
kvm_arm.h | ||
kvm_asm.h | ||
kvm_coproc.h | ||
kvm_emulate.h | ||
kvm_host.h | ||
kvm_hyp.h | ||
kvm_mmio.h | ||
kvm_mmu.h | ||
kvm_ras.h | ||
linkage.h | ||
lse.h | ||
memory.h | ||
mmu_context.h | ||
mmu.h | ||
mmzone.h | ||
module.h | ||
neon-intrinsics.h | ||
neon.h | ||
numa.h | ||
page-def.h | ||
page.h | ||
paravirt.h | ||
pci.h | ||
percpu.h | ||
perf_event.h | ||
pgalloc.h | ||
pgtable-hwdef.h | ||
pgtable-prot.h | ||
pgtable-types.h | ||
pgtable.h | ||
pointer_auth.h | ||
preempt.h | ||
probes.h | ||
proc-fns.h | ||
processor.h | ||
ptdump.h | ||
ptrace.h | ||
sdei.h | ||
seccomp.h | ||
sections.h | ||
shmparam.h | ||
signal32.h | ||
simd.h | ||
smp_plat.h | ||
smp.h | ||
sparsemem.h | ||
spinlock_types.h | ||
spinlock.h | ||
stack_pointer.h | ||
stackprotector.h | ||
stacktrace.h | ||
stage2_pgtable.h | ||
stat.h | ||
string.h | ||
suspend.h | ||
sync_bitops.h | ||
syscall_wrapper.h | ||
syscall.h | ||
sysreg.h | ||
system_misc.h | ||
thread_info.h | ||
timex.h | ||
tlb.h | ||
tlbflush.h | ||
topology.h | ||
traps.h | ||
uaccess.h | ||
unistd32.h | ||
unistd.h | ||
uprobes.h | ||
vdso_datapage.h | ||
vdso.h | ||
virt.h | ||
vmap_stack.h | ||
word-at-a-time.h | ||
xor.h |