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: <4CE30244.6090208@linux.intel.com>
Date:	Tue, 16 Nov 2010 14:14:28 -0800
From:	"H. Peter Anvin" <hpa@...ux.intel.com>
To:	Suresh Siddha <suresh.b.siddha@...el.com>
CC:	hpa@...or.com, mingo@...e.hu, tglx@...utronix.de,
	linux-kernel@...r.kernel.org,
	"H. Peter Anvin" <hpa@...ux.jf.intel.com>
Subject: Re: [patch 1/2] bootmem: add alloc_bootmem_align()

On 11/16/2010 01:23 PM, Suresh Siddha wrote:
> Index: tree/include/linux/bootmem.h
> ===================================================================
> --- tree.orig/include/linux/bootmem.h
> +++ tree/include/linux/bootmem.h
> @@ -105,6 +105,8 @@ extern void *__alloc_bootmem_low_node(pg
>  
>  #define alloc_bootmem(x) \
>  	__alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
> +#define alloc_bootmem_align(x, align) \
> +	__alloc_bootmem(x, align, __pa(MAX_DMA_ADDRESS))
>  #define alloc_bootmem_nopanic(x) \
>  	__alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
>  #define alloc_bootmem_pages(x) \

  [...]

>  	 */
> -	init_xstate_buf = alloc_bootmem(xstate_size);
> +	init_xstate_buf = alloc_bootmem_align(xstate_size,
> +					      __alignof__(struct xsave_struct));
>  	init_xstate_buf->i387.mxcsr = MXCSR_DEFAULT;

Perhaps it would make even more sense to have:

#define alloc_bootmem_alignof(x, type) \
	__alloc_bootmem(x, __alignof__(type), __pa(MAX_DMA_ADDRESS))


?

	-hpa
--
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