1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) Linaro.
4 * Copyright (C) Huawei Futurewei Technologies.
7 #include <linux/crash_core.h>
8 #include <asm/cpufeature.h>
9 #include <asm/memory.h>
10 #include <asm/pgtable-hwdef.h>
12 static inline u64 get_tcr_el1_t1sz(void);
14 static inline u64 get_tcr_el1_t1sz(void)
16 return (read_sysreg(tcr_el1) & TCR_T1SZ_MASK) >> TCR_T1SZ_OFFSET;
19 void arch_crash_save_vmcoreinfo(void)
21 VMCOREINFO_NUMBER(VA_BITS);
22 /* Please note VMCOREINFO_NUMBER() uses "%d", not "%x" */
23 vmcoreinfo_append_str("NUMBER(kimage_voffset)=0x%llx\n",
25 vmcoreinfo_append_str("NUMBER(PHYS_OFFSET)=0x%llx\n",
27 vmcoreinfo_append_str("NUMBER(TCR_EL1_T1SZ)=0x%llx\n",
29 vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset());
30 vmcoreinfo_append_str("NUMBER(KERNELPACMASK)=0x%llx\n",
31 system_supports_address_auth() ?
32 ptrauth_kernel_pac_mask() : 0);