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: <1294638989.17779.296.camel@pasglop>
Date:	Mon, 10 Jan 2011 16:56:29 +1100
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	David Miller <davem@...emloft.net>
Subject: Re: [PATCH] memblock: Don't adjust size in memblock_find_base()

On Fri, 2011-01-07 at 12:41 -0800, Yinghai Lu wrote:
> While applying patch to use memblock to find aperture for 64bit x86.
> Ingo found system with 1g + force_iommu

Please run that through DaveM. I seem to remember that he relies on the
size alignment to ensure that a lot of tiny allocations get properly
coalesced or he runs out of regions at boot time.

A better option would be to use a fixed alignment, or sized based but
with a max threshold such as PAGE_SIZE.

Cheers,
Ben.

> > No AGP bridge found
> > Node 0: aperture @ 38000000 size 32 MB
> > Aperture pointing to e820 RAM. Ignoring.
> > Your BIOS doesn't leave a aperture memory hole
> > Please enable the IOMMU option in the BIOS setup
> > This costs you 64 MB of RAM
> > Cannot allocate aperture memory hole (0,65536K)
> 
> the corresponding code:
> 	addr = memblock_find_in_range(0, 1ULL<<32, aper_size, 512ULL<<20);
> 	if (addr == MEMBLOCK_ERROR || addr + aper_size > 0xffffffff) {
> 		printk(KERN_ERR
> 			"Cannot allocate aperture memory hole (%lx,%uK)\n",
> 				addr, aper_size>>10);
> 		return 0;
> 	}
> 	memblock_x86_reserve_range(addr, addr + aper_size, "aperture64")
> 
> it fails because memblock core code align the size with 512M. that could make
> size way too big.
> 
> So don't align the size in that case.
> 
> actually __memblock_alloc_base, the another caller already align that before calling that function.
> 
> BTW. x86 does not use __memblock_alloc_base...
> 
> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
> 
> ---
>  mm/memblock.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> Index: linux-2.6/mm/memblock.c
> ===================================================================
> --- linux-2.6.orig/mm/memblock.c
> +++ linux-2.6/mm/memblock.c
> @@ -137,8 +137,6 @@ static phys_addr_t __init_memblock membl
>  
>  	BUG_ON(0 == size);
>  
> -	size = memblock_align_up(size, align);
> -
>  	/* Pump up max_addr */
>  	if (end == MEMBLOCK_ALLOC_ACCESSIBLE)
>  		end = memblock.current_limit;
> --
> 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/


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