Skip to contentSkip to conversation

+ git-hdrcleanup-vs-git-klibc-on-ia64-2.patch added to -mm tree

DISCUSSION David Woodhouse 4 participants 11 messages May 14, 2006

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · On Sun, 2006-05-14 at 11:01 -0700, [email protected] wrote:

diff -puN include/asm-ia64/page.h~git-hdrcleanup-vs-git-klibc-on-ia64-2 include/asm-ia64/page.h

include/asm-ia64/page.h Mon May 15 01:49:38 2006 renamed from include/asm-ia64/page.h~git-hdrcleanup-vs-git-klibc-on-ia64-2 Mon May 15 01:48:22 2006 +0 -0
@@ -36,7 +36,11 @@
 #elif defined(CONFIG_IA64_PAGE_SIZE_64KB)

include/asm-ia64/page.h Mon May 15 01:49:38 2006 line 46

Quoted 10 lines
include/asm-ia64/page.h Mon May 15 01:49:38 2006 renamed from include/asm-ia64/page.h~git-hdrcleanup-vs-git-klibc-on-ia64-2 Mon May 15 01:48:22 2006 +4 -0
 # define PAGE_SHIFT    16
 #else
+#ifdef __KERNEL__
 # error Unsupported page size!
+#else
+#define PAGE_SHIFT     12
+#endif
 #endif
 
 #define PAGE_SIZE              (__IA64_UL_CONST(1) << PAGE_SHIFT)

Hm, same applies here as to the last one. The __KERNEL__ ifdef applies to the whole crap around PAGE_SHIFT _and_ PAGE_SIZE, at least.

In the long term I think we want to drop page.h and elf.h from the list of files which are exported to userspace altogether. Either way, it's complicated so I was leaving them until later, after the first round of _simple_ cleanups was in. This failure is purely due to the removal of config.h, which is automatically included in kernel builds but evidently not klibc...

Signature · 1 line
dwmw2
#1 lore raw
Quoted 16 lines · David Woodhouse
Quoted 15 lines · On Sun, 2006-05-14 at 11:01 -0700, [email protected] wrote:

diff -puN include/asm-ia64/page.h~git-hdrcleanup-vs-git-klibc-on-ia64-2 include/asm-ia64/page.h

include/asm-ia64/page.h Mon May 15 01:49:38 2006 renamed from include/asm-ia64/page.h~git-hdrcleanup-vs-git-klibc-on-ia64-2 Mon May 15 01:48:22 2006 +4 -0
@@ -36,7 +36,11 @@
 #elif defined(CONFIG_IA64_PAGE_SIZE_64KB)
 # define PAGE_SHIFT    16
 #else
+#ifdef __KERNEL__
 # error Unsupported page size!
+#else
+#define PAGE_SHIFT     12
+#endif
 #endif
 
Quoted 4 lines

include/asm-ia64/page.h Mon May 15 01:49:38 2006 line 46

Quoted 1 line
include/asm-ia64/page.h Mon May 15 01:49:38 2006 renamed from include/asm-ia64/page.h~git-hdrcleanup-vs-git-klibc-on-ia64-2 Mon May 15 01:48:22 2006 +0 -0
 #define PAGE_SIZE              (__IA64_UL_CONST(1) << PAGE_SHIFT)

Hm, same applies here as to the last one. The __KERNEL__ ifdef applies to the whole crap around PAGE_SHIFT _and_ PAGE_SIZE, at least.

Userspace should be using getpagesize() anyway.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#2 lore raw
In reply to David Woodhouse
Quoted 2 lines · David Woodhouse

In the long term I think we want to drop page.h and elf.h from the list of files which are exported to userspace altogether.

elf.h shouldn't be exported to userspace at all. there's a separate incarnation of elf.h in userland, so anyone importing the kernel one is plain stupid.

similarly no one should be using page.h, there is nothing in there userspace should ever look at

#3 lore raw
In reply to David Woodhouse
Quoted 4 lines · Andreas Schwab
Quoted 2 lines

Hm, same applies here as to the last one. The __KERNEL__ ifdef applies to the whole crap around PAGE_SHIFT _and_ PAGE_SIZE, at least.

Userspace should be using getpagesize() anyway.

Yes. That's why I say all the PAGE_SIZE crap should be in #ifdef __KERNEL__.

I also suspect a lot of the _rest_ of that file shouldn't be visible either. What's in there that we actually _need_ to export?

Signature · 1 line
dwmw2
#4 lore raw
In reply to David Woodhouse
Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · David Woodhouse

In the long term I think we want to drop page.h and elf.h from the list of files which are exported to userspace altogether.

elf.h shouldn't be exported to userspace at all. there's a separate incarnation of elf.h in userland, so anyone importing the kernel one is plain stupid.

Keep in mind that userland isn't necessarily glibc. In particular, for klibc it would be a pain in the arse to have two largely identical copies of the same header file in the kernel tree.

Data duplication is NOT a good thing.

-hpa

#5 lore raw
In reply to David Woodhouse
Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · David Woodhouse

In the long term I think we want to drop page.h and elf.h from the list of files which are exported to userspace altogether.

elf.h shouldn't be exported to userspace at all. there's a separate incarnation of elf.h in userland, so anyone importing the kernel one is plain stupid.

Keep in mind that userland isn't necessarily glibc. In particular, for klibc it would be a pain in the arse to have two largely identical copies of the same header file in the kernel tree.

Data duplication is NOT a good thing.

-hpa

#6 lore raw
In reply to David Woodhouse
Quoted 3 lines · H. Peter Anvin

Keep in mind that userland isn't necessarily glibc. In particular, for klibc it would be a pain in the arse to have two largely identical copies of the same header file in the kernel tree.

You can still use the copy from the kernel tree even if we don't actually copy it out in 'make headers_install'.

But yes, this is one of the reasons I haven't touched elf.h (yet).

Signature · 1 line
dwmw2
#7 lore raw
In reply to David Woodhouse
Quoted 9 lines · David Woodhouse
Quoted 3 lines · H. Peter Anvin

Keep in mind that userland isn't necessarily glibc. In particular, for klibc it would be a pain in the arse to have two largely identical copies of the same header file in the kernel tree.

You can still use the copy from the kernel tree even if we don't actually copy it out in 'make headers_install'.

But yes, this is one of the reasons I haven't touched elf.h (yet).

I could, but that would defeat the purpose somewhat.

I believe "make headers_install" isn't "this is what userspace *has* to get from the kernel" (which is, after all, the null set -- people wrote C libraries for DOS for example), but "this is what the kernel provides to userspace." It's up to userspace to use it or not, depending on the suitability for any one particular userspace.

-hpa

#8 lore raw
In reply to David Woodhouse
Quoted 8 lines · H. Peter Anvin

I could, but that would defeat the purpose somewhat.

I believe "make headers_install" isn't "this is what userspace *has* to get from the kernel" (which is, after all, the null set -- people wrote C libraries for DOS for example), but "this is what the kernel provides to userspace." It's up to userspace to use it or not, depending on the suitability for any one particular userspace.

Yes, but we have to draw the line somewhere. Otherwise we just continue exporting crap like stomic.h and letting people shoot themselves in the foot. I'm inclined to agree with hch that elf.h and page.h fall on the same side of that line as atomic.h -- but since I know that merits some discussion, it's something I've deferred for now. Let's get the basic and obvious stuff done first and then we can argue about the remaining details.

Signature · 1 line
dwmw2
#9 lore raw
In reply to David Woodhouse
Quoted 9 lines · David Woodhouse

Yes, but we have to draw the line somewhere. Otherwise we just continue exporting crap like stomic.h and letting people shoot themselves in the foot. I'm inclined to agree with hch that elf.h and page.h fall on the same side of that line as atomic.h -- but since I know that merits some discussion, it's something I've deferred for now. Let's get the basic and obvious stuff done first and then we can argue about the remaining details.

page.h I agree with.

elf.h I don't.

page.h and atomic.h both have in common that on some architectures, the needs of userspace and the needs of the kernel are very different (what's atomic in kernel space isn't necessarily atomic in userspace.) Similar, PAGE_SIZE makes sense for the kernel, but not for userspace (it could vary.)

elf.h is different -- it describes an interface. As such, it *should* be the same on both sides of the universe.

-hpa

#10 lore raw
In reply to David Woodhouse
Quoted 2 lines · H. Peter Anvin

elf.h is different -- it describes an interface. As such, it *should* be the same on both sides of the universe.

Yes, maybe that's true. I'll buy the argument if the file is _clean_ :)

Signature · 1 line
dwmw2