[Crash-utility] [PATCHv2 2/2] crash-utility/arm64: assign page_offset with kernel configure value

piliu piliu at redhat.com
Wed Apr 14 09:48:12 UTC 2021



On 4/7/21 5:19 PM, Pingfan Liu wrote:
> On RHEL9, crash hits a bug when executing "crash /proc/kcore" :
>     seek error: kernel virtual address: ffff6a0f3fff0000 type: "pmd page"
> 
> The kernel virtual address does not vary with va_actual bits, instead,
> is determined by configuration value. But crash does not observe this
> fact.
> 
> Since this disagreement only happens if 52-bits kernel on 48 bits platform,
> it can be handled only if "memstart_addr < 0".
> 
> Signed-off-by: Pingfan Liu <piliu at redhat.com>
> Cc: HAGIO KAZUHITO <k-hagio-ab at nec.com>
> Cc: Lianbo Jiang <lijiang at redhat.com>
> Cc: Bhupesh Sharma <bhupesh.sharma at linaro.org>
> Cc: Mark Salter <msalter at redhat.com>
> Cc: Mark Langsdorf <mlangsdo at redhat.com>
> Cc: Jeremy Linton <jlinton at redhat.com>
> To: crash-utility at redhat.com
> ---
>   v1->v2: no change
> 
>   arm64.c | 10 +++++++++-
>   defs.h  |  1 +
>   2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/arm64.c b/arm64.c
> index db36d98..28d9373 100644
> --- a/arm64.c
> +++ b/arm64.c
> @@ -220,7 +220,15 @@ arm64_init(int when)
>   		arm64_calc_VA_BITS();
>   		arm64_calc_KERNELPACMASK();
>   		ms = machdep->machspec;
> -		if (ms->VA_BITS_ACTUAL) {
> +		/* For 52-bits kernel running on 48 bits platform */
> +		if (ms->memstart_addr < 0) {
Here is a mistake.
Based on "crash-utility/arm64: store phy_offset and memstart_addr 
separately", it should be "ms->phys_offset_nominal"

For rest, any ideas?

Thanks,
Pingfan
> +			ms->page_offset = ARM64_FLIP_PAGE_OFFSET;
> +			/* useless on arm64 */
> +			machdep->identity_map_base = ARM64_FLIP_PAGE_OFFSET;
> +			machdep->kvbase = ARM64_FLIP_PAGE_OFFSET;
> +			ms->userspace_top = ARM64_USERSPACE_TOP_ACTUAL;
> +		/* For 52-bits on 52-bits platform, or 48-bits on 48 */
> +		} else if (ms->VA_BITS_ACTUAL) {
>   			ms->page_offset = ARM64_FLIP_PAGE_OFFSET_ACTUAL;
>   			machdep->identity_map_base = ARM64_FLIP_PAGE_OFFSET_ACTUAL;
>   			machdep->kvbase = ARM64_FLIP_PAGE_OFFSET_ACTUAL;
> diff --git a/defs.h b/defs.h
> index 812f02f..27e15c9 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -3220,6 +3220,7 @@ typedef signed int s32;
>   #define ARM64_PAGE_OFFSET    ((0xffffffffffffffffUL) \
>   					<< (machdep->machspec->VA_BITS - 1))
>   /* kernels > v5.4 the kernel VA space is flipped */
> +#define ARM64_FLIP_PAGE_OFFSET (-(1UL) << machdep->machspec->CONFIG_ARM64_VA_BITS)
>   #define ARM64_FLIP_PAGE_OFFSET_ACTUAL ((0xffffffffffffffffUL) \
>   					- ((1UL) << machdep->machspec->VA_BITS_ACTUAL) + 1)
>   
> 




More information about the Crash-utility mailing list