All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mips64: Retrieve MAX_PHYSMEM_BITS from vmcoreinfo
@ 2021-02-22  1:31 Youling Tang
  2021-02-22  2:20 ` HAGIO KAZUHITO(萩尾 一仁)
  0 siblings, 1 reply; 2+ messages in thread
From: Youling Tang @ 2021-02-22  1:31 UTC (permalink / raw)
  To: Kazuhito Hagio; +Cc: tangyouling, kexec-ml

Add a common feature for architectures to retrieve AX_PHYSMEM_BITS
from vmcoreinfo, 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>
---
 arch/mips64.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/mips64.c b/arch/mips64.c
index c968082..d541c3e 100644
--- a/arch/mips64.c
+++ b/arch/mips64.c
@@ -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);
 
-- 
2.1.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] mips64: Retrieve MAX_PHYSMEM_BITS from vmcoreinfo
  2021-02-22  1:31 [PATCH] mips64: Retrieve MAX_PHYSMEM_BITS from vmcoreinfo Youling Tang
@ 2021-02-22  2:20 ` HAGIO KAZUHITO(萩尾 一仁)
  0 siblings, 0 replies; 2+ messages in thread
From: HAGIO KAZUHITO(萩尾 一仁) @ 2021-02-22  2:20 UTC (permalink / raw)
  To: Youling Tang; +Cc: kexec-ml

-----Original Message-----
> Add a common feature for architectures to retrieve AX_PHYSMEM_BITS
> from vmcoreinfo, 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>
> ---
>  arch/mips64.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips64.c b/arch/mips64.c
> index c968082..d541c3e 100644
> --- a/arch/mips64.c
> +++ b/arch/mips64.c
> @@ -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);
> 
> --
> 2.1.0

Thanks, I've edited the commit message a bit and applied:
https://github.com/makedumpfile/makedumpfile/commit/974a507447e8d77df3a1e759cc569768372bfb8e

Kazu


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-22  2:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22  1:31 [PATCH] mips64: Retrieve MAX_PHYSMEM_BITS from vmcoreinfo Youling Tang
2021-02-22  2:20 ` HAGIO KAZUHITO(萩尾 一仁)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.