Re: [PATCH v2 6/8] x86/kaslr: Simplify process_gb_huge_pages

2020-07-28 Thread Kees Cook
On Tue, Jul 28, 2020 at 03:45:11PM -0400, Arvind Sankar wrote: > But the IS_ENABLED check allows the compiler to eliminate the entire > function at compile time. Ah, I thought it'd be a const false, which would do the same... -- Kees Cook

Re: [PATCH v2 6/8] x86/kaslr: Simplify process_gb_huge_pages

2020-07-28 Thread Arvind Sankar
On Tue, Jul 28, 2020 at 12:27:17PM -0700, Kees Cook wrote: > On Mon, Jul 27, 2020 at 07:07:59PM -0400, Arvind Sankar wrote: > > Short-circuit the whole function on 32-bit. > > > > Replace the loop to determine the number of 1Gb pages with arithmetic. > > > > Fix one minor bug: if the end of the

Re: [PATCH v2 6/8] x86/kaslr: Simplify process_gb_huge_pages

2020-07-28 Thread Kees Cook
On Mon, Jul 27, 2020 at 07:07:59PM -0400, Arvind Sankar wrote: > Short-circuit the whole function on 32-bit. > > Replace the loop to determine the number of 1Gb pages with arithmetic. > > Fix one minor bug: if the end of the region is aligned on a 1Gb > boundary, the current code will not use

[PATCH v2 6/8] x86/kaslr: Simplify process_gb_huge_pages

2020-07-27 Thread Arvind Sankar
Short-circuit the whole function on 32-bit. Replace the loop to determine the number of 1Gb pages with arithmetic. Fix one minor bug: if the end of the region is aligned on a 1Gb boundary, the current code will not use the last available 1Gb page due to an off-by-one error. Signed-off-by: