tree:
https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git devel
head: 94ff56d3b360c9a7dc6d0bb3f3f26ec3f5f58592
commit: fc32f1ee21f93af9cd4f597d7c749dd42939e23e [65/69] linkage: asm/x86, perform symbol
pair checking (per group)
config: arm64-randconfig-r026-20200612 (attached as .config)
compiler: clang version 11.0.0 (
https://github.com/llvm/llvm-project
d7e6f116f4517952fbdf5ad4b5ff67e378600c60)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git checkout fc32f1ee21f93af9cd4f597d7c749dd42939e23e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
arch/arm64/kernel/head.S: Assembler messages:
> arch/arm64/kernel/head.S:279: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/kernel/head.S:420: Error: junk at end
of line, first unrecognized character is `('
> arch/arm64/kernel/head.S:420: Error: symbol `SYM_L_LOCAL' is
already defined
arch/arm64/kernel/head.S:495: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/kernel/head.S:662: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/kernel/head.S:662: Error: symbol `SYM_L_LOCAL' is already defined
arch/arm64/kernel/head.S:705: Error: junk at end of line, first unrecognized character is
`('
> arch/arm64/kernel/head.S:705: Error: symbol `SYM_L_GLOBAL' is
already defined
arch/arm64/kernel/head.S:723: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/kernel/head.S:723: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/kernel/head.S:729: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/kernel/head.S:729: Error: symbol `SYM_L_LOCAL' is already defined
arch/arm64/kernel/head.S:741: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/kernel/head.S:741: Error: symbol `SYM_L_LOCAL' is already defined
arch/arm64/kernel/head.S:764: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/kernel/head.S:764: Error: symbol `SYM_L_LOCAL' is already defined
arch/arm64/kernel/head.S:800: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/kernel/head.S:800: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/kernel/head.S:826: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/kernel/head.S:826: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/kernel/head.S:846: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/kernel/head.S:846: Error: symbol `SYM_L_LOCAL' is already defined
arch/arm64/kernel/head.S:857: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/kernel/head.S:857: Error: symbol `SYM_L_LOCAL' is already defined
arch/arm64/kernel/head.S:962: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/kernel/head.S:962: Error: symbol `SYM_L_LOCAL' is already defined
/tmp/head-76229b.s: Error: .size expression for el2_setup does not evaluate to a constant
/tmp/head-76229b.s: Error: .size expression for set_cpu_boot_mode_flag does not evaluate
to a constant
/tmp/head-76229b.s: Error: .size expression for __create_page_tables does not evaluate to
a constant
/tmp/head-76229b.s: Error: .size expression for __primary_switch does not evaluate to a
constant
/tmp/head-76229b.s: Error: .size expression for __primary_switched does not evaluate to a
constant
/tmp/head-76229b.s: Error: .size expression for secondary_startup does not evaluate to a
constant
/tmp/head-76229b.s: Error: .size expression for secondary_holding_pen does not evaluate to
a constant
/tmp/head-76229b.s: Error: .size expression for secondary_entry does not evaluate to a
constant
/tmp/head-76229b.s: Error: .size expression for __cpu_secondary_check52bitva does not
evaluate to a constant
/tmp/head-76229b.s: Error: .size expression for __enable_mmu does not evaluate to a
constant
/tmp/head-76229b.s: Error: .size expression for __secondary_switched does not evaluate to
a constant
/tmp/head-76229b.s: Error: .size expression for __secondary_too_slow does not evaluate to
a constant
/tmp/head-76229b.s: Error: .size expression for __no_granule_support does not evaluate to
a constant
/tmp/head-76229b.s: Error: .size expression for __relocate_kernel does not evaluate to a
constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
--
arch/arm64/kernel/reloc_test_syms.S: Assembler messages:
> arch/arm64/kernel/reloc_test_syms.S:8: Error: junk at end of
line, first unrecognized character is `('
arch/arm64/kernel/reloc_test_syms.S:14: Error: junk at end of line, first
unrecognized character is `('
> arch/arm64/kernel/reloc_test_syms.S:14: Error: symbol
`SYM_L_GLOBAL' is already defined
arch/arm64/kernel/reloc_test_syms.S:20: Error:
junk at end of line, first unrecognized character is `('
arch/arm64/kernel/reloc_test_syms.S:20: Error: symbol `SYM_L_GLOBAL' is already
defined
arch/arm64/kernel/reloc_test_syms.S:27: Error: junk at end of line, first unrecognized
character is `('
arch/arm64/kernel/reloc_test_syms.S:27: Error: symbol `SYM_L_GLOBAL' is already
defined
arch/arm64/kernel/reloc_test_syms.S:34: Error: junk at end of line, first unrecognized
character is `('
arch/arm64/kernel/reloc_test_syms.S:34: Error: symbol `SYM_L_GLOBAL' is already
defined
arch/arm64/kernel/reloc_test_syms.S:44: Error: junk at end of line, first unrecognized
character is `('
arch/arm64/kernel/reloc_test_syms.S:44: Error: symbol `SYM_L_GLOBAL' is already
defined
arch/arm64/kernel/reloc_test_syms.S:52: Error: junk at end of line, first unrecognized
character is `('
arch/arm64/kernel/reloc_test_syms.S:52: Error: symbol `SYM_L_GLOBAL' is already
defined
arch/arm64/kernel/reloc_test_syms.S:58: Error: junk at end of line, first unrecognized
character is `('
arch/arm64/kernel/reloc_test_syms.S:58: Error: symbol `SYM_L_GLOBAL' is already
defined
arch/arm64/kernel/reloc_test_syms.S:63: Error: junk at end of line, first unrecognized
character is `('
arch/arm64/kernel/reloc_test_syms.S:63: Error: symbol `SYM_L_GLOBAL' is already
defined
arch/arm64/kernel/reloc_test_syms.S:71: Error: junk at end of line, first unrecognized
character is `('
arch/arm64/kernel/reloc_test_syms.S:71: Error: symbol `SYM_L_GLOBAL' is already
defined
arch/arm64/kernel/reloc_test_syms.S:79: Error: junk at end of line, first unrecognized
character is `('
arch/arm64/kernel/reloc_test_syms.S:79: Error: symbol `SYM_L_GLOBAL' is already
defined
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for absolute_data64 does not
evaluate to a constant
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for absolute_data32 does not
evaluate to a constant
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for absolute_data16 does not
evaluate to a constant
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for signed_movw does not evaluate
to a constant
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for unsigned_movw does not evaluate
to a constant
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for relative_adrp does not evaluate
to a constant
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for relative_adrp_far does not
evaluate to a constant
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for relative_adr does not evaluate
to a constant
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for relative_data64 does not
evaluate to a constant
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for relative_data32 does not
evaluate to a constant
/tmp/reloc_test_syms-bf46d9.s: Error: .size expression for relative_data16 does not
evaluate to a constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
--
arch/arm64/kernel/entry.S: Assembler messages:
> arch/arm64/kernel/entry.S:901: Error: junk at end of line, first
unrecognized character is `('
/tmp/entry-290aa7.s: Error: .size expression for
cpu_switch_to does not evaluate to a constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
--
arch/arm64/kernel/entry-fpsimd.S: Assembler messages:
> arch/arm64/kernel/entry-fpsimd.S:19: Error: junk at end of line,
first unrecognized character is `('
arch/arm64/kernel/entry-fpsimd.S:29: Error:
junk at end of line, first unrecognized character is `('
> arch/arm64/kernel/entry-fpsimd.S:29: Error: symbol
`SYM_L_GLOBAL' is already defined
arch/arm64/kernel/entry-fpsimd.S:35: Error:
junk at end of line, first unrecognized character is `('
arch/arm64/kernel/entry-fpsimd.S:35: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/kernel/entry-fpsimd.S:40: Error: junk at end of line, first unrecognized
character is `('
arch/arm64/kernel/entry-fpsimd.S:40: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/kernel/entry-fpsimd.S:45: Error: junk at end of line, first unrecognized
character is `('
arch/arm64/kernel/entry-fpsimd.S:45: Error: symbol `SYM_L_GLOBAL' is already defined
/tmp/entry-fpsimd-66374e.s: Error: .size expression for fpsimd_save_state does not
evaluate to a constant
/tmp/entry-fpsimd-66374e.s: Error: .size expression for fpsimd_load_state does not
evaluate to a constant
/tmp/entry-fpsimd-66374e.s: Error: .size expression for sve_save_state does not evaluate
to a constant
/tmp/entry-fpsimd-66374e.s: Error: .size expression for sve_load_state does not evaluate
to a constant
/tmp/entry-fpsimd-66374e.s: Error: .size expression for sve_get_vl does not evaluate to a
constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
--
arch/arm64/kernel/hyp-stub.S: Assembler messages:
> arch/arm64/kernel/hyp-stub.S:109: Error: junk at end of line,
first unrecognized character is `('
arch/arm64/kernel/hyp-stub.S:116: Error:
junk at end of line, first unrecognized character is `('
> arch/arm64/kernel/hyp-stub.S:116: Error: symbol
`SYM_L_GLOBAL' is already defined
/tmp/hyp-stub-9b7a23.s: Error: .size
expression for __hyp_set_vectors does not evaluate to a constant
/tmp/hyp-stub-9b7a23.s: Error: .size expression for __hyp_reset_vectors does not evaluate
to a constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
--
arch/arm64/kernel/smccc-call.S: Assembler messages:
> arch/arm64/kernel/smccc-call.S:33: Error: junk at end of line,
first unrecognized character is `('
arch/arm64/kernel/smccc-call.S:44: Error:
junk at end of line, first unrecognized character is `('
> arch/arm64/kernel/smccc-call.S:44: Error: symbol
`SYM_L_GLOBAL' is already defined
/tmp/smccc-call-e892d2.s: Error: .size
expression for __arm_smccc_smc does not evaluate to a constant
/tmp/smccc-call-e892d2.s: Error: .size expression for __arm_smccc_hvc does not evaluate to
a constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
--
arch/arm64/kernel/sleep.S: Assembler messages:
> arch/arm64/kernel/sleep.S:65: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/kernel/sleep.S:113: Error: junk at end
of line, first unrecognized character is `('
> arch/arm64/kernel/sleep.S:113: Error: symbol `SYM_L_GLOBAL'
is already defined
/tmp/sleep-0b7984.s: Error: .size expression for
__cpu_suspend_enter does not evaluate to a constant
/tmp/sleep-0b7984.s: Error: .size expression for _cpu_resume does not evaluate to a
constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
--
arch/arm64/mm/cache.S: Assembler messages:
> arch/arm64/mm/cache.S:27: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/mm/cache.S:40: Error: junk at end of
line, first unrecognized character is `('
> arch/arm64/mm/cache.S:40: Error: symbol `SYM_L_GLOBAL' is
already defined
arch/arm64/mm/cache.S:80: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/mm/cache.S:80: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/mm/cache.S:108: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/mm/cache.S:108: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/mm/cache.S:122: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/mm/cache.S:122: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/mm/cache.S:141: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/mm/cache.S:142: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/mm/cache.S:142: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/mm/cache.S:180: Error: junk at end of line, first unrecognized character is
`('
> arch/arm64/mm/cache.S:180: Error: symbol `SYM_L_LOCAL' is
already defined
arch/arm64/mm/cache.S:181: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/mm/cache.S:181: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/mm/cache.S:203: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/mm/cache.S:203: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/mm/cache.S:219: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/mm/cache.S:219: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/mm/cache.S:230: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/mm/cache.S:230: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/mm/cache.S:242: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/mm/cache.S:242: Error: symbol `SYM_L_GLOBAL' is already defined
/tmp/cache-6d3f62.s: Error: .size expression for __flush_icache_range does not evaluate to
a constant
/tmp/cache-6d3f62.s: Error: .size expression for __flush_cache_user_range does not
evaluate to a constant
/tmp/cache-6d3f62.s: Error: .size expression for invalidate_icache_range does not evaluate
to a constant
/tmp/cache-6d3f62.s: Error: .size expression for __flush_dcache_area does not evaluate to
a constant
/tmp/cache-6d3f62.s: Error: .size expression for __clean_dcache_area_pou does not evaluate
to a constant
/tmp/cache-6d3f62.s: Error: .size expression for __inval_dcache_area does not evaluate to
a constant
/tmp/cache-6d3f62.s: Error: .size expression for __dma_inv_area does not evaluate to a
constant
/tmp/cache-6d3f62.s: Error: .size expression for __clean_dcache_area_poc does not evaluate
to a constant
/tmp/cache-6d3f62.s: Error: .size expression for __dma_clean_area does not evaluate to a
constant
/tmp/cache-6d3f62.s: Error: .size expression for __clean_dcache_area_pop does not evaluate
to a constant
/tmp/cache-6d3f62.s: Error: .size expression for __dma_flush_area does not evaluate to a
constant
/tmp/cache-6d3f62.s: Error: .size expression for __dma_map_area does not evaluate to a
constant
/tmp/cache-6d3f62.s: Error: .size expression for __dma_unmap_area does not evaluate to a
constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
--
arch/arm64/mm/proc.S: Assembler messages:
> arch/arm64/mm/proc.S:64: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/mm/proc.S:101: Error: junk at end of
line, first unrecognized character is `('
> arch/arm64/mm/proc.S:101: Error: symbol `SYM_L_GLOBAL' is
already defined
arch/arm64/mm/proc.S:182: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/mm/proc.S:182: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/mm/proc.S:222: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/mm/proc.S:222: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/mm/proc.S:407: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/mm/proc.S:407: Error: symbol `SYM_L_GLOBAL' is already defined
/tmp/proc-2e1b71.s: Error: .size expression for cpu_do_suspend does not evaluate to a
constant
/tmp/proc-2e1b71.s: Error: .size expression for cpu_do_resume does not evaluate to a
constant
/tmp/proc-2e1b71.s: Error: .size expression for idmap_cpu_replace_ttbr1 does not evaluate
to a constant
/tmp/proc-2e1b71.s: Error: .size expression for idmap_kpti_install_ng_mappings does not
evaluate to a constant
/tmp/proc-2e1b71.s: Error: .size expression for __cpu_setup does not evaluate to a
constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
--
arch/arm64/kvm/hyp.S: Assembler messages:
> arch/arm64/kvm/hyp.S:31: Error: junk at end of line, first
unrecognized character is `('
/tmp/hyp-a75cac.s: Error: .size expression for
__kvm_call_hyp does not evaluate to a constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
--
arch/arm64/xen/hypercall.S: Assembler messages:
> arch/arm64/xen/hypercall.S:74: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/xen/hypercall.S:75: Error: junk at end
of line, first unrecognized character is `('
> arch/arm64/xen/hypercall.S:75: Error: symbol `SYM_L_GLOBAL'
is already defined
arch/arm64/xen/hypercall.S:76: Error: junk at end of line, first
unrecognized character is `('
arch/arm64/xen/hypercall.S:76: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:77: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:77: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:78: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:78: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:79: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:79: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:80: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:80: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:81: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:81: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:82: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:82: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:83: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:83: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:84: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:84: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:85: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:85: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:86: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:86: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:87: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:87: Error: symbol `SYM_L_GLOBAL' is already defined
arch/arm64/xen/hypercall.S:89: Error: junk at end of line, first unrecognized character is
`('
arch/arm64/xen/hypercall.S:89: Error: symbol `SYM_L_GLOBAL' is already defined
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_xen_version does not
evaluate to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_console_io does not
evaluate to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_grant_table_op does not
evaluate to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_sched_op does not evaluate
to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_event_channel_op does not
evaluate to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_hvm_op does not evaluate
to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_memory_op does not
evaluate to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_physdev_op does not
evaluate to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_vcpu_op does not evaluate
to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_tmem_op does not evaluate
to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_platform_op_raw does not
evaluate to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_multicall does not
evaluate to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_vm_assist does not
evaluate to a constant
/tmp/hypercall-472250.s: Error: .size expression for HYPERVISOR_dm_op does not evaluate to
a constant
/tmp/hypercall-472250.s: Error: .size expression for privcmd_call does not evaluate to a
constant
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
..
vim +420 arch/arm64/kernel/head.S
0370b31e48454d Steve Capper 2018-01-11 266
0370b31e48454d Steve Capper 2018-01-11 267 compute_indices \vstart, \vend,
#SWAPPER_BLOCK_SHIFT, #PTRS_PER_PTE, \istart, \iend, \count
0370b31e48454d Steve Capper 2018-01-11 268 bic \count, \phys, #SWAPPER_BLOCK_SIZE
- 1
0370b31e48454d Steve Capper 2018-01-11 269 populate_entries \tbl, \count,
\istart, \iend, \flags, #SWAPPER_BLOCK_SIZE, \tmp
034edabe6cf1d0 Laura Abbott 2014-11-21 270 .endm
034edabe6cf1d0 Laura Abbott 2014-11-21 271
034edabe6cf1d0 Laura Abbott 2014-11-21 272 /*
034edabe6cf1d0 Laura Abbott 2014-11-21 273 * Setup the initial page tables. We
only setup the barest amount which is
034edabe6cf1d0 Laura Abbott 2014-11-21 274 * required to get the kernel running.
The following sections are required:
034edabe6cf1d0 Laura Abbott 2014-11-21 275 * - identity mapping to enable the
MMU (low address, TTBR0)
034edabe6cf1d0 Laura Abbott 2014-11-21 276 * - first few MB of the kernel
linear mapping to jump to once the MMU has
61bd93ce801bb6 Ard Biesheuvel 2015-06-01 277 * been enabled
034edabe6cf1d0 Laura Abbott 2014-11-21 278 */
c63d9f82db9439 Mark Brown 2020-02-18 @279
SYM_FUNC_START_LOCAL(__create_page_tables)
f80fb3a3d50843 Ard Biesheuvel 2016-01-26 280 mov x28, lr
034edabe6cf1d0 Laura Abbott 2014-11-21 281
034edabe6cf1d0 Laura Abbott 2014-11-21 282 /*
8eb7e28d4c642c Jun Yao 2018-09-24 283 * Invalidate the init page tables to
avoid potential dirty cache lines
8eb7e28d4c642c Jun Yao 2018-09-24 284 * being evicted. Other page tables
are allocated in rodata as part of
8eb7e28d4c642c Jun Yao 2018-09-24 285 * the kernel image, and thus are
clean to the PoC per the boot
8eb7e28d4c642c Jun Yao 2018-09-24 286 * protocol.
034edabe6cf1d0 Laura Abbott 2014-11-21 287 */
8eb7e28d4c642c Jun Yao 2018-09-24 288 adrp x0, init_pg_dir
2b5548b68199c1 Jun Yao 2018-09-24 289 adrp x1, init_pg_end
0370b31e48454d Steve Capper 2018-01-11 290 sub x1, x1, x0
d46befef4c03fb Robin Murphy 2017-07-25 291 bl __inval_dcache_area
034edabe6cf1d0 Laura Abbott 2014-11-21 292
034edabe6cf1d0 Laura Abbott 2014-11-21 293 /*
8eb7e28d4c642c Jun Yao 2018-09-24 294 * Clear the init page tables.
034edabe6cf1d0 Laura Abbott 2014-11-21 295 */
8eb7e28d4c642c Jun Yao 2018-09-24 296 adrp x0, init_pg_dir
2b5548b68199c1 Jun Yao 2018-09-24 297 adrp x1, init_pg_end
0370b31e48454d Steve Capper 2018-01-11 298 sub x1, x1, x0
034edabe6cf1d0 Laura Abbott 2014-11-21 299 1: stp xzr, xzr, [x0], #16
034edabe6cf1d0 Laura Abbott 2014-11-21 300 stp xzr, xzr, [x0], #16
034edabe6cf1d0 Laura Abbott 2014-11-21 301 stp xzr, xzr, [x0], #16
034edabe6cf1d0 Laura Abbott 2014-11-21 302 stp xzr, xzr, [x0], #16
d46befef4c03fb Robin Murphy 2017-07-25 303 subs x1, x1, #64
d46befef4c03fb Robin Murphy 2017-07-25 304 b.ne 1b
034edabe6cf1d0 Laura Abbott 2014-11-21 305
b03cc885328e3c Ard Biesheuvel 2016-04-18 306 mov x7, SWAPPER_MM_MMUFLAGS
034edabe6cf1d0 Laura Abbott 2014-11-21 307
034edabe6cf1d0 Laura Abbott 2014-11-21 308 /*
034edabe6cf1d0 Laura Abbott 2014-11-21 309 * Create the identity mapping.
034edabe6cf1d0 Laura Abbott 2014-11-21 310 */
aea73abb902651 Ard Biesheuvel 2016-08-16 311 adrp x0, idmap_pg_dir
5dfe9d7d23c26d Ard Biesheuvel 2015-06-01 312 adrp x3, __idmap_text_start //
__pa(__idmap_text_start)
dd006da21646f1 Ard Biesheuvel 2015-03-19 313
b6d00d47e81a49 Steve Capper 2019-08-07 314 #ifdef CONFIG_ARM64_VA_BITS_52
67e7fdfcc6824a Steve Capper 2018-12-06 315 mrs_s x6, SYS_ID_AA64MMFR2_EL1
67e7fdfcc6824a Steve Capper 2018-12-06 316 and x6, x6, #(0xf <<
ID_AA64MMFR2_LVA_SHIFT)
67e7fdfcc6824a Steve Capper 2018-12-06 317 mov x5, #52
67e7fdfcc6824a Steve Capper 2018-12-06 318 cbnz x6, 1f
67e7fdfcc6824a Steve Capper 2018-12-06 319 #endif
90ec95cda91a02 Steve Capper 2019-08-07 320 mov x5, #VA_BITS_MIN
67e7fdfcc6824a Steve Capper 2018-12-06 321 1:
5383cc6efed137 Steve Capper 2019-08-07 322 adr_l x6, vabits_actual
67e7fdfcc6824a Steve Capper 2018-12-06 323 str x5, [x6]
67e7fdfcc6824a Steve Capper 2018-12-06 324 dmb sy
67e7fdfcc6824a Steve Capper 2018-12-06 325 dc ivac, x6 // Invalidate potentially
stale cache line
67e7fdfcc6824a Steve Capper 2018-12-06 326
dd006da21646f1 Ard Biesheuvel 2015-03-19 327 /*
fa2a8445b1d381 Kristina Martsenko 2017-12-13 328 * VA_BITS may be too small to allow
for an ID mapping to be created
fa2a8445b1d381 Kristina Martsenko 2017-12-13 329 * that covers system RAM if that is
located sufficiently high in the
fa2a8445b1d381 Kristina Martsenko 2017-12-13 330 * physical address space. So for the
ID map, use an extended virtual
fa2a8445b1d381 Kristina Martsenko 2017-12-13 331 * range in that case, and configure
an additional translation level
fa2a8445b1d381 Kristina Martsenko 2017-12-13 332 * if needed.
fa2a8445b1d381 Kristina Martsenko 2017-12-13 333 *
dd006da21646f1 Ard Biesheuvel 2015-03-19 334 * Calculate the maximum allowed value
for TCR_EL1.T0SZ so that the
5dfe9d7d23c26d Ard Biesheuvel 2015-06-01 335 * entire ID map region can be mapped.
As T0SZ == (64 - #bits used),
dd006da21646f1 Ard Biesheuvel 2015-03-19 336 * this number conveniently equals the
number of leading zeroes in
5dfe9d7d23c26d Ard Biesheuvel 2015-06-01 337 * the physical address of
__idmap_text_end.
dd006da21646f1 Ard Biesheuvel 2015-03-19 338 */
5dfe9d7d23c26d Ard Biesheuvel 2015-06-01 339 adrp x5, __idmap_text_end
dd006da21646f1 Ard Biesheuvel 2015-03-19 340 clz x5, x5
dd006da21646f1 Ard Biesheuvel 2015-03-19 341 cmp x5, TCR_T0SZ(VA_BITS) // default
T0SZ small enough?
fa2a8445b1d381 Kristina Martsenko 2017-12-13 342 b.ge 1f // .. then skip VA range
extension
dd006da21646f1 Ard Biesheuvel 2015-03-19 343
0c20856c260236 Mark Rutland 2015-03-24 344 adr_l x6, idmap_t0sz
0c20856c260236 Mark Rutland 2015-03-24 345 str x5, [x6]
0c20856c260236 Mark Rutland 2015-03-24 346 dmb sy
0c20856c260236 Mark Rutland 2015-03-24 347 dc ivac, x6 // Invalidate potentially
stale cache line
dd006da21646f1 Ard Biesheuvel 2015-03-19 348
fa2a8445b1d381 Kristina Martsenko 2017-12-13 349 #if (VA_BITS < 48)
fa2a8445b1d381 Kristina Martsenko 2017-12-13 350 #define EXTRA_SHIFT (PGDIR_SHIFT +
PAGE_SHIFT - 3)
fa2a8445b1d381 Kristina Martsenko 2017-12-13 351 #define EXTRA_PTRS (1 <<
(PHYS_MASK_SHIFT - EXTRA_SHIFT))
fa2a8445b1d381 Kristina Martsenko 2017-12-13 352
fa2a8445b1d381 Kristina Martsenko 2017-12-13 353 /*
fa2a8445b1d381 Kristina Martsenko 2017-12-13 354 * If VA_BITS < 48, we have to
configure an additional table level.
fa2a8445b1d381 Kristina Martsenko 2017-12-13 355 * First, we have to verify our
assumption that the current value of
fa2a8445b1d381 Kristina Martsenko 2017-12-13 356 * VA_BITS was chosen such that all
translation levels are fully
fa2a8445b1d381 Kristina Martsenko 2017-12-13 357 * utilised, and that lowering T0SZ
will always result in an additional
fa2a8445b1d381 Kristina Martsenko 2017-12-13 358 * translation level to be
configured.
fa2a8445b1d381 Kristina Martsenko 2017-12-13 359 */
fa2a8445b1d381 Kristina Martsenko 2017-12-13 360 #if VA_BITS != EXTRA_SHIFT
fa2a8445b1d381 Kristina Martsenko 2017-12-13 361 #error "Mismatch between VA_BITS
and page size/number of translation levels"
dd006da21646f1 Ard Biesheuvel 2015-03-19 362 #endif
dd006da21646f1 Ard Biesheuvel 2015-03-19 363
fa2a8445b1d381 Kristina Martsenko 2017-12-13 364 mov x4, EXTRA_PTRS
fa2a8445b1d381 Kristina Martsenko 2017-12-13 365 create_table_entry x0, x3,
EXTRA_SHIFT, x4, x5, x6
fa2a8445b1d381 Kristina Martsenko 2017-12-13 366 #else
fa2a8445b1d381 Kristina Martsenko 2017-12-13 367 /*
fa2a8445b1d381 Kristina Martsenko 2017-12-13 368 * If VA_BITS == 48, we don't have
to configure an additional
fa2a8445b1d381 Kristina Martsenko 2017-12-13 369 * translation level, but the
top-level table has more entries.
fa2a8445b1d381 Kristina Martsenko 2017-12-13 370 */
fa2a8445b1d381 Kristina Martsenko 2017-12-13 371 mov x4, #1 << (PHYS_MASK_SHIFT -
PGDIR_SHIFT)
fa2a8445b1d381 Kristina Martsenko 2017-12-13 372 str_l x4, idmap_ptrs_per_pgd, x5
fa2a8445b1d381 Kristina Martsenko 2017-12-13 373 #endif
fa2a8445b1d381 Kristina Martsenko 2017-12-13 374 1:
fa2a8445b1d381 Kristina Martsenko 2017-12-13 375 ldr_l x4, idmap_ptrs_per_pgd
5dfe9d7d23c26d Ard Biesheuvel 2015-06-01 376 mov x5, x3 //
__pa(__idmap_text_start)
5dfe9d7d23c26d Ard Biesheuvel 2015-06-01 377 adr_l x6, __idmap_text_end //
__pa(__idmap_text_end)
0370b31e48454d Steve Capper 2018-01-11 378
0370b31e48454d Steve Capper 2018-01-11 379 map_memory x0, x1, x3, x6, x7, x3, x4,
x10, x11, x12, x13, x14
034edabe6cf1d0 Laura Abbott 2014-11-21 380
034edabe6cf1d0 Laura Abbott 2014-11-21 381 /*
034edabe6cf1d0 Laura Abbott 2014-11-21 382 * Map the kernel image (starting with
PHYS_OFFSET).
034edabe6cf1d0 Laura Abbott 2014-11-21 383 */
2b5548b68199c1 Jun Yao 2018-09-24 384 adrp x0, init_pg_dir
18b9c0d6419382 Ard Biesheuvel 2016-04-18 385 mov_q x5, KIMAGE_VADDR +
TEXT_OFFSET // compile time __va(_text)
f80fb3a3d50843 Ard Biesheuvel 2016-01-26 386 add x5, x5, x23 // add KASLR
displacement
fa2a8445b1d381 Kristina Martsenko 2017-12-13 387 mov x4, PTRS_PER_PGD
18b9c0d6419382 Ard Biesheuvel 2016-04-18 388 adrp x6, _end // runtime __pa(_end)
18b9c0d6419382 Ard Biesheuvel 2016-04-18 389 adrp x3, _text // runtime
__pa(_text)
18b9c0d6419382 Ard Biesheuvel 2016-04-18 390 sub x6, x6, x3 // _end - _text
18b9c0d6419382 Ard Biesheuvel 2016-04-18 391 add x6, x6, x5 // runtime
__va(_end)
0370b31e48454d Steve Capper 2018-01-11 392
0370b31e48454d Steve Capper 2018-01-11 393 map_memory x0, x1, x5, x6, x7, x3, x4,
x10, x11, x12, x13, x14
034edabe6cf1d0 Laura Abbott 2014-11-21 394
034edabe6cf1d0 Laura Abbott 2014-11-21 395 /*
034edabe6cf1d0 Laura Abbott 2014-11-21 396 * Since the page tables have been
populated with non-cacheable
9d2d75ede59bc1 Gavin Shan 2020-04-28 397 * accesses (MMU disabled), invalidate
those tables again to
9d2d75ede59bc1 Gavin Shan 2020-04-28 398 * remove any speculatively loaded
cache lines.
034edabe6cf1d0 Laura Abbott 2014-11-21 399 */
9d2d75ede59bc1 Gavin Shan 2020-04-28 400 dmb sy
9d2d75ede59bc1 Gavin Shan 2020-04-28 401
aea73abb902651 Ard Biesheuvel 2016-08-16 402 adrp x0, idmap_pg_dir
9d2d75ede59bc1 Gavin Shan 2020-04-28 403 adrp x1, idmap_pg_end
9d2d75ede59bc1 Gavin Shan 2020-04-28 404 sub x1, x1, x0
9d2d75ede59bc1 Gavin Shan 2020-04-28 405 bl __inval_dcache_area
9d2d75ede59bc1 Gavin Shan 2020-04-28 406
9d2d75ede59bc1 Gavin Shan 2020-04-28 407 adrp x0, init_pg_dir
2b5548b68199c1 Jun Yao 2018-09-24 408 adrp x1, init_pg_end
0370b31e48454d Steve Capper 2018-01-11 409 sub x1, x1, x0
d46befef4c03fb Robin Murphy 2017-07-25 410 bl __inval_dcache_area
034edabe6cf1d0 Laura Abbott 2014-11-21 411
f80fb3a3d50843 Ard Biesheuvel 2016-01-26 412 ret x28
c63d9f82db9439 Mark Brown 2020-02-18 413 SYM_FUNC_END(__create_page_tables)
034edabe6cf1d0 Laura Abbott 2014-11-21 414
034edabe6cf1d0 Laura Abbott 2014-11-21 415 /*
a871d354f795c4 Ard Biesheuvel 2015-03-04 416 * The following fragment of code is
executed with the MMU enabled.
b929fe320e5f3c Ard Biesheuvel 2016-08-31 417 *
b929fe320e5f3c Ard Biesheuvel 2016-08-31 418 * x0 = __PHYS_OFFSET
034edabe6cf1d0 Laura Abbott 2014-11-21 419 */
c63d9f82db9439 Mark Brown 2020-02-18 @420
SYM_FUNC_START_LOCAL(__primary_switched)
60699ba18b69ff Ard Biesheuvel 2016-08-31 421 adrp x4, init_thread_union
60699ba18b69ff Ard Biesheuvel 2016-08-31 422 add sp, x4, #THREAD_SIZE
c02433dd6de32f Mark Rutland 2016-11-03 423 adr_l x5, init_task
c02433dd6de32f Mark Rutland 2016-11-03 424 msr sp_el0, x5 // Save thread_info
60699ba18b69ff Ard Biesheuvel 2016-08-31 425
:::::: The code at line 420 was first introduced by commit
:::::: c63d9f82db94399022a193cdfd57dbafa2a871cb arm64: head.S: Convert to modern
annotations for assembly functions
:::::: TO: Mark Brown <broonie(a)kernel.org>
:::::: CC: Catalin Marinas <catalin.marinas(a)arm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org