[PATCH] powerpc: Don't use CONFIG_PPC64 in user-visible header files

Arnd Bergmann arnd at arndb.de
Tue Dec 13 10:37:58 EST 2005


Am Montag 12 Dezember 2005 23:50 schrieb Benjamin Herrenschmidt:
> They should not to that.

Of course they should not. But if they did such things on 2.6.14 it might have
worked and if it fails in 2.6.15 that is a regression.

> > I originally argued that we should only use __powerpc64__ in header files
> > for just this reason.
>
> Userspace has no business including vdso_data.h at least and I fail to
> see what business it would have including io.h

Both these files have sections marked #ifdef __KERNEL__ in them, so the
assumption is that the other parts are actually written in a way that they
don't hurt if they get included.

Traditionally, asm/io.h gets included on i386 in order to do nasty things with
iopl() and direct device access from user space. The way that
include/asm-powerpc/io.h is written allows you to call the 
{in,out}_{be,le}{8,16,32,64} on /dev/mem or similar files. While this is
probably a bad idea, I can see why someone might have started using
it and it should not just stop working.

The comment in asm/vdso_data.h suggests that it actually is meant to
be a user space ABI header (even though a misguided attempt at doing
so). An application including it to get the expected ppc64 data structure
layout will be silently broken by relying on CONFIG_PPC64.

	Arnd <><



More information about the Linuxppc64-dev mailing list