lkml.org 
[lkml]   [2018]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 4/4] x86/boot/KASLR: Limit kaslr to choosing the immovable memory
From
Date
Hi Fan,

At 07/23/2018 05:29 PM, Chao Fan wrote:
> If 'CONFIG_MEMORY_HOTREMOVE' specified and the account of immovable
> memory regions is not zero. Calculate the intersection between memory
> regions from e820/efi memory table and immovable memory regions.
> Or go on the old code.
>
> Rename process_mem_region to slots_count to match slots_fetch_random,
> and name new function as process_mem_region.
>
> Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
> ---
> arch/x86/boot/compressed/kaslr.c | 66 ++++++++++++++++++++++++++------
> 1 file changed, 55 insertions(+), 11 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
> index 4705682caf1f..10bda3a1fcaa 100644
> --- a/arch/x86/boot/compressed/kaslr.c
> +++ b/arch/x86/boot/compressed/kaslr.c
> @@ -631,9 +631,9 @@ static unsigned long slots_fetch_random(void)
> return 0;
> }
>
> -static void process_mem_region(struct mem_vector *entry,
> - unsigned long minimum,
> - unsigned long image_size)
> +static void slots_count(struct mem_vector *entry,
^^^^^^^^^^^
is not suitable.
IMO, how about process_mem_slots() or you may have a better name, it's
up to you.

> + unsigned long minimum,
> + unsigned long image_size)
> {
> struct mem_vector region, overlap;
> struct slot_area slot_area;

slot_area is also unused.

Thanks,
dou



\
 
 \ /
  Last update: 2018-08-02 07:46    [W:0.140 / U:4.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site