All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] s390 fixes
@ 2024-09-30 16:12 Alexander Gordeev
  2024-09-30 16:12 ` [PATCH 1/2] Submit physical address to is_phys_addr() Alexander Gordeev
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexander Gordeev @ 2024-09-30 16:12 UTC (permalink / raw)
  To: kexec; +Cc: Masamitsu Yamazaki, Kazuhito Hagio, Philipp Rudo,
	Alexander Gordeev

Hi All,

Please find patches that fix issues on s390 only.

Thanks!

Alexander Gordeev (2):
  Submit physical address to is_phys_addr()
  s390x: Assume zero value of OS_INFO pointer is valid

 arch/s390x.c | 3 +--
 elf_info.c   | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

-- 
2.43.0


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

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

* [PATCH 1/2] Submit physical address to is_phys_addr()
  2024-09-30 16:12 [PATCH 0/2] s390 fixes Alexander Gordeev
@ 2024-09-30 16:12 ` Alexander Gordeev
  2024-09-30 16:12 ` [PATCH 2/2] s390x: Assume zero value of OS_INFO pointer is valid Alexander Gordeev
  2024-10-01  7:28 ` [PATCH 0/2] s390 fixes HAGIO KAZUHITO(萩尾 一仁)
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Gordeev @ 2024-09-30 16:12 UTC (permalink / raw)
  To: kexec; +Cc: Masamitsu Yamazaki, Kazuhito Hagio, Philipp Rudo,
	Alexander Gordeev

ELF program table virtual address is submitted to is_phys_addr()
function, most likely as a leftover of replaced is_vmalloc_addr()
function. Submit the physical address instead.

This fixes the below error when CONFIG_RANDOMIZE_IDENTITY_BASE
kernel configuration option on s390 is enabled:

get_kcore_dump_loads: Can't get the correct number of PT_LOAD. Success

Fixes: 2e452d75fa78 ("[PATCH v3] Enable --mem-usage for s390x.")
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
---
 elf_info.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elf_info.c b/elf_info.c
index bc24083..7f3d053 100644
--- a/elf_info.c
+++ b/elf_info.c
@@ -765,7 +765,7 @@ int get_kcore_dump_loads(void)
 	for (i = 0; i < num_pt_loads; ++i) {
 		struct pt_load_segment *p = &pt_loads[i];
 		if (p->phys_start == NOT_PADDR
-				|| !is_phys_addr(p->virt_start))
+				|| !is_phys_addr(p->phys_start))
 			continue;
 		loads++;
 	}
@@ -786,7 +786,7 @@ int get_kcore_dump_loads(void)
 	for (i = 0, j = 0; i < num_pt_loads; ++i) {
 		struct pt_load_segment *p = &pt_loads[i];
 		if (p->phys_start == NOT_PADDR
-				|| !is_phys_addr(p->virt_start))
+				|| !is_phys_addr(p->phys_start))
 			continue;
 		if (j >= loads) {
 			free(pls);
-- 
2.43.0


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

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

* [PATCH 2/2] s390x: Assume zero value of OS_INFO pointer is valid
  2024-09-30 16:12 [PATCH 0/2] s390 fixes Alexander Gordeev
  2024-09-30 16:12 ` [PATCH 1/2] Submit physical address to is_phys_addr() Alexander Gordeev
@ 2024-09-30 16:12 ` Alexander Gordeev
  2024-10-01  7:28 ` [PATCH 0/2] s390 fixes HAGIO KAZUHITO(萩尾 一仁)
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Gordeev @ 2024-09-30 16:12 UTC (permalink / raw)
  To: kexec; +Cc: Masamitsu Yamazaki, Kazuhito Hagio, Philipp Rudo,
	Alexander Gordeev

An assumption that zero value of OS_INFO pointer is not valid
leads to a failure of --mem-usage argument against /proc/kcore:

s390x_init_vm: Can't get s390x os_info ptr.

Reported-by: Philipp Rudo <prudo@redhat.com>
Fixes: 9d58c2630c71 ("s390x: uncouple virtual and physical address spaces")
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
---
 arch/s390x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/s390x.c b/arch/s390x.c
index 4a993be..f9a055d 100644
--- a/arch/s390x.c
+++ b/arch/s390x.c
@@ -156,8 +156,7 @@ static int s390x_init_vm(void)
 	struct os_info os_info;
 	ulong addr;
 
-	if (!readmem(PADDR, S390X_LC_OS_INFO, &addr,
-			sizeof(addr)) || !addr) {
+	if (!readmem(PADDR, S390X_LC_OS_INFO, &addr, sizeof(addr))) {
 		ERRMSG("Can't get s390x os_info ptr.\n");
 		return FALSE;
 	}
-- 
2.43.0


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

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

* Re: [PATCH 0/2] s390 fixes
  2024-09-30 16:12 [PATCH 0/2] s390 fixes Alexander Gordeev
  2024-09-30 16:12 ` [PATCH 1/2] Submit physical address to is_phys_addr() Alexander Gordeev
  2024-09-30 16:12 ` [PATCH 2/2] s390x: Assume zero value of OS_INFO pointer is valid Alexander Gordeev
@ 2024-10-01  7:28 ` HAGIO KAZUHITO(萩尾 一仁)
  2 siblings, 0 replies; 4+ messages in thread
From: HAGIO KAZUHITO(萩尾 一仁) @ 2024-10-01  7:28 UTC (permalink / raw)
  To: Alexander Gordeev, kexec@lists.infradead.org
  Cc: YAMAZAKI MASAMITSU(山崎 真光),
	Philipp Rudo

On 2024/10/01 1:12, Alexander Gordeev wrote:
> Hi All,
> 
> Please find patches that fix issues on s390 only.
> 
> Thanks!
> 
> Alexander Gordeev (2):
>    Submit physical address to is_phys_addr()
>    s390x: Assume zero value of OS_INFO pointer is valid
> 
>   arch/s390x.c | 3 +--
>   elf_info.c   | 4 ++--
>   2 files changed, 3 insertions(+), 4 deletions(-)
> 

Thank you for the patches, look good and applied.

https://github.com/makedumpfile/makedumpfile/commit/195884556117f0a4162d480a586a0eefbbe413b2
https://github.com/makedumpfile/makedumpfile/commit/90dc30d9c95cceca0f1d14573cf68d982b9a93f3

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

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

end of thread, other threads:[~2024-10-01  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-30 16:12 [PATCH 0/2] s390 fixes Alexander Gordeev
2024-09-30 16:12 ` [PATCH 1/2] Submit physical address to is_phys_addr() Alexander Gordeev
2024-09-30 16:12 ` [PATCH 2/2] s390x: Assume zero value of OS_INFO pointer is valid Alexander Gordeev
2024-10-01  7:28 ` [PATCH 0/2] s390 fixes 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.