Re: [PATCH v3 4/6] x86/mm/KASLR: Fix the wrong calculation of memory region initial size

2019-02-18 Thread Baoquan He
On 02/17/19 at 08:53am, Kees Cook wrote: > On Sat, Feb 16, 2019 at 6:03 AM Baoquan He wrote: > > > > In memory region KASLR, __PHYSICAL_MASK_SHIFT is taken to calculate > > the initial size of the direct mapping region. This is correct in > > the old code where __PHYSICAL_MASK_SHIFT was equal to

Re: [PATCH v3 4/6] x86/mm/KASLR: Fix the wrong calculation of memory region initial size

2019-02-17 Thread Kees Cook
On Sat, Feb 16, 2019 at 6:03 AM Baoquan He wrote: > > In memory region KASLR, __PHYSICAL_MASK_SHIFT is taken to calculate > the initial size of the direct mapping region. This is correct in > the old code where __PHYSICAL_MASK_SHIFT was equal to MAX_PHYSMEM_BITS, > 46 bits, and only 4-level mode

[PATCH v3 4/6] x86/mm/KASLR: Fix the wrong calculation of memory region initial size

2019-02-16 Thread Baoquan He
In memory region KASLR, __PHYSICAL_MASK_SHIFT is taken to calculate the initial size of the direct mapping region. This is correct in the old code where __PHYSICAL_MASK_SHIFT was equal to MAX_PHYSMEM_BITS, 46 bits, and only 4-level mode was supported. Later, in commit b83ce5ee91471d ("x86/mm/64: