All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
@ 2019-08-30  9:12 Donald Buczek
  2019-08-30  9:23 ` Baoquan He
  2019-09-03 14:41 ` Simon Horman
  0 siblings, 2 replies; 13+ messages in thread
From: Donald Buczek @ 2019-08-30  9:12 UTC (permalink / raw)
  To: horms, kexec, Bhupesh Sharma, buczek

Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
region on 5-level paging") changed the base of the direct mapping
from 0xffff880000000000 to 0xffff888000000000. This was merged
into v4.20-rc2.

Update to new address accordingly.
---
 kexec/arch/i386/crashdump-x86.c | 2 ++
 kexec/arch/i386/crashdump-x86.h | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index a2aea31..c79791f 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -61,6 +61,8 @@ static int get_kernel_page_offset(struct kexec_info *UNUSED(info),
 
 		if (kv < KERNEL_VERSION(2, 6, 27))
 			elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_2_6_27;
+		else if (kv < KERNEL_VERSION(4, 20, 0))
+			elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_4_20_0;
 		else
 			elf_info->page_offset = X86_64_PAGE_OFFSET;
 	}
diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
index ddee19f..e4fdc82 100644
--- a/kexec/arch/i386/crashdump-x86.h
+++ b/kexec/arch/i386/crashdump-x86.h
@@ -13,7 +13,8 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
 
 #define X86_64__START_KERNEL_map	0xffffffff80000000ULL
 #define X86_64_PAGE_OFFSET_PRE_2_6_27	0xffff810000000000ULL
-#define X86_64_PAGE_OFFSET		0xffff880000000000ULL
+#define X86_64_PAGE_OFFSET_PRE_4_20_0	0xffff880000000000ULL
+#define X86_64_PAGE_OFFSET	0xffff888000000000ULL
 
 #define X86_64_MAXMEM        		0x3fffffffffffUL
 
-- 
2.22.0


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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-08-30  9:12 [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20 Donald Buczek
@ 2019-08-30  9:23 ` Baoquan He
  2019-08-30  9:34   ` Donald Buczek
  2019-09-03 14:41 ` Simon Horman
  1 sibling, 1 reply; 13+ messages in thread
From: Baoquan He @ 2019-08-30  9:23 UTC (permalink / raw)
  To: Donald Buczek; +Cc: Bhupesh Sharma, horms, kexec, k-hagio

On 08/30/19 at 11:12am, Donald Buczek wrote:
> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
> region on 5-level paging") changed the base of the direct mapping
> from 0xffff880000000000 to 0xffff888000000000. This was merged
> into v4.20-rc2.

A good catch and necessary fix, thanks.

Does it have issue in makedumpfile?

#ifdef __x86_64__
#define __PAGE_OFFSET_ORIG      (0xffff810000000000) /* 2.6.26, or former */
#define __PAGE_OFFSET_2_6_27    (0xffff880000000000) /* 2.6.27, or later  */
#define __PAGE_OFFSET_5LEVEL    (0xff10000000000000) /* 5-level page table */ 
...
#endif

Thanks
Baoquan

> 
> Update to new address accordingly.
> ---
>  kexec/arch/i386/crashdump-x86.c | 2 ++
>  kexec/arch/i386/crashdump-x86.h | 3 ++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index a2aea31..c79791f 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -61,6 +61,8 @@ static int get_kernel_page_offset(struct kexec_info *UNUSED(info),
>  
>  		if (kv < KERNEL_VERSION(2, 6, 27))
>  			elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_2_6_27;
> +		else if (kv < KERNEL_VERSION(4, 20, 0))
> +			elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_4_20_0;
>  		else
>  			elf_info->page_offset = X86_64_PAGE_OFFSET;
>  	}
> diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> index ddee19f..e4fdc82 100644
> --- a/kexec/arch/i386/crashdump-x86.h
> +++ b/kexec/arch/i386/crashdump-x86.h
> @@ -13,7 +13,8 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
>  
>  #define X86_64__START_KERNEL_map	0xffffffff80000000ULL
>  #define X86_64_PAGE_OFFSET_PRE_2_6_27	0xffff810000000000ULL
> -#define X86_64_PAGE_OFFSET		0xffff880000000000ULL
> +#define X86_64_PAGE_OFFSET_PRE_4_20_0	0xffff880000000000ULL
> +#define X86_64_PAGE_OFFSET	0xffff888000000000ULL
>  
>  #define X86_64_MAXMEM        		0x3fffffffffffUL
>  
> -- 
> 2.22.0
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-08-30  9:23 ` Baoquan He
@ 2019-08-30  9:34   ` Donald Buczek
  2019-08-30 10:05     ` Bhupesh Sharma
  0 siblings, 1 reply; 13+ messages in thread
From: Donald Buczek @ 2019-08-30  9:34 UTC (permalink / raw)
  To: Baoquan He; +Cc: Bhupesh Sharma, horms, kexec, k-hagio

Dear Baoquan,

On 8/30/19 11:23 AM, Baoquan He wrote:
> On 08/30/19 at 11:12am, Donald Buczek wrote:
>> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
>> region on 5-level paging") changed the base of the direct mapping
>> from 0xffff880000000000 to 0xffff888000000000. This was merged
>> into v4.20-rc2.
> 
> A good catch and necessary fix, thanks.
> 
> Does it have issue in makedumpfile?

We don't use makedumpfile. We use `cp /proc/vmcore /mnt/crash.vmcore` in the panic kernel.

Without this patch, the file /mnt/crash.vmcore has the wrong vaddr in the elf headers and can't be processed by gdb or crash.

With this patch, the file has the correct vaddr an can be processed by gdb and crash.

Btw:  I've got four strange error replies for my mail.

     Date: 30 Aug 2019 05:13:31 EDT
     From: MAILER_DAEMON@email.uscc.net
     To: buczek@molgen.mpg.de
         Message to 7867650283@email.uscc.net failed.

I hope, my patch reaches the right people anyway.

Best
   Donald


> 
> #ifdef __x86_64__
> #define __PAGE_OFFSET_ORIG      (0xffff810000000000) /* 2.6.26, or former */
> #define __PAGE_OFFSET_2_6_27    (0xffff880000000000) /* 2.6.27, or later  */
> #define __PAGE_OFFSET_5LEVEL    (0xff10000000000000) /* 5-level page table */
> ...
> #endif
> 
> Thanks
> Baoquan
> 
>>
>> Update to new address accordingly.
>> ---
>>   kexec/arch/i386/crashdump-x86.c | 2 ++
>>   kexec/arch/i386/crashdump-x86.h | 3 ++-
>>   2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
>> index a2aea31..c79791f 100644
>> --- a/kexec/arch/i386/crashdump-x86.c
>> +++ b/kexec/arch/i386/crashdump-x86.c
>> @@ -61,6 +61,8 @@ static int get_kernel_page_offset(struct kexec_info *UNUSED(info),
>>   
>>   		if (kv < KERNEL_VERSION(2, 6, 27))
>>   			elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_2_6_27;
>> +		else if (kv < KERNEL_VERSION(4, 20, 0))
>> +			elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_4_20_0;
>>   		else
>>   			elf_info->page_offset = X86_64_PAGE_OFFSET;
>>   	}
>> diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
>> index ddee19f..e4fdc82 100644
>> --- a/kexec/arch/i386/crashdump-x86.h
>> +++ b/kexec/arch/i386/crashdump-x86.h
>> @@ -13,7 +13,8 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
>>   
>>   #define X86_64__START_KERNEL_map	0xffffffff80000000ULL
>>   #define X86_64_PAGE_OFFSET_PRE_2_6_27	0xffff810000000000ULL
>> -#define X86_64_PAGE_OFFSET		0xffff880000000000ULL
>> +#define X86_64_PAGE_OFFSET_PRE_4_20_0	0xffff880000000000ULL
>> +#define X86_64_PAGE_OFFSET	0xffff888000000000ULL
>>   
>>   #define X86_64_MAXMEM        		0x3fffffffffffUL
>>   
>> -- 
>> 2.22.0
>>
>>
>> _______________________________________________
>> kexec mailing list
>> kexec@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/kexec


-- 
Donald Buczek
buczek@molgen.mpg.de
Tel: +49 30 8413 1433

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-08-30  9:34   ` Donald Buczek
@ 2019-08-30 10:05     ` Bhupesh Sharma
  2019-08-30 10:32       ` Donald Buczek
  2019-09-02  6:02       ` Baoquan He
  0 siblings, 2 replies; 13+ messages in thread
From: Bhupesh Sharma @ 2019-08-30 10:05 UTC (permalink / raw)
  To: Donald Buczek
  Cc: Simon Horman, kexec mailing list, Baoquan He, Kazuhito Hagio

On Fri, Aug 30, 2019 at 3:04 PM Donald Buczek <buczek@molgen.mpg.de> wrote:
>
> Dear Baoquan,
>
> On 8/30/19 11:23 AM, Baoquan He wrote:
> > On 08/30/19 at 11:12am, Donald Buczek wrote:
> >> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
> >> region on 5-level paging") changed the base of the direct mapping
> >> from 0xffff880000000000 to 0xffff888000000000. This was merged
> >> into v4.20-rc2.
> >
> > A good catch and necessary fix, thanks.
> >
> > Does it have issue in makedumpfile?
>
> We don't use makedumpfile. We use `cp /proc/vmcore /mnt/crash.vmcore` in the panic kernel.

That shouldn't be a problem in makedumpfile as we have a generic way
to calculate the PAGE_OFFSET value there from the PT_LOADs in the
'/proc/kcore' file (which I mentioned in the other email conversation,
see [0]):

static int
get_page_offset_x86_64(void)
{
<..snip..>
    if (get_num_pt_loads()) {
        /*
         * Linux 4.19 (only) adds KCORE_REMAP PT_LOADs, which have
         * virt_start < __START_KERNEL_map, to /proc/kcore. In order
         * not to select them, we select the last valid PT_LOAD.
         */
        for (i = 0;
            get_pt_load(i, &phys_start, NULL, &virt_start, NULL);
            i++) {
            if (virt_start != NOT_KV_ADDR
                    && virt_start < __START_KERNEL_map
                    && phys_start != NOT_PADDR) {
                page_offset = virt_start - phys_start;
            }
        }
        if (page_offset) {
            info->page_offset = page_offset;
            DEBUG_MSG("page_offset  : %lx (pt_load)\n",
                info->page_offset);
            return TRUE;
        }
    }
<..snip..>

Also as I mentioned in the other thread, I don't think adding
different MACRO value for a kernel version is a long-term maintainable
approach. Instead I am working on adding a similar functionality as
present in makedumpfile to make the PAGE_OFFSET calculation generic.
Only if we fail to calculate PAGE_OFFSET through a generic method
should we fall back on MACRO values for backward compatibility.

I will try to post the patch for reviews by tomorrow.

[0]. https://lkml.org/lkml/2019/8/28/1060

Thanks,
Bhupesh

> Without this patch, the file /mnt/crash.vmcore has the wrong vaddr in the elf headers and can't be processed by gdb or crash.
>
> With this patch, the file has the correct vaddr an can be processed by gdb and crash.
>
> Btw:  I've got four strange error replies for my mail.
>
>      Date: 30 Aug 2019 05:13:31 EDT
>      From: MAILER_DAEMON@email.uscc.net
>      To: buczek@molgen.mpg.de
>          Message to 7867650283@email.uscc.net failed.
>
> I hope, my patch reaches the right people anyway.
>
> Best
>    Donald
>
>
> >
> > #ifdef __x86_64__
> > #define __PAGE_OFFSET_ORIG      (0xffff810000000000) /* 2.6.26, or former */
> > #define __PAGE_OFFSET_2_6_27    (0xffff880000000000) /* 2.6.27, or later  */
> > #define __PAGE_OFFSET_5LEVEL    (0xff10000000000000) /* 5-level page table */
> > ...
> > #endif
> >
> > Thanks
> > Baoquan
> >
> >>
> >> Update to new address accordingly.
> >> ---
> >>   kexec/arch/i386/crashdump-x86.c | 2 ++
> >>   kexec/arch/i386/crashdump-x86.h | 3 ++-
> >>   2 files changed, 4 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> >> index a2aea31..c79791f 100644
> >> --- a/kexec/arch/i386/crashdump-x86.c
> >> +++ b/kexec/arch/i386/crashdump-x86.c
> >> @@ -61,6 +61,8 @@ static int get_kernel_page_offset(struct kexec_info *UNUSED(info),
> >>
> >>              if (kv < KERNEL_VERSION(2, 6, 27))
> >>                      elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_2_6_27;
> >> +            else if (kv < KERNEL_VERSION(4, 20, 0))
> >> +                    elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_4_20_0;
> >>              else
> >>                      elf_info->page_offset = X86_64_PAGE_OFFSET;
> >>      }
> >> diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> >> index ddee19f..e4fdc82 100644
> >> --- a/kexec/arch/i386/crashdump-x86.h
> >> +++ b/kexec/arch/i386/crashdump-x86.h
> >> @@ -13,7 +13,8 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
> >>
> >>   #define X86_64__START_KERNEL_map   0xffffffff80000000ULL
> >>   #define X86_64_PAGE_OFFSET_PRE_2_6_27      0xffff810000000000ULL
> >> -#define X86_64_PAGE_OFFSET          0xffff880000000000ULL
> >> +#define X86_64_PAGE_OFFSET_PRE_4_20_0       0xffff880000000000ULL
> >> +#define X86_64_PAGE_OFFSET  0xffff888000000000ULL
> >>
> >>   #define X86_64_MAXMEM                      0x3fffffffffffUL
> >>
> >> --
> >> 2.22.0
> >>
> >>
> >> _______________________________________________
> >> kexec mailing list
> >> kexec@lists.infradead.org
> >> http://lists.infradead.org/mailman/listinfo/kexec
>
>
> --
> Donald Buczek
> buczek@molgen.mpg.de
> Tel: +49 30 8413 1433

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-08-30 10:05     ` Bhupesh Sharma
@ 2019-08-30 10:32       ` Donald Buczek
  2019-09-02  6:02       ` Baoquan He
  1 sibling, 0 replies; 13+ messages in thread
From: Donald Buczek @ 2019-08-30 10:32 UTC (permalink / raw)
  To: Bhupesh Sharma
  Cc: Simon Horman, kexec mailing list, Baoquan He, Kazuhito Hagio

Dear Baoquan,

On 8/30/19 12:05 PM, Bhupesh Sharma wrote:
> On Fri, Aug 30, 2019 at 3:04 PM Donald Buczek <buczek@molgen.mpg.de> wrote:
>>
>> Dear Baoquan,
>>
>> On 8/30/19 11:23 AM, Baoquan He wrote:
>>> On 08/30/19 at 11:12am, Donald Buczek wrote:
>>>> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
>>>> region on 5-level paging") changed the base of the direct mapping
>>>> from 0xffff880000000000 to 0xffff888000000000. This was merged
>>>> into v4.20-rc2.
>>>
>>> A good catch and necessary fix, thanks.
>>>
>>> Does it have issue in makedumpfile?
>>
>> We don't use makedumpfile. We use `cp /proc/vmcore /mnt/crash.vmcore` in the panic kernel.
> 
> That shouldn't be a problem in makedumpfile as we have a generic way
> to calculate the PAGE_OFFSET value there from the PT_LOADs in the
> '/proc/kcore' file (which I mentioned in the other email conversation,
> see [0]):
> 
> static int
> get_page_offset_x86_64(void)
> {
> <..snip..>
>      if (get_num_pt_loads()) {
>          /*
>           * Linux 4.19 (only) adds KCORE_REMAP PT_LOADs, which have
>           * virt_start < __START_KERNEL_map, to /proc/kcore. In order
>           * not to select them, we select the last valid PT_LOAD.
>           */
>          for (i = 0;
>              get_pt_load(i, &phys_start, NULL, &virt_start, NULL);
>              i++) {
>              if (virt_start != NOT_KV_ADDR
>                      && virt_start < __START_KERNEL_map
>                      && phys_start != NOT_PADDR) {
>                  page_offset = virt_start - phys_start;
>              }
>          }
>          if (page_offset) {
>              info->page_offset = page_offset;
>              DEBUG_MSG("page_offset  : %lx (pt_load)\n",
>                  info->page_offset);
>              return TRUE;
>          }
>      }
> <..snip..>
> 
> Also as I mentioned in the other thread, I don't think adding
> different MACRO value for a kernel version is a long-term maintainable
> approach. Instead I am working on adding a similar functionality as
> present in makedumpfile to make the PAGE_OFFSET calculation generic.
> Only if we fail to calculate PAGE_OFFSET through a generic method
> should we fall back on MACRO values for backward compatibility.

Very good,.

> I will try to post the patch for reviews by tomorrow.

I'll be happy to test that.

Best
   Donald

> 
> [0]. https://lkml.org/lkml/2019/8/28/1060
> 
> Thanks,
> Bhupesh
> 
>> Without this patch, the file /mnt/crash.vmcore has the wrong vaddr in the elf headers and can't be processed by gdb or crash.
>>
>> With this patch, the file has the correct vaddr an can be processed by gdb and crash.
>>
>> Btw:  I've got four strange error replies for my mail.
>>
>>       Date: 30 Aug 2019 05:13:31 EDT
>>       From: MAILER_DAEMON@email.uscc.net
>>       To: buczek@molgen.mpg.de
>>           Message to 7867650283@email.uscc.net failed.
>>
>> I hope, my patch reaches the right people anyway.
>>
>> Best
>>     Donald
>>
>>
>>>
>>> #ifdef __x86_64__
>>> #define __PAGE_OFFSET_ORIG      (0xffff810000000000) /* 2.6.26, or former */
>>> #define __PAGE_OFFSET_2_6_27    (0xffff880000000000) /* 2.6.27, or later  */
>>> #define __PAGE_OFFSET_5LEVEL    (0xff10000000000000) /* 5-level page table */
>>> ...
>>> #endif
>>>
>>> Thanks
>>> Baoquan
>>>
>>>>
>>>> Update to new address accordingly.
>>>> ---
>>>>    kexec/arch/i386/crashdump-x86.c | 2 ++
>>>>    kexec/arch/i386/crashdump-x86.h | 3 ++-
>>>>    2 files changed, 4 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
>>>> index a2aea31..c79791f 100644
>>>> --- a/kexec/arch/i386/crashdump-x86.c
>>>> +++ b/kexec/arch/i386/crashdump-x86.c
>>>> @@ -61,6 +61,8 @@ static int get_kernel_page_offset(struct kexec_info *UNUSED(info),
>>>>
>>>>               if (kv < KERNEL_VERSION(2, 6, 27))
>>>>                       elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_2_6_27;
>>>> +            else if (kv < KERNEL_VERSION(4, 20, 0))
>>>> +                    elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_4_20_0;
>>>>               else
>>>>                       elf_info->page_offset = X86_64_PAGE_OFFSET;
>>>>       }
>>>> diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
>>>> index ddee19f..e4fdc82 100644
>>>> --- a/kexec/arch/i386/crashdump-x86.h
>>>> +++ b/kexec/arch/i386/crashdump-x86.h
>>>> @@ -13,7 +13,8 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
>>>>
>>>>    #define X86_64__START_KERNEL_map   0xffffffff80000000ULL
>>>>    #define X86_64_PAGE_OFFSET_PRE_2_6_27      0xffff810000000000ULL
>>>> -#define X86_64_PAGE_OFFSET          0xffff880000000000ULL
>>>> +#define X86_64_PAGE_OFFSET_PRE_4_20_0       0xffff880000000000ULL
>>>> +#define X86_64_PAGE_OFFSET  0xffff888000000000ULL
>>>>
>>>>    #define X86_64_MAXMEM                      0x3fffffffffffUL
>>>>
>>>> --
>>>> 2.22.0
>>>>
>>>>
>>>> _______________________________________________
>>>> kexec mailing list
>>>> kexec@lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/kexec
>>
>>
>> --
>> Donald Buczek
>> buczek@molgen.mpg.de
>> Tel: +49 30 8413 1433


-- 
Donald Buczek
buczek@molgen.mpg.de
Tel: +49 30 8413 1433

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-08-30 10:05     ` Bhupesh Sharma
  2019-08-30 10:32       ` Donald Buczek
@ 2019-09-02  6:02       ` Baoquan He
  1 sibling, 0 replies; 13+ messages in thread
From: Baoquan He @ 2019-09-02  6:02 UTC (permalink / raw)
  To: Bhupesh Sharma
  Cc: Simon Horman, kexec mailing list, Donald Buczek, Kazuhito Hagio

On 08/30/19 at 03:35pm, Bhupesh Sharma wrote:
> On Fri, Aug 30, 2019 at 3:04 PM Donald Buczek <buczek@molgen.mpg.de> wrote:
> >
> > Dear Baoquan,
> >
> > On 8/30/19 11:23 AM, Baoquan He wrote:
> > > On 08/30/19 at 11:12am, Donald Buczek wrote:
> > >> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
> > >> region on 5-level paging") changed the base of the direct mapping
> > >> from 0xffff880000000000 to 0xffff888000000000. This was merged
> > >> into v4.20-rc2.
> > >
> > > A good catch and necessary fix, thanks.
> > >
> > > Does it have issue in makedumpfile?
> >
> > We don't use makedumpfile. We use `cp /proc/vmcore /mnt/crash.vmcore` in the panic kernel.
> 
> That shouldn't be a problem in makedumpfile as we have a generic way
> to calculate the PAGE_OFFSET value there from the PT_LOADs in the
> '/proc/kcore' file (which I mentioned in the other email conversation,
> see [0]):

Yeah, right.

> 
> static int
> get_page_offset_x86_64(void)
> {
> <..snip..>
>     if (get_num_pt_loads()) {
>         /*
>          * Linux 4.19 (only) adds KCORE_REMAP PT_LOADs, which have
>          * virt_start < __START_KERNEL_map, to /proc/kcore. In order
>          * not to select them, we select the last valid PT_LOAD.
>          */
>         for (i = 0;
>             get_pt_load(i, &phys_start, NULL, &virt_start, NULL);
>             i++) {
>             if (virt_start != NOT_KV_ADDR
>                     && virt_start < __START_KERNEL_map
>                     && phys_start != NOT_PADDR) {
>                 page_offset = virt_start - phys_start;
>             }
>         }
>         if (page_offset) {
>             info->page_offset = page_offset;
>             DEBUG_MSG("page_offset  : %lx (pt_load)\n",
>                 info->page_offset);
>             return TRUE;
>         }
>     }
> <..snip..>
> 
> Also as I mentioned in the other thread, I don't think adding
> different MACRO value for a kernel version is a long-term maintainable
> approach. Instead I am working on adding a similar functionality as
> present in makedumpfile to make the PAGE_OFFSET calculation generic.
> Only if we fail to calculate PAGE_OFFSET through a generic method
> should we fall back on MACRO values for backward compatibility.
> 
> I will try to post the patch for reviews by tomorrow.
> 
> [0]. https://lkml.org/lkml/2019/8/28/1060

Sounds a good idea, thanks for the effort.

Thanks
Baoquan

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-08-30  9:12 [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20 Donald Buczek
  2019-08-30  9:23 ` Baoquan He
@ 2019-09-03 14:41 ` Simon Horman
  2019-09-03 18:06   ` Donald Buczek
  1 sibling, 1 reply; 13+ messages in thread
From: Simon Horman @ 2019-09-03 14:41 UTC (permalink / raw)
  To: Donald Buczek; +Cc: Bhupesh Sharma, kexec

On Fri, Aug 30, 2019 at 11:12:58AM +0200, Donald Buczek wrote:
> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
> region on 5-level paging") changed the base of the direct mapping
> from 0xffff880000000000 to 0xffff888000000000. This was merged
> into v4.20-rc2.
> 
> Update to new address accordingly.

Thanks, applied for inclusion in v2.0.20.

> ---
>  kexec/arch/i386/crashdump-x86.c | 2 ++
>  kexec/arch/i386/crashdump-x86.h | 3 ++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index a2aea31..c79791f 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -61,6 +61,8 @@ static int get_kernel_page_offset(struct kexec_info *UNUSED(info),
>  
>  		if (kv < KERNEL_VERSION(2, 6, 27))
>  			elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_2_6_27;
> +		else if (kv < KERNEL_VERSION(4, 20, 0))
> +			elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_4_20_0;
>  		else
>  			elf_info->page_offset = X86_64_PAGE_OFFSET;
>  	}
> diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> index ddee19f..e4fdc82 100644
> --- a/kexec/arch/i386/crashdump-x86.h
> +++ b/kexec/arch/i386/crashdump-x86.h
> @@ -13,7 +13,8 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
>  
>  #define X86_64__START_KERNEL_map	0xffffffff80000000ULL
>  #define X86_64_PAGE_OFFSET_PRE_2_6_27	0xffff810000000000ULL
> -#define X86_64_PAGE_OFFSET		0xffff880000000000ULL
> +#define X86_64_PAGE_OFFSET_PRE_4_20_0	0xffff880000000000ULL
> +#define X86_64_PAGE_OFFSET	0xffff888000000000ULL
>  
>  #define X86_64_MAXMEM        		0x3fffffffffffUL
>  
> -- 
> 2.22.0
> 

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-09-03 14:41 ` Simon Horman
@ 2019-09-03 18:06   ` Donald Buczek
  2019-09-09  5:03     ` Bhupesh Sharma
  0 siblings, 1 reply; 13+ messages in thread
From: Donald Buczek @ 2019-09-03 18:06 UTC (permalink / raw)
  To: Simon Horman; +Cc: Bhupesh Sharma, kexec, Baoquan He

Dear Simon,

On 03.09.19 16:41, Simon Horman wrote:
> On Fri, Aug 30, 2019 at 11:12:58AM +0200, Donald Buczek wrote:
>> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
>> region on 5-level paging") changed the base of the direct mapping
>> from 0xffff880000000000 to 0xffff888000000000. This was merged
>> into v4.20-rc2.
>>
>> Update to new address accordingly.
> 
> Thanks, applied for inclusion in v2.0.20.

I must admit, that I overlooked that d52888aa2753 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging") was backported to 4.19.5 as 4074ca7d8a18 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging").

Bhupesh Sharma wanted to look into a a dynamic solution, which, of course, would be better. But if you still want to include this (e.g. as the fallback for the dynamic solution), you might want to replace the patch with the following one, which selects the new PAGE_OFFSET starting from kernel version 4.19.5 instead of 4.20.0.

Donald

>8------------------------------------------------------8<

     x86: Fix PAGE_OFFSET for kernels since 4.19.5
     
     Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
     region on 5-level paging") changed the base of the direct mapping
     from 0xffff880000000000 to 0xffff888000000000. This was merged
     into v4.20-rc2.
     
     The patch was backported to 4.19.5 as 4074ca7d8a18 ("x86/mm: Move LDT
     remap out of KASLR region on 5-level paging").
     
     Update to new address accordingly.

diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index a2aea31..f9d1998 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -61,6 +61,8 @@ static int get_kernel_page_offset(struct kexec_info *UNUSED(info),
  
                 if (kv < KERNEL_VERSION(2, 6, 27))
                         elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_2_6_27;
+               else if (kv < KERNEL_VERSION(4, 19, 5))
+                       elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_4_19_5;
                 else
                         elf_info->page_offset = X86_64_PAGE_OFFSET;
         }
diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
index ddee19f..6cd8826 100644
--- a/kexec/arch/i386/crashdump-x86.h
+++ b/kexec/arch/i386/crashdump-x86.h
@@ -13,7 +13,8 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
  
  #define X86_64__START_KERNEL_map       0xffffffff80000000ULL
  #define X86_64_PAGE_OFFSET_PRE_2_6_27  0xffff810000000000ULL
-#define X86_64_PAGE_OFFSET             0xffff880000000000ULL
+#define X86_64_PAGE_OFFSET_PRE_4_19_5  0xffff880000000000ULL
+#define X86_64_PAGE_OFFSET     0xffff888000000000ULL
  
  #define X86_64_MAXMEM                  0x3fffffffffffUL
  

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-09-03 18:06   ` Donald Buczek
@ 2019-09-09  5:03     ` Bhupesh Sharma
  2019-09-16  7:23       ` Simon Horman
  0 siblings, 1 reply; 13+ messages in thread
From: Bhupesh Sharma @ 2019-09-09  5:03 UTC (permalink / raw)
  To: Donald Buczek; +Cc: Simon Horman, kexec mailing list, Baoquan He

Sorry Guys,

On Tue, Sep 3, 2019 at 11:36 PM Donald Buczek <buczek@molgen.mpg.de> wrote:
>
> Dear Simon,
>
> On 03.09.19 16:41, Simon Horman wrote:
> > On Fri, Aug 30, 2019 at 11:12:58AM +0200, Donald Buczek wrote:
> >> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
> >> region on 5-level paging") changed the base of the direct mapping
> >> from 0xffff880000000000 to 0xffff888000000000. This was merged
> >> into v4.20-rc2.
> >>
> >> Update to new address accordingly.
> >
> > Thanks, applied for inclusion in v2.0.20.
>
> I must admit, that I overlooked that d52888aa2753 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging") was backported to 4.19.5 as 4074ca7d8a18 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging").
>
> Bhupesh Sharma wanted to look into a a dynamic solution, which, of course, would be better. But if you still want to include this (e.g. as the fallback for the dynamic solution), you might want to replace the patch with the following one, which selects the new PAGE_OFFSET starting from kernel version 4.19.5 instead of 4.20.0.

I was in a conference last week and was not able to connect to my test
machine(s) to develop and test a more generic fix, as I suggested in
my earlier message.

I will try to work on and send a generic fix in a couple of days.

Thanks.
Bhupesh

> Donald
>
> >8------------------------------------------------------8<
>
>      x86: Fix PAGE_OFFSET for kernels since 4.19.5
>
>      Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
>      region on 5-level paging") changed the base of the direct mapping
>      from 0xffff880000000000 to 0xffff888000000000. This was merged
>      into v4.20-rc2.
>
>      The patch was backported to 4.19.5 as 4074ca7d8a18 ("x86/mm: Move LDT
>      remap out of KASLR region on 5-level paging").
>
>      Update to new address accordingly.
>
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index a2aea31..f9d1998 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -61,6 +61,8 @@ static int get_kernel_page_offset(struct kexec_info *UNUSED(info),
>
>                  if (kv < KERNEL_VERSION(2, 6, 27))
>                          elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_2_6_27;
> +               else if (kv < KERNEL_VERSION(4, 19, 5))
> +                       elf_info->page_offset = X86_64_PAGE_OFFSET_PRE_4_19_5;
>                  else
>                          elf_info->page_offset = X86_64_PAGE_OFFSET;
>          }
> diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> index ddee19f..6cd8826 100644
> --- a/kexec/arch/i386/crashdump-x86.h
> +++ b/kexec/arch/i386/crashdump-x86.h
> @@ -13,7 +13,8 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
>
>   #define X86_64__START_KERNEL_map       0xffffffff80000000ULL
>   #define X86_64_PAGE_OFFSET_PRE_2_6_27  0xffff810000000000ULL
> -#define X86_64_PAGE_OFFSET             0xffff880000000000ULL
> +#define X86_64_PAGE_OFFSET_PRE_4_19_5  0xffff880000000000ULL
> +#define X86_64_PAGE_OFFSET     0xffff888000000000ULL
>
>   #define X86_64_MAXMEM                  0x3fffffffffffUL
>

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-09-09  5:03     ` Bhupesh Sharma
@ 2019-09-16  7:23       ` Simon Horman
  2019-09-16 10:47         ` Donald Buczek
  2019-09-16 10:51         ` Bhupesh Sharma
  0 siblings, 2 replies; 13+ messages in thread
From: Simon Horman @ 2019-09-16  7:23 UTC (permalink / raw)
  To: Bhupesh Sharma; +Cc: kexec mailing list, Donald Buczek, Baoquan He

On Mon, Sep 09, 2019 at 10:33:11AM +0530, Bhupesh Sharma wrote:
> Sorry Guys,
> 
> On Tue, Sep 3, 2019 at 11:36 PM Donald Buczek <buczek@molgen.mpg.de> wrote:
> >
> > Dear Simon,
> >
> > On 03.09.19 16:41, Simon Horman wrote:
> > > On Fri, Aug 30, 2019 at 11:12:58AM +0200, Donald Buczek wrote:
> > >> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
> > >> region on 5-level paging") changed the base of the direct mapping
> > >> from 0xffff880000000000 to 0xffff888000000000. This was merged
> > >> into v4.20-rc2.
> > >>
> > >> Update to new address accordingly.
> > >
> > > Thanks, applied for inclusion in v2.0.20.
> >
> > I must admit, that I overlooked that d52888aa2753 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging") was backported to 4.19.5 as 4074ca7d8a18 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging").
> >
> > Bhupesh Sharma wanted to look into a a dynamic solution, which, of course, would be better. But if you still want to include this (e.g. as the fallback for the dynamic solution), you might want to replace the patch with the following one, which selects the new PAGE_OFFSET starting from kernel version 4.19.5 instead of 4.20.0.
> 
> I was in a conference last week and was not able to connect to my test
> machine(s) to develop and test a more generic fix, as I suggested in
> my earlier message.
> 
> I will try to work on and send a generic fix in a couple of days.

Thanks,

I think it would be best if this patch,
23b67f048dde ("x86: Fix PAGE_OFFSET for kernels since 4.20"),
was reverted.

Donald, Bhupesh, what do you think?

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-09-16  7:23       ` Simon Horman
@ 2019-09-16 10:47         ` Donald Buczek
  2019-09-16 14:13           ` Simon Horman
  2019-09-16 10:51         ` Bhupesh Sharma
  1 sibling, 1 reply; 13+ messages in thread
From: Donald Buczek @ 2019-09-16 10:47 UTC (permalink / raw)
  To: Simon Horman, Bhupesh Sharma; +Cc: kexec mailing list, Baoquan He

On 9/16/19 9:23 AM, Simon Horman wrote:
> On Mon, Sep 09, 2019 at 10:33:11AM +0530, Bhupesh Sharma wrote:
>> Sorry Guys,
>>
>> On Tue, Sep 3, 2019 at 11:36 PM Donald Buczek <buczek@molgen.mpg.de> wrote:
>>>
>>> Dear Simon,
>>>
>>> On 03.09.19 16:41, Simon Horman wrote:
>>>> On Fri, Aug 30, 2019 at 11:12:58AM +0200, Donald Buczek wrote:
>>>>> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
>>>>> region on 5-level paging") changed the base of the direct mapping
>>>>> from 0xffff880000000000 to 0xffff888000000000. This was merged
>>>>> into v4.20-rc2.
>>>>>
>>>>> Update to new address accordingly.
>>>>
>>>> Thanks, applied for inclusion in v2.0.20.
>>>
>>> I must admit, that I overlooked that d52888aa2753 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging") was backported to 4.19.5 as 4074ca7d8a18 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging").
>>>
>>> Bhupesh Sharma wanted to look into a a dynamic solution, which, of course, would be better. But if you still want to include this (e.g. as the fallback for the dynamic solution), you might want to replace the patch with the following one, which selects the new PAGE_OFFSET starting from kernel version 4.19.5 instead of 4.20.0.
>>
>> I was in a conference last week and was not able to connect to my test
>> machine(s) to develop and test a more generic fix, as I suggested in
>> my earlier message.
>>
>> I will try to work on and send a generic fix in a couple of days.
> 
> Thanks,
> 
> I think it would be best if this patch,
> 23b67f048dde ("x86: Fix PAGE_OFFSET for kernels since 4.20"),
> was reverted.
> 
> Donald, Bhupesh, what do you think?

The original patch is technically correct and fixes the problem for 4.20 kernels, so I don't know, why it should be reverted.

My replacement patch was to address 4.19 kernels as well. But if the original patch has already been comitted and published, it should not be replaced of course. 4.20 kernels should be addressed by a separate patch on top of it instead.

As I'm not subscribed to the kexec list, I may have missed the latest news, however.

Best
   Donald
-- 
Donald Buczek
buczek@molgen.mpg.de
Tel: +49 30 8413 1433

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-09-16  7:23       ` Simon Horman
  2019-09-16 10:47         ` Donald Buczek
@ 2019-09-16 10:51         ` Bhupesh Sharma
  1 sibling, 0 replies; 13+ messages in thread
From: Bhupesh Sharma @ 2019-09-16 10:51 UTC (permalink / raw)
  To: Simon Horman; +Cc: kexec mailing list, Donald Buczek, Baoquan He

Hi Simon,

On Mon, Sep 16, 2019 at 12:53 PM Simon Horman <horms@verge.net.au> wrote:
>
> On Mon, Sep 09, 2019 at 10:33:11AM +0530, Bhupesh Sharma wrote:
> > Sorry Guys,
> >
> > On Tue, Sep 3, 2019 at 11:36 PM Donald Buczek <buczek@molgen.mpg.de> wrote:
> > >
> > > Dear Simon,
> > >
> > > On 03.09.19 16:41, Simon Horman wrote:
> > > > On Fri, Aug 30, 2019 at 11:12:58AM +0200, Donald Buczek wrote:
> > > >> Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
> > > >> region on 5-level paging") changed the base of the direct mapping
> > > >> from 0xffff880000000000 to 0xffff888000000000. This was merged
> > > >> into v4.20-rc2.
> > > >>
> > > >> Update to new address accordingly.
> > > >
> > > > Thanks, applied for inclusion in v2.0.20.
> > >
> > > I must admit, that I overlooked that d52888aa2753 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging") was backported to 4.19.5 as 4074ca7d8a18 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging").
> > >
> > > Bhupesh Sharma wanted to look into a a dynamic solution, which, of course, would be better. But if you still want to include this (e.g. as the fallback for the dynamic solution), you might want to replace the patch with the following one, which selects the new PAGE_OFFSET starting from kernel version 4.19.5 instead of 4.20.0.
> >
> > I was in a conference last week and was not able to connect to my test
> > machine(s) to develop and test a more generic fix, as I suggested in
> > my earlier message.
> >
> > I will try to work on and send a generic fix in a couple of days.
>
> Thanks,
>
> I think it would be best if this patch,
> 23b67f048dde ("x86: Fix PAGE_OFFSET for kernels since 4.20"),
> was reverted.
>
> Donald, Bhupesh, what do you think?

I am still working on a correct fix for this issue, so I would think
we can keep Donald' patch for now.
Once my fix is ready and it is accepted after reviews, I think we can
revert Donald's patch.

Thanks,
Bhupesh

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

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

* Re: [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20
  2019-09-16 10:47         ` Donald Buczek
@ 2019-09-16 14:13           ` Simon Horman
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Horman @ 2019-09-16 14:13 UTC (permalink / raw)
  To: Donald Buczek, Bhupesh Sharma; +Cc: kexec mailing list, Baoquan He

On Mon, Sep 16, 2019 at 12:47:00PM +0200, Donald Buczek wrote:
> On 9/16/19 9:23 AM, Simon Horman wrote:
> > On Mon, Sep 09, 2019 at 10:33:11AM +0530, Bhupesh Sharma wrote:
> > > Sorry Guys,
> > > 
> > > On Tue, Sep 3, 2019 at 11:36 PM Donald Buczek <buczek@molgen.mpg.de> wrote:
> > > > 
> > > > Dear Simon,
> > > > 
> > > > On 03.09.19 16:41, Simon Horman wrote:
> > > > > On Fri, Aug 30, 2019 at 11:12:58AM +0200, Donald Buczek wrote:
> > > > > > Linux kernel commit d52888aa2753 ("x86/mm: Move LDT remap out of KASLR
> > > > > > region on 5-level paging") changed the base of the direct mapping
> > > > > > from 0xffff880000000000 to 0xffff888000000000. This was merged
> > > > > > into v4.20-rc2.
> > > > > > 
> > > > > > Update to new address accordingly.
> > > > > 
> > > > > Thanks, applied for inclusion in v2.0.20.
> > > > 
> > > > I must admit, that I overlooked that d52888aa2753 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging") was backported to 4.19.5 as 4074ca7d8a18 ("x86/mm: Move LDT remap out of KASLR region on 5-level paging").
> > > > 
> > > > Bhupesh Sharma wanted to look into a a dynamic solution, which, of course, would be better. But if you still want to include this (e.g. as the fallback for the dynamic solution), you might want to replace the patch with the following one, which selects the new PAGE_OFFSET starting from kernel version 4.19.5 instead of 4.20.0.
> > > 
> > > I was in a conference last week and was not able to connect to my test
> > > machine(s) to develop and test a more generic fix, as I suggested in
> > > my earlier message.
> > > 
> > > I will try to work on and send a generic fix in a couple of days.
> > 
> > Thanks,
> > 
> > I think it would be best if this patch,
> > 23b67f048dde ("x86: Fix PAGE_OFFSET for kernels since 4.20"),
> > was reverted.
> > 
> > Donald, Bhupesh, what do you think?
> 
> The original patch is technically correct and fixes the problem for 4.20 kernels, so I don't know, why it should be reverted.
> 
> My replacement patch was to address 4.19 kernels as well. But if the original patch has already been comitted and published, it should not be replaced of course. 4.20 kernels should be addressed by a separate patch on top of it instead.
> 
> As I'm not subscribed to the kexec list, I may have missed the latest news, however.

On Mon, Sep 16, 2019 at 04:21:20PM +0530, Bhupesh Sharma wrote:
> Hi Simon,
> 
> On Mon, Sep 16, 2019 at 12:53 PM Simon Horman <horms@verge.net.au> wrote:
> >
> > On Mon, Sep 09, 2019 at 10:33:11AM +0530, Bhupesh Sharma wrote:

...

> > Thanks,
> >
> > I think it would be best if this patch,
> > 23b67f048dde ("x86: Fix PAGE_OFFSET for kernels since 4.20"),
> > was reverted.
> >
> > Donald, Bhupesh, what do you think?
> 
> I am still working on a correct fix for this issue, so I would think
> we can keep Donald' patch for now.
> Once my fix is ready and it is accepted after reviews, I think we can
> revert Donald's patch.
> 
> Thanks,
> Bhupesh
> 

Thanks Donald, thanks Bhupesh.

I will leave 23b67f048dde ("x86: Fix PAGE_OFFSET for kernels since 4.20")
in the tree and look forward to the follow-up work from Bhupesh.

Kind regards,
Simon

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

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

end of thread, other threads:[~2019-09-16 14:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-30  9:12 [PATCH] x86: Fix PAGE_OFFSET for kernels since 4.20 Donald Buczek
2019-08-30  9:23 ` Baoquan He
2019-08-30  9:34   ` Donald Buczek
2019-08-30 10:05     ` Bhupesh Sharma
2019-08-30 10:32       ` Donald Buczek
2019-09-02  6:02       ` Baoquan He
2019-09-03 14:41 ` Simon Horman
2019-09-03 18:06   ` Donald Buczek
2019-09-09  5:03     ` Bhupesh Sharma
2019-09-16  7:23       ` Simon Horman
2019-09-16 10:47         ` Donald Buczek
2019-09-16 14:13           ` Simon Horman
2019-09-16 10:51         ` 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.