--- zzzz-none-000/linux-4.4.60/arch/arm64/include/asm/assembler.h 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/arch/arm64/include/asm/assembler.h 2021-02-04 17:41:59.000000000 +0000 @@ -193,6 +193,18 @@ str \src, [\tmp, :lo12:\sym] .endm + /* + * @dst: Result of READ_ONCE(per_cpu(sym, smp_processor_id())) + * @sym: The name of the per-cpu variable + * @tmp: scratch register + */ + .macro ldr_this_cpu dst, sym, tmp + adr_l \dst, \sym + mrs \tmp, tpidr_el1 + ldr \dst, [\dst, \tmp] + .endm + + /* * Annotate a function as position independent, i.e., safe to be called before * the kernel virtual mapping is activated.