Skip to contentSkip to conversation

makedumpfile: s390x: Fix KVBASE to correct value for s390x arcitecture.

PATCH In review Mahesh J Salgaonkar 3 participants 4 messages Mar 15, 2011 – Mar 22, 2011

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

PATCH 1/1 makedumpfile: s390x: Fix KVBASE to correct value for s390x arcitecture.

From: Mahesh Salgaonkar <[email protected]>

While excluding free pages from s390x dumps taken on LPAR, makedumpfile fails to convert page address to pfn. The reason is, the memory for mem_section structure is allocated below '_stext' and since KVBASE is set to SYMBOL(_stext), the function is_kvaddr() fails and return NULL address.

Set KVBASE to KENRELBASE(0) for s390x architecture to fix this issue.

---

 makedumpfile.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
makedumpfile.h +1 -1
index 11e1a93..4ec77b7 100644
@@ -615,7 +615,7 @@ do { \
 #ifdef __s390x__
 #define __PAGE_OFFSET		(info->page_size - 1)
 #define KERNELBASE		(0)
-#define KVBASE			(SYMBOL(_stext))
+#define KVBASE			KERNELBASE
 #define _SECTION_SIZE_BITS	(28)
 #define _MAX_PHYSMEM_BITS	(42)
 

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

#1 lore raw

Hi Mahesh,

Quoted 8 lines · On Tue, 15 Mar 2011 22:39:23 +0530 Mahesh J Salgaonkar…

From: Mahesh Salgaonkar <[email protected]>

While excluding free pages from s390x dumps taken on LPAR, makedumpfile fails to convert page address to pfn. The reason is, the memory for mem_section structure is allocated below '_stext' and since KVBASE is set to SYMBOL(_stext), the function is_kvaddr() fails and return NULL address.

Why do we need this patch ?
to support the latest kernel version of s390 ?
or to support LPAR of s390 ?

I'd like to know whether we need a similar change for the other architecture. I will appreciate if getting a hint.

Thanks
Ken'ichi Ohmichi

Quoted 14 lines

Set KVBASE to KENRELBASE(0) for s390x architecture to fix this issue.

---

 makedumpfile.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
makedumpfile.h +0 -0
index 11e1a93..4ec77b7 100644

makedumpfile.h do { \ · line 621

Quoted 8 lines
makedumpfile.h +1 -1
@@ -615,7 +615,7 @@ do { \
 #ifdef __s390x__
 #define __PAGE_OFFSET		(info->page_size - 1)
 #define KERNELBASE		(0)
-#define KVBASE			(SYMBOL(_stext))
+#define KVBASE			KERNELBASE
 #define _SECTION_SIZE_BITS	(28)
 #define _MAX_PHYSMEM_BITS	(42)
 

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

#2 lore raw

Hello Ken'inchi,

Quoted 13 lines · Ken'ichi Ohmichi

Hi Mahesh,

Quoted 8 lines · On Tue, 15 Mar 2011 22:39:23 +0530 Mahesh J Salgaonkar…

From: Mahesh Salgaonkar <[email protected]>

While excluding free pages from s390x dumps taken on LPAR, makedumpfile fails to convert page address to pfn. The reason is, the memory for mem_section structure is allocated below '_stext' and since KVBASE is set to SYMBOL(_stext), the function is_kvaddr() fails and return NULL address.

Quoted 3 lines

Why do we need this patch ?
to support the latest kernel version of s390 ?
or to support LPAR of s390 ?

The problem is that on s390 depending on the kernel configuration it can happen that memory below _stext is available for buffer allocation. Therefore the mem_section structure has been allocated below _stext. On s390 the kernel page tables have a 1:1 mapping from 0 to memory_end (memory holes are possible). Therefore I think the check "> 0" is ok for s390.

Quoted 3 lines

I'd like to know whether we need a similar change for the other architecture. I will appreciate if getting a hint.

Not sure, if other architectures use memory below _stext for buffer allocation.

Michael

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

#3 lore raw

Hi Michael,

Thank you for the explanation.

Quoted 19 lines · On Fri, 18 Mar 2011 11:11:37 +0100 Michael Holzheu…
Quoted 13 lines · Ken'ichi Ohmichi

Hi Mahesh,

Quoted 8 lines · On Tue, 15 Mar 2011 22:39:23 +0530 Mahesh J Salgaonkar…

From: Mahesh Salgaonkar <[email protected]>

While excluding free pages from s390x dumps taken on LPAR, makedumpfile fails to convert page address to pfn. The reason is, the memory for mem_section structure is allocated below '_stext' and since KVBASE is set to SYMBOL(_stext), the function is_kvaddr() fails and return NULL address.

Quoted 3 lines

Why do we need this patch ?
to support the latest kernel version of s390 ?
or to support LPAR of s390 ?

Quoted 6 lines

The problem is that on s390 depending on the kernel configuration it can happen that memory below _stext is available for buffer allocation. Therefore the mem_section structure has been allocated below _stext. On s390 the kernel page tables have a 1:1 mapping from 0 to memory_end (memory holes are possible). Therefore I think the check "> 0" is ok for s390.

I see. And I confirmed there is the same code (kvbase is 0) in the crash utility in the case of s390x, so this change is right. Mahesh's patch has been merged to the git tree.

http://makedumpfile.git.sourceforge.net/git/gitweb.cgi?p=makedumpfile/makedumpfile;a=commit;h=c69f915b8163bb9209cb329a6186b7261b545a4b

Thanks
Ken'ichi Ohmichi

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