Skip to content

Commit

Permalink
arm64: assign page_offset with VA_BITS kernel configuration value
Browse files Browse the repository at this point in the history
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 vabits_actual, instead,
is determined by configuration value. But crash does not observe this
fact.

Since vabits_actual related kernel commit is introduced after arm64
mm layout flip commit, so changes are safe under the condition if
(ms->VA_BITS_ACTUAL), and keep the else branch untouched.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
  • Loading branch information
Pingfan Liu authored and k-hagio committed Jul 5, 2021
1 parent 5719afc commit 167d37e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ arm64_init(int when)

/* vabits_actual introduced after mm flip, so it should be flipped layout */
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;
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;
} else {
ms->page_offset = ARM64_PAGE_OFFSET;
Expand Down
1 change: 1 addition & 0 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3234,6 +3234,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)

Expand Down

0 comments on commit 167d37e

Please sign in to comment.