lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160107123825.GB2870@dhcp-128-65.nay.redhat.com>
Date:	Thu, 7 Jan 2016 20:38:25 +0800
From:	Dave Young <dyoung@...hat.com>
To:	Toshi Kani <toshi.kani@....com>
Cc:	akpm@...ux-foundation.org, bp@...en8.de,
	linux-arch@...r.kernel.org, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, kexec@...ts.infradead.org
Subject: Re: [PATCH v3 07/17] kexec: Set IORESOURCE_SYSTEM_RAM to System RAM

On 01/05/16 at 11:54am, Toshi Kani wrote:
> Set IORESOURCE_SYSTEM_RAM to 'flags' and IORES_DESC_CRASH_KERNEL
> to 'desc' of "Crash kernel" resource ranges, which are child
> nodes of System RAM.
> 
> Change crash_shrink_memory() to set IORESOURCE_SYSTEM_RAM for
> a System RAM range.
> 
> Change kexec_add_buffer() to call walk_iomem_res() with
> IORESOURCE_SYSTEM_RAM type for "Crash kernel".
> 
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Dave Young <dyoung@...hat.com>
> Cc: kexec@...ts.infradead.org
> Signed-off-by: Toshi Kani <toshi.kani@....com>
> ---
>  kernel/kexec_core.c |    8 +++++---
>  kernel/kexec_file.c |    2 +-
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index 11b64a6..80bff05 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -66,13 +66,15 @@ struct resource crashk_res = {
>  	.name  = "Crash kernel",
>  	.start = 0,
>  	.end   = 0,
> -	.flags = IORESOURCE_BUSY | IORESOURCE_MEM
> +	.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
> +	.desc  = IORES_DESC_CRASH_KERNEL
>  };
>  struct resource crashk_low_res = {
>  	.name  = "Crash kernel",
>  	.start = 0,
>  	.end   = 0,
> -	.flags = IORESOURCE_BUSY | IORESOURCE_MEM
> +	.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
> +	.desc  = IORES_DESC_CRASH_KERNEL
>  };
>  
>  int kexec_should_crash(struct task_struct *p)
> @@ -934,7 +936,7 @@ int crash_shrink_memory(unsigned long new_size)
>  
>  	ram_res->start = end;
>  	ram_res->end = crashk_res.end;
> -	ram_res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
> +	ram_res->flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM;
>  	ram_res->name = "System RAM";
>  
>  	crashk_res.end = end - 1;
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index b70ada0..c245085 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -523,7 +523,7 @@ int kexec_add_buffer(struct kimage *image, char *buffer, unsigned long bufsz,
>  	/* Walk the RAM ranges and allocate a suitable range for the buffer */
>  	if (image->type == KEXEC_TYPE_CRASH)
>  		ret = walk_iomem_res("Crash kernel",
> -				     IORESOURCE_MEM | IORESOURCE_BUSY,
> +				     IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY,
>  				     crashk_res.start, crashk_res.end, kbuf,
>  				     locate_mem_hole_callback);
>  	else

Reviewed-by: Dave Young <dyoung@...hat.com>

Thanks
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ