Skip to contentSkip to conversation

Submit physical address to is_phys_addr()

PATCH In review Alexander Gordeev 3 participants 4 messages Sep 13, 2024 – Sep 25, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Submit physical address to is_phys_addr()

ELF program table virtual address is submitted to is_phys_addr() function, most likely as a leftover of replaced is_vmalloc_addr() function, as result of commit 2e452d75fa78 ("[PATCH v3] Enable --mem-usage for s390x."). Submit the physical address instead.

---
 elf_info.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
elf_info.c +2 -2
index bc24083..7f3d053 100644
@@ -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);
Signature · 7 lines
2.43.0


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw

Hi Alex,

Thanks for the patch.

Quoted 4 lines · 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, as result of commit 2e452d75fa78 ("[PATCH v3] Enable --mem-usage for s390x."). Submit the physical address instead.

If this leftover causes a failure, could you add the error and brief description about it to the commit log?

It looks like currently is_phys_addr() is used only by s390x, and the patch looks good to me.

Thanks,
Kazu

Quoted 20 lines
---
  elf_info.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
elf_info.c +1 -1
index bc24083..7f3d053 100644
@@ -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++;
  	}

elf_info.c int get_kcore_dump_loads(void) · line 792

Quoted 8 lines
elf_info.c +1 -1
@@ -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);

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
In reply to Alexander Gordeev

Hi Alexander,

Quoted 4 lines · On Fri, 13 Sep 2024 16:35:00 +0200 Alexander Gordeev <[email protected]>…

ELF program table virtual address is submitted to is_phys_addr() function, most likely as a leftover of replaced is_vmalloc_addr() function, as result of commit 2e452d75fa78 ("[PATCH v3] Enable --mem-usage for s390x."). Submit the physical address instead.

is the patch supposed to fix the bug with /proc/kcore I reported? I gave it a try on a KVM VM and it's still failing...

Thanks
Philipp

Quoted 19 lines
---
 elf_info.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
elf_info.c +1 -1
index bc24083..7f3d053 100644
@@ -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++;
 	}

elf_info.c int get_kcore_dump_loads(void) · line 792

Quoted 8 lines
elf_info.c +1 -1
@@ -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);

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw
Quoted 1 line · Philipp Rudo

Hi Alexander,

Hi Philipp,

Quoted 10 lines
Quoted 4 lines · On Fri, 13 Sep 2024 16:35:00 +0200 Alexander Gordeev <[email protected]>…

ELF program table virtual address is submitted to is_phys_addr() function, most likely as a leftover of replaced is_vmalloc_addr() function, as result of commit 2e452d75fa78 ("[PATCH v3] Enable --mem-usage for s390x."). Submit the physical address instead.

is the patch supposed to fix the bug with /proc/kcore I reported? I gave it a try on a KVM VM and it's still failing...

No, it fixes another issue.

Quoted 2 lines

Thanks
Philipp

Thank you for testing!

Thanks!

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec