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:	Mon, 21 Nov 2011 15:50:24 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	David Daney <ddaney@...iumnetworks.com>,
	David Daney <ddaney.cavm@...il.com>,
	David Rientjes <rientjes@...gle.com>,
	"linux-mips@...ux-mips.org" <linux-mips@...ux-mips.org>,
	"ralf@...ux-mips.org" <ralf@...ux-mips.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	David Daney <david.daney@...ium.com>,
	"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
	Robin Holt <holt@....com>
Subject: Re: [patch] hugetlb: remove dummy definitions of HPAGE_MASK and
 HPAGE_SIZE

On Mon, 21 Nov 2011 15:43:26 -0800
Linus Torvalds <torvalds@...ux-foundation.org> wrote:

> On Mon, Nov 21, 2011 at 3:23 PM, David Daney <ddaney@...iumnetworks.com> wrote:
> >
> > Ok Linus, for you I would recommend against running this git command on your
> > tree:
> >
> > git grep -E '#define.+BUG\(\);'
> >
> > It's not like there isn't precedence.
> 
> So two wrongs make a right?
> 
> I do note that almost all the BUG() ones are in the same broken area:
> hugepages. There's something wrong with the development there.
> 
> I wish people whose code had stuff like that would take a deep look at it.
> 

The original decision way back when was that huge pages shouldn't mess
up the core VM too much.  One way in which we addressed that was to
make all its functions compilable with CONFIG_HUGETLB_PAGE=n, but they
should never be executed.  So the basic implementation pattern is:

#ifndef CONFIG_HUGETLB_PAGE
#define is_vm_hugetlb_page(p) 0
#define hugetlb_foo(x) BUG()

and...

	if (is_vm_hugetlb_page(...))
		hugetlb_foo(...);

The is_vm_hugetlb_page() evaluates to literal zero and so no code is
emitted for the hugetlb_foo() call.  The BUG() should never appear in
vmlinux but it's in there as a we-screwed-up thing.



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