Sorry Guys,

On Tue, Sep 3, 2019 at 11:36 PM Donald Buczek <[email protected]> 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
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to