All of lore.kernel.org
 help / color / mirror / Atom feed
* [Makedumpfile PATCH] book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11
@ 2017-09-08  4:40 Bhupesh Sharma
  2017-09-08  8:31 ` Atsushi Kumagai
  2017-09-11  1:35 ` Dave Young
  0 siblings, 2 replies; 6+ messages in thread
From: Bhupesh Sharma @ 2017-09-08  4:40 UTC (permalink / raw)
  To: ats-kumagai, kexec; +Cc: bhsharma, dyoung, piliu, bhe

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

Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
---
 makedumpfile.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/makedumpfile.h b/makedumpfile.h
index 7d81bbcf2234..142753d84e8d 100644
--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -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
-- 
2.7.4


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

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

* RE: [Makedumpfile PATCH] book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11
  2017-09-08  4:40 [Makedumpfile PATCH] book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11 Bhupesh Sharma
@ 2017-09-08  8:31 ` Atsushi Kumagai
  2017-09-12 19:54   ` Bhupesh Sharma
  2017-09-11  1:35 ` Dave Young
  1 sibling, 1 reply; 6+ messages in thread
From: Atsushi Kumagai @ 2017-09-08  8:31 UTC (permalink / raw)
  To: Bhupesh Sharma; +Cc: kexec, dyoung, piliu, bhe

Hello Bhupesh,

>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
>
>Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
>---
> makedumpfile.h | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/makedumpfile.h b/makedumpfile.h
>index 7d81bbcf2234..142753d84e8d 100644
>--- a/makedumpfile.h
>+++ b/makedumpfile.h
>@@ -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

> #define PTE_RPN_SHIFT_L4_4_6  info->page_shift
>
> #define PGD_MASKED_BITS_4_7  0xc0000000000000ffUL
>--
>2.7.4
>


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

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

* Re: [Makedumpfile PATCH] book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11
  2017-09-08  4:40 [Makedumpfile PATCH] book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11 Bhupesh Sharma
  2017-09-08  8:31 ` Atsushi Kumagai
@ 2017-09-11  1:35 ` Dave Young
  2017-09-11  8:59   ` Hari Bathini
  1 sibling, 1 reply; 6+ messages in thread
From: Dave Young @ 2017-09-11  1:35 UTC (permalink / raw)
  To: Bhupesh Sharma; +Cc: bhe, piliu, ats-kumagai, kexec, hbathini

Cc more people.

On 09/08/17 at 10:10am, Bhupesh Sharma wrote:
> 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
> 
> Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
> ---
>  makedumpfile.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/makedumpfile.h b/makedumpfile.h
> index 7d81bbcf2234..142753d84e8d 100644
> --- a/makedumpfile.h
> +++ b/makedumpfile.h
> @@ -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
> -- 
> 2.7.4
> 

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

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

* Re: [Makedumpfile PATCH] book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11
  2017-09-11  1:35 ` Dave Young
@ 2017-09-11  8:59   ` Hari Bathini
  2017-09-12 19:56     ` Bhupesh Sharma
  0 siblings, 1 reply; 6+ messages in thread
From: Hari Bathini @ 2017-09-11  8:59 UTC (permalink / raw)
  To: Dave Young, Bhupesh Sharma; +Cc: ats-kumagai, kexec, piliu, bhe


On Monday 11 September 2017 07:05 AM, Dave Young wrote:
> Cc more people.
>
> On 09/08/17 at 10:10am, Bhupesh Sharma wrote:
>> 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

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 <hbathini@linux.vnet.ibm.com>

>> Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
>> ---
>>   makedumpfile.h | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/makedumpfile.h b/makedumpfile.h
>> index 7d81bbcf2234..142753d84e8d 100644
>> --- a/makedumpfile.h
>> +++ b/makedumpfile.h
>> @@ -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
>> -- 
>> 2.7.4
>>


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

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

* Re: [Makedumpfile PATCH] book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11
  2017-09-08  8:31 ` Atsushi Kumagai
@ 2017-09-12 19:54   ` Bhupesh Sharma
  0 siblings, 0 replies; 6+ messages in thread
From: Bhupesh Sharma @ 2017-09-12 19:54 UTC (permalink / raw)
  To: Atsushi Kumagai; +Cc: kexec, dyoung, piliu, bhe

Hello Atsushi,

On Fri, Sep 8, 2017 at 2:01 PM, Atsushi Kumagai
<ats-kumagai@wm.jp.nec.com> wrote:
> Hello Bhupesh,
>
>>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
>>
>>Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
>>---
>> makedumpfile.h | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>>diff --git a/makedumpfile.h b/makedumpfile.h
>>index 7d81bbcf2234..142753d84e8d 100644
>>--- a/makedumpfile.h
>>+++ b/makedumpfile.h
>>@@ -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 for the review. I understood your point.
I will send a v2 shortly which should address your inputs.

Regards,
Bhupesh


>
>> #define PTE_RPN_SHIFT_L4_4_6  info->page_shift
>>
>> #define PGD_MASKED_BITS_4_7  0xc0000000000000ffUL
>>--
>>2.7.4
>>
>

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

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

* Re: [Makedumpfile PATCH] book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11
  2017-09-11  8:59   ` Hari Bathini
@ 2017-09-12 19:56     ` Bhupesh Sharma
  0 siblings, 0 replies; 6+ messages in thread
From: Bhupesh Sharma @ 2017-09-12 19:56 UTC (permalink / raw)
  To: Hari Bathini; +Cc: Baoquan He, Pingfan Liu, Atsushi Kumagai, kexec, Dave Young

Hi Hari,

On Mon, Sep 11, 2017 at 2:29 PM, Hari Bathini
<hbathini@linux.vnet.ibm.com> wrote:
>
> On Monday 11 September 2017 07:05 AM, Dave Young wrote:
>>
>> Cc more people.
>>
>> On 09/08/17 at 10:10am, Bhupesh Sharma wrote:
>>>
>>> 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
>
>
> 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 <hbathini@linux.vnet.ibm.com>

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

>>> Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
>>> ---
>>>   makedumpfile.h | 5 +++--
>>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/makedumpfile.h b/makedumpfile.h
>>> index 7d81bbcf2234..142753d84e8d 100644
>>> --- a/makedumpfile.h
>>> +++ b/makedumpfile.h
>>> @@ -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
>>> --
>>> 2.7.4
>>>
>

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

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

end of thread, other threads:[~2017-09-12 19:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-08  4:40 [Makedumpfile PATCH] book3s/ppc64: Lower the max real address to 53 bits for kernels >= v4.11 Bhupesh Sharma
2017-09-08  8:31 ` Atsushi Kumagai
2017-09-12 19:54   ` Bhupesh Sharma
2017-09-11  1:35 ` Dave Young
2017-09-11  8:59   ` Hari Bathini
2017-09-12 19:56     ` Bhupesh Sharma

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.