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: <20141001131812.1893BE00A3@blue.fi.intel.com>
Date:	Wed,  1 Oct 2014 16:18:12 +0300 (EEST)
From:	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To:	Sasha Levin <sasha.levin@...cle.com>
Cc:	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Dave Hansen <dave.hansen@...el.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] mm: generalize VM_BUG_ON() macros

Sasha Levin wrote:
> On 10/01/2014 07:31 AM, Kirill A. Shutemov wrote:
> > +#define _VM_DUMP(arg, cond) do {					\
> > +	if (__builtin_types_compatible_p(typeof(*arg), struct page))	\
> > +		dump_page((struct page *) arg,				\
> > +				"VM_BUG_ON(" __stringify(cond)")");	\
> > +	else if (__builtin_types_compatible_p(typeof(*arg),		\
> > +				struct vm_area_struct))			\
> > +		dump_vma((struct vm_area_struct *) arg);		\
> > +	else if (__builtin_types_compatible_p(typeof(*arg),		\
> > +				struct mm_struct))			\
> > +		dump_mm((struct mm_struct *) arg);			\
> > +	else								\
> > +		BUILD_BUG();						\
> > +} while(0)
> 
> __same_type() instead of __builtin_types_compatible_p() would look nicer,
> but I don't think that all compilers support that:
> 
> 	include/linux/compiler-intel.h:/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
> 
> So it would effectively disable VM_BUG_ONs on Intel's compiler

We can make _VM_DUMP nop, but I don't think ICC can build kernel anyway:
we already use __builtin_types_compatible_p() in i915 driver and other
places. Nobody cares.

Any other comments?

-- 
 Kirill A. Shutemov
--
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