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] [day] [month] [year] [list]
Message-ID: <7756.1350430050@warthog.procyon.org.uk>
Date:	Wed, 17 Oct 2012 00:27:30 +0100
From:	David Howells <dhowells@...hat.com>
To:	"Luis R. Rodriguez" <mcgrof@...not-panic.com>
Cc:	dhowells@...hat.com,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
	devel@...verdev.osuosl.org, backports@...r.kernel.org, rob@...com,
	arnd@...db.de, davej@...hat.com, airlied@...ux.ie,
	bskeggs@...hat.com, alan@...rguk.ukuu.org.uk, tglx@...utronix.de,
	daniel.vetter@...ll.ch, jbarnes@...tuousgeek.org,
	alexander.deucher@....com, paulmck@...ux.vnet.ibm.com,
	gregkh@...uxfoundation.org
Subject: Re: [PATCH 1/2] uapi: update includes for drm content when no kernel API exists

Luis R. Rodriguez <mcgrof@...not-panic.com> wrote:

> >> The include_next trick can work as well but that'd mean synching the UAPI
> >> files regularly into compat. I'd much prefer to have code intact when
> >> possible when backporting so the option I stuck with then was to patch
> >> the code directly and then as part of compat-drivers to always copy
> >> that day's linux-next UAPI headers into the current directory for
> >> compilation. I see no other driver code using the uapi path explicitly
> >> though, is that by design?
> >
> > As far as I understand that's by design, yes. Kernel code isn't expected to
> > reference uapi/ headers directly.
> 
> Did the design consider the case where no respective kernel API header
> file would ever exist?

I didn't particularly design it such that kernel .c files couldn't access uapi
.h files directly.  I did, however, design it so that my scripts wouldn't have
to touch any .c files where possible, and certainly I didn't want to have to
double up all #includes that refer to KAPI/UAPI split headers.

Ideally, I'd've used #include_next in the KAPI file to refer to the UAPI file
where both exist, but some people have strong objections to that, so I ended
up having to do #include <uapi/...> instead.

I also didn't want to rename the asm/, linux/, etc. prefixes as that would
mandate changing pretty much every #include in the kernel.

For the case where no respective KAPI file exists, it was considered and it is
handled.  This is done by adding extra -I flags, for example:

	-I include
	-I include/uapi

so looking for linux/foo.h, say, will look first for include/linux/foo.h and
then for include/uapi/linux/foo.h.

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