Skip to content

Commit

Permalink
[PATCH] mips64: Retrieve MAX_PHYSMEM_BITS from vmcoreinfo
Browse files Browse the repository at this point in the history
Retrieve MAX_PHYSMEM_BITS from vmcoreinfo for mips64, which was added
by kernel commit 1d50e5d0c505 ("crash_core, vmcoreinfo: Append
'MAX_PHYSMEM_BITS' to vmcoreinfo").  This makes makedumpfile adaptable
for future MAX_PHYSMEM_BITS changes.

Also ensure backward compatibility for kernel versions in which
MAX_PHYSMEM_BITS is not available in vmcoreinfo.

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
  • Loading branch information
Youling Tang authored and k-hagio committed Feb 22, 2021
1 parent f8348d3 commit 974a507
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/mips64.c
Expand Up @@ -35,9 +35,14 @@ get_phys_base_mips64(void)
int
get_machdep_info_mips64(void)
{
info->max_physmem_bits = _MAX_PHYSMEM_BITS;
info->section_size_bits = _SECTION_SIZE_BITS;

/* Check if we can get MAX_PHYSMEM_BITS from vmcoreinfo */
if (NUMBER(MAX_PHYSMEM_BITS) != NOT_FOUND_NUMBER)
info->max_physmem_bits = NUMBER(MAX_PHYSMEM_BITS);
else
info->max_physmem_bits = _MAX_PHYSMEM_BITS;

DEBUG_MSG("max_physmem_bits : %lx\n", info->max_physmem_bits);
DEBUG_MSG("section_size_bits: %lx\n", info->section_size_bits);

Expand Down

0 comments on commit 974a507

Please sign in to comment.