book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11
Subsystems (2)
PATCH 1/1 book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11
Kernel commit 2f18d533757da3899f4bedab0b2c051b080079dc lowered the max real address on ppc64 to 53 bits.
Make similar changes in makedumpfile (on basis of the underlying kernel version), without which the makedumpfile will fail to create a dumpfile and instead throw a SEGV fault as shown below on kernels >= v4.11:
# makedumpfile --split -d 31 -x vmlinux vmcore dumpfile_{1,2,3} 2>&1 The kernel version is not supported.
The makedumpfile operation may be incomplete.
[ 1196.252094] makedumpfile[2367]: unhandled signal 11 at 00000100f7011ca8 nip 000000001001eecc lr 000000001001f3c0 code 30001 Segmentation fault
--- makedumpfile.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
makedumpfile.h +3 -2
@@ -684,8 +684,9 @@ unsigned long get_kvbase_arm64(void);#define PMD_MASKED_BITS_64K_4_6 0xc0000000000000ffUL#define PTE_RPN_MASK_DEFAULT 0xffffffffffffffffUL -#define PTE_RPN_SIZE_L4_4_6 (info->page_size == 65536 ? 41 : 45) -#define PTE_RPN_MASK_L4_4_6 (((1UL << PTE_RPN_SIZE_L4_4_6) - 1) << info->page_shift) +#define PAGE_PA_MAX_L4_4_6 (info->kernel_version >= KERNEL_VERSION(4,11,0) ? 53 : 57) +#define PTE_RPN_MASK_L4_4_6 \ + (((1UL << PAGE_PA_MAX_L4_4_6) - 1) & ~((1UL << info->page_shift) - 1))#define PTE_RPN_SHIFT_L4_4_6 info->page_shift#define PGD_MASKED_BITS_4_7 0xc0000000000000ffUL
Signature · 7 lines
2.7.4 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Hello Bhupesh,
Quoted 25 lines
Kernel commit
2f18d533757da3899f4bedab0b2c051b080079dclowered the max real address on ppc64 to 53 bits.Make similar changes in makedumpfile (on basis of the underlying kernel version), without which the makedumpfile will fail to create a dumpfile and instead throw a SEGV fault as shown below on kernels >= v4.11:
# makedumpfile --split -d 31 -x vmlinux vmcore dumpfile_{1,2,3} 2>&1The kernel version is not supported.
The makedumpfile operation may be incomplete.[ 1196.252094] makedumpfile[2367]: unhandled signal 11 at
00000100f7011ca8nip000000001001eecclr000000001001f3c0code 30001 Segmentation faultSigned-off-by Bhupesh Sharma <[email protected]>---
makedumpfile.h| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)makedumpfile.h +0
-0
makedumpfile.h unsigned long get_kvbase_arm64(void); · line 689
Quoted 8 lines
makedumpfile.h +3
-2@@ -684,8 +684,9 @@ unsigned long get_kvbase_arm64(void);#define PMD_MASKED_BITS_64K_4_6 0xc0000000000000ffUL#define PTE_RPN_MASK_DEFAULT 0xffffffffffffffffUL -#define PTE_RPN_SIZE_L4_4_6 (info->page_size == 65536 ? 41 : 45) -#define PTE_RPN_MASK_L4_4_6 (((1UL << PTE_RPN_SIZE_L4_4_6) - 1) << info->page_shift) +#define PAGE_PA_MAX_L4_4_6 (info->kernel_version >= KERNEL_VERSION(4,11,0) ? 53 : 57) +#define PTE_RPN_MASK_L4_4_6 \ + (((1UL << PAGE_PA_MAX_L4_4_6) - 1) & ~((1UL << info->page_shift) - 1))
This fix is a bit complicated, please introduce *_L4_4_11 simply.
Thanks
Atsushi Kumagai
Quoted 6 lines
makedumpfile.h +0
-1#define PTE_RPN_SHIFT_L4_4_6 info->page_shift#define PGD_MASKED_BITS_4_7 0xc0000000000000ffUL --2.7.4
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Hello Atsushi,
Quoted 29 lines · Atsushi Kumagai
Hello Bhupesh,
Quoted 27 lines
Kernel commit
2f18d533757da3899f4bedab0b2c051b080079dclowered the max real address on ppc64 to 53 bits.Make similar changes in makedumpfile (on basis of the underlying kernel version), without which the makedumpfile will fail to create a dumpfile and instead throw a SEGV fault as shown below on kernels >= v4.11:
# makedumpfile --split -d 31 -x vmlinux vmcore dumpfile_{1,2,3} 2>&1The kernel version is not supported.
The makedumpfile operation may be incomplete.[ 1196.252094] makedumpfile[2367]: unhandled signal 11 at
00000100f7011ca8nip000000001001eecclr000000001001f3c0code 30001 Segmentation faultSigned-off-by Bhupesh Sharma <[email protected]>---
makedumpfile.h| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)makedumpfile.h +0
-0@@ -684,8 +684,9 @@ unsigned long get_kvbase_arm64(void);#define PMD_MASKED_BITS_64K_4_6 0xc0000000000000ffUL
Quoted 8 lines
makedumpfile.h unsigned long get_kvbase_arm64(void); · line 689
Quoted 6 lines
makedumpfile.h +3
-2#define PTE_RPN_MASK_DEFAULT 0xffffffffffffffffUL -#define PTE_RPN_SIZE_L4_4_6 (info->page_size == 65536 ? 41 : 45) -#define PTE_RPN_MASK_L4_4_6 (((1UL << PTE_RPN_SIZE_L4_4_6) - 1) << info->page_shift) +#define PAGE_PA_MAX_L4_4_6 (info->kernel_version >= KERNEL_VERSION(4,11,0) ? 53 : 57) +#define PTE_RPN_MASK_L4_4_6 \ + (((1UL << PAGE_PA_MAX_L4_4_6) - 1) & ~((1UL << info->page_shift) - 1))This fix is a bit complicated, please introduce
*_L4_4_11simply.
Thanks for the review. I understood your point.
I will send a v2 shortly which should address your inputs.
Regards,
Bhupesh
Quoted 8 lines
Quoted 7 lines
makedumpfile.h +0
-1#define PTE_RPN_SHIFT_L4_4_6 info->page_shift#define PGD_MASKED_BITS_4_7 0xc0000000000000ffUL --2.7.4
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Cc more people.
Quoted 39 lines · Bhupesh Sharma
Kernel commit
2f18d533757da3899f4bedab0b2c051b080079dclowered the max real address on ppc64 to 53 bits.Make similar changes in makedumpfile (on basis of the underlying kernel version), without which the makedumpfile will fail to create a dumpfile and instead throw a SEGV fault as shown below on kernels >= v4.11:
# makedumpfile --split -d 31 -x vmlinux vmcore dumpfile_{1,2,3} 2>&1The kernel version is not supported.
The makedumpfile operation may be incomplete.[ 1196.252094] makedumpfile[2367]: unhandled signal 11 at 00000100f7011ca8 nip 000000001001eecc lr 000000001001f3c0 code 30001 Segmentation faultSigned-off-by Bhupesh Sharma <[email protected]>--- makedumpfile.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)makedumpfile.h +3
-2@@ -684,8 +684,9 @@ unsigned long get_kvbase_arm64(void);#define PMD_MASKED_BITS_64K_4_6 0xc0000000000000ffUL#define PTE_RPN_MASK_DEFAULT 0xffffffffffffffffUL -#define PTE_RPN_SIZE_L4_4_6 (info->page_size == 65536 ? 41 : 45) -#define PTE_RPN_MASK_L4_4_6 (((1UL << PTE_RPN_SIZE_L4_4_6) - 1) << info->page_shift) +#define PAGE_PA_MAX_L4_4_6 (info->kernel_version >= KERNEL_VERSION(4,11,0) ? 53 : 57) +#define PTE_RPN_MASK_L4_4_6 \ + (((1UL << PAGE_PA_MAX_L4_4_6) - 1) & ~((1UL << info->page_shift) - 1))#define PTE_RPN_SHIFT_L4_4_6 info->page_shift#define PGD_MASKED_BITS_4_7 0xc0000000000000ffULSignature · 1 line
2.7.4
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Hari Bathini
Acked-byQuoted 17 lines · Dave Young
Cc more people.
Quoted 14 lines · Bhupesh Sharma
Kernel commit
2f18d533757da3899f4bedab0b2c051b080079dclowered the max real address on ppc64 to 53 bits.Make similar changes in makedumpfile (on basis of the underlying kernel version), without which the makedumpfile will fail to create a dumpfile and instead throw a SEGV fault as shown below on kernels >= v4.11:
# makedumpfile --split -d 31 -x vmlinux vmcore dumpfile_{1,2,3} 2>&1The kernel version is not supported.
The makedumpfile operation may be incomplete.[ 1196.252094] makedumpfile[2367]: unhandled signal 11 at 00000100f7011ca8 nip 000000001001eecc lr 000000001001f3c0 code 30001 Segmentation fault
I have not hit the above problem, but for the sake of correctness, this patch is needed for >= 4.11.0 kernels. So..
Quoted 20 lines
Quoted 20 lines
Signed-off-by Bhupesh Sharma <[email protected]>--- makedumpfile.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)makedumpfile.h +3
-2@@ -684,8 +684,9 @@ unsigned long get_kvbase_arm64(void);#define PMD_MASKED_BITS_64K_4_6 0xc0000000000000ffUL#define PTE_RPN_MASK_DEFAULT 0xffffffffffffffffUL -#define PTE_RPN_SIZE_L4_4_6 (info->page_size == 65536 ? 41 : 45) -#define PTE_RPN_MASK_L4_4_6 (((1UL << PTE_RPN_SIZE_L4_4_6) - 1) << info->page_shift) +#define PAGE_PA_MAX_L4_4_6 (info->kernel_version >= KERNEL_VERSION(4,11,0) ? 53 : 57) +#define PTE_RPN_MASK_L4_4_6 \ + (((1UL << PAGE_PA_MAX_L4_4_6) - 1) & ~((1UL << info->page_shift) - 1))#define PTE_RPN_SHIFT_L4_4_6 info->page_shift
Quoted 4 lines
Quoted 4 lines
makedumpfile.h +0
-0#define PGD_MASKED_BITS_4_7 0xc0000000000000ffULSignature · 1 line
2.7.4
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Hi Hari,
Quoted 23 lines · Hari Bathini
Quoted 19 lines · Dave Young
Cc more people.
Quoted 15 lines · Bhupesh Sharma
Kernel commit
2f18d533757da3899f4bedab0b2c051b080079dclowered the max real address on ppc64 to 53 bits.Make similar changes in makedumpfile (on basis of the underlying kernel version), without which the makedumpfile will fail to create a dumpfile and instead throw a SEGV fault as shown below on kernels >= v4.11:
# makedumpfile --split -d 31 -x vmlinux vmcore dumpfile_{1,2,3} 2>&1The kernel version is not supported.
The makedumpfile operation may be incomplete.[ 1196.252094] makedumpfile[2367]: unhandled signal 11 at 00000100f7011ca8 nip 000000001001eecc lr 000000001001f3c0 code 30001 Segmentation fault
Quoted 4 lines
I have not hit the above problem, but for the sake of correctness, this patch is needed for >= 4.11.0 kernels. So..
Acked-by Hari Bathini <[email protected]>
Thanks for the review. As Atsushi suggested some changes in v1, I am sharing a v2 version shortly.
Kindly review the same as well.
Regards,
Bhupesh
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Signed-off-by Bhupesh Sharma <[email protected]>--- makedumpfile.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)makedumpfile.h +1
-2@@ -684,8 +684,9 @@ unsigned long get_kvbase_arm64(void);#define PMD_MASKED_BITS_64K_4_6 0xc0000000000000ffUL#define PTE_RPN_MASK_DEFAULT 0xffffffffffffffffUL -#define PTE_RPN_SIZE_L4_4_6 (info->page_size == 65536 ? 41 : 45) -#define PTE_RPN_MASK_L4_4_6 (((1UL << PTE_RPN_SIZE_L4_4_6) - 1) << info->page_shift) +#define PAGE_PA_MAX_L4_4_6 (info->kernel_version >= KERNEL_VERSION(4,11,0) ? 53 : 57)
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
makedumpfile.h +2
-2+#define PTE_RPN_MASK_L4_4_6 \ + (((1UL << PAGE_PA_MAX_L4_4_6) - 1) & ~((1UL << info->page_shift) - 1))#define PTE_RPN_SHIFT_L4_4_6 info->page_shift#define PGD_MASKED_BITS_4_7 0xc0000000000000ffUL --2.7.4
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec