On Mon, May 31, 2021 at 4:40 PM HAGIO KAZUHITO(萩尾 一仁)
<k-hagio-ab(a)nec.com> wrote:
-----Original Message-----
> 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 "phys_offset_nominal < 0".
>
> Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
> Cc: HAGIO KAZUHITO <k-hagio-ab(a)nec.com>
> Cc: Lianbo Jiang <lijiang(a)redhat.com>
> Cc: Bhupesh Sharma <bhupesh.sharma(a)linaro.org>
> To: crash-utility(a)redhat.com
> ---
> arm64.c | 10 +++++++++-
> defs.h | 1 +
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/arm64.c b/arm64.c
> index f1bac84..7cc19e8 100644
> --- a/arm64.c
> +++ b/arm64.c
> @@ -221,7 +221,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->phys_offset_nominal < 0) {
Maybe I miss something, is the ms->phys_offset_nominal set at this point?
You are right. And I am planning to use ms->VA_BITS_ACTUAL as the hint
of memory layout flip since vabits_actual comes after the memory
layout flip commit.
Thanks,
Pingfan
if (ms->phys_offset_nominal < 0) {
...
/* use machdep parameters */
arm64_calc_phys_offset(); <<-- set here?
arm64_calc_physvirt_offset();
Thanks,
Kazu
> + 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 1007c69..f804212 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -3224,6 +3224,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)
>
> --
> 2.29.2