Hi Pingfan,
On Thu, 25 Mar 2021 at 08:37, Pingfan Liu <piliu(a)redhat.com> wrote:
 Renaming, so it is better to reflect the flip layout of kernel VA, which
 is introduced by kernel commit 14c127c957c1 ("arm64: mm: Flip kernel VA
space")
 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: Mark Salter <msalter(a)redhat.com>
 Cc: Mark Langsdorf <mlangsdo(a)redhat.com>
 Cc: Jeremy Linton <jlinton(a)redhat.com>
 To: crash-utility(a)redhat.com
 ---
  arm64.c | 8 ++++----
  defs.h  | 3 ++-
  2 files changed, 6 insertions(+), 5 deletions(-)
 diff --git a/arm64.c b/arm64.c
 index a0bee62..132a39d 100644
 --- a/arm64.c
 +++ b/arm64.c
 @@ -221,9 +221,9 @@ arm64_init(int when)
                 arm64_calc_KERNELPACMASK();
                 ms = machdep->machspec;
                 if (ms->VA_BITS_ACTUAL) {
 -                       ms->page_offset = ARM64_PAGE_OFFSET_ACTUAL;
 -                       machdep->identity_map_base = ARM64_PAGE_OFFSET_ACTUAL;
 -                       machdep->kvbase = ARM64_PAGE_OFFSET_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;
                         ms->userspace_top = ARM64_USERSPACE_TOP_ACTUAL;
                 } else {
                         ms->page_offset = ARM64_PAGE_OFFSET;
 @@ -404,7 +404,7 @@ arm64_init(int when)
                                 fprintf(fp, "CONFIG_ARM64_VA_BITS: %ld\n",
ms->CONFIG_ARM64_VA_BITS);
                                 fprintf(fp, "      VA_BITS_ACTUAL: %ld\n",
ms->VA_BITS_ACTUAL);
                                 fprintf(fp, "(calculated) VA_BITS: %ld\n",
ms->VA_BITS);
 -                               fprintf(fp, " PAGE_OFFSET: %lx\n",
ARM64_PAGE_OFFSET_ACTUAL);
 +                               fprintf(fp, " PAGE_OFFSET: %lx\n",
ARM64_FLIP_PAGE_OFFSET_ACTUAL);
                                 fprintf(fp, "    VA_START: %lx\n",
ms->VA_START);
                                 fprintf(fp, "     modules: %lx - %lx\n",
ms->modules_vaddr, ms->modules_end);
                                 fprintf(fp, "     vmalloc: %lx - %lx\n",
ms->vmalloc_start_addr, ms->vmalloc_end);
 diff --git a/defs.h b/defs.h
 index 64f2bcb..d8e0f30 100644
 --- a/defs.h
 +++ b/defs.h
 @@ -3219,7 +3219,8 @@ typedef signed int s32;
  #define ARM64_PAGE_OFFSET    ((0xffffffffffffffffUL) \
                                         << (machdep->machspec->VA_BITS - 1))
 -#define ARM64_PAGE_OFFSET_ACTUAL ((0xffffffffffffffffUL) \
 +/* after kernel commit 14c127c957c1 ("arm64: mm: Flip kernel VA space") */
Normally, we use kernel versions instead of the kernel commit in
comments. So something like, for kernels > v5.4 the kernel VA space is
flipped.
 +#define ARM64_FLIP_PAGE_OFFSET_ACTUAL ((0xffffffffffffffffUL) \
                                         - ((1UL) <<
machdep->machspec->VA_BITS_ACTUAL) + 1) 
Thanks,
Bhupesh
  #define ARM64_USERSPACE_TOP  ((1UL) <<
machdep->machspec->VA_BITS)
 --
 2.29.2
 --
 Crash-utility mailing list
 Crash-utility(a)redhat.com
 
https://listman.redhat.com/mailman/listinfo/crash-utility