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]
Date:	Tue, 13 Sep 2011 14:52:18 -0700
From:	Andrew Morton <akpm@...gle.com>
To:	Michael Holzheu <holzheu@...ux.vnet.ibm.com>
Cc:	vgoyal@...hat.com, ebiederm@...ssion.com,
	mahesh@...ux.vnet.ibm.com, schwidefsky@...ibm.com,
	heiko.carstens@...ibm.com, kexec@...ts.infradead.org,
	linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [patch v2 2/2] s390: Add architecture code for unmapping
 crashkernel memory

On Tue, 13 Sep 2011 15:26:37 +0200
Michael Holzheu <holzheu@...ux.vnet.ibm.com> wrote:

> From: Michael Holzheu <holzheu@...ux.vnet.ibm.com>
> 
> This patch implements the crash_map_pages() function for s390.
> KEXEC_CRASH_MEM_ALIGN is set to HPAGE_SIZE, in order to support
> kernel mappings that use large pages.
> 
> Signed-off-by: Michael Holzheu <holzheu@...ux.vnet.ibm.com>
> ---
>  arch/s390/include/asm/kexec.h    |    3 +++
>  arch/s390/kernel/machine_kexec.c |   31 +++++++++++++++++++++++++++++++
>  arch/s390/kernel/setup.c         |   10 ++++++----
>  3 files changed, 40 insertions(+), 4 deletions(-)
> 
> --- a/arch/s390/include/asm/kexec.h
> +++ b/arch/s390/include/asm/kexec.h
> @@ -36,6 +36,9 @@
>  /* Allocate one page for the pdp and the second for the code */
>  #define KEXEC_CONTROL_PAGE_SIZE 4096
>  
> +/* Alignment of crashkernel memory */
> +#define KEXEC_CRASH_MEM_ALIGN HPAGE_SIZE

Why not make this unconditional, for all architectures which support
hugepages?  ie:

#ifdef HPAGE_SIZE
#define KEXEC_CRASH_MEM_ALIGN HPAGE_SIZE
#else
#define KEXEC_CRASH_MEM_ALIGN PAGE_SIZE
#endif

in include/linux/kexec.h?

IOW, what are the compromises here?

Also, does s390 support CONFIG_HUGETLB_PAGE=n?  If so, does the use of
HPAGE_SIZE still make sense?  Does it compile?


>  /* The native architecture */
>  #define KEXEC_ARCH KEXEC_ARCH_S390
>  
> --- a/arch/s390/kernel/machine_kexec.c
> +++ b/arch/s390/kernel/machine_kexec.c
> @@ -243,6 +243,37 @@ static void __machine_kdump(void *image)
>  #endif
>  
>  /*
> + * Map or unmap crashkernel memory
> + */
> +static void crash_map_pages(int enable)
> +{
> +	unsigned long size = crashk_res.end - crashk_res.start + 1;

resource_size().

> +	BUG_ON(crashk_res.start % KEXEC_CRASH_MEM_ALIGN ||
> +	       size % KEXEC_CRASH_MEM_ALIGN);
> +	if (enable)
> +		vmem_add_mapping(crashk_res.start, size);
> +	else
> +		vmem_remove_mapping(crashk_res.start, size);
> +}
>
> ...
>
--
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