public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make sysenter support optional
@ 2005-12-28 21:24 Matt Mackall
       [not found] ` <a36005b50512281407x74415958tb0fa2b52f4dd7988@mail.gmail.com>
  2005-12-29  8:48 ` Ingo Molnar
  0 siblings, 2 replies; 9+ messages in thread
From: Matt Mackall @ 2005-12-28 21:24 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-tiny

This adds configurable sysenter support on x86. This saves about 5k on
small systems.

$ size vmlinux-baseline vmlinux
   text    data     bss     dec     hex filename
2920821  523232  190652 3634705  377611 vmlinux-baseline
2920558  518376  190652 3629586  376212 vmlinux

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: 2.6.15-misc/arch/i386/kernel/Makefile
===================================================================
--- 2.6.15-misc.orig/arch/i386/kernel/Makefile	2005-12-28 14:51:45.000000000 -0600
+++ 2.6.15-misc/arch/i386/kernel/Makefile	2005-12-28 14:51:46.000000000 -0600
@@ -31,7 +31,7 @@ obj-$(CONFIG_X86_NUMAQ)		+= numaq.o
 obj-$(CONFIG_X86_SUMMIT_NUMA)	+= summit.o
 obj-$(CONFIG_KPROBES)		+= kprobes.o
 obj-$(CONFIG_MODULES)		+= module.o
-obj-y				+= sysenter.o vsyscall.o
+obj-$(CONFIG_SYSENTER)		+= sysenter.o vsyscall.o
 obj-$(CONFIG_ACPI_SRAT) 	+= srat.o
 obj-$(CONFIG_HPET_TIMER) 	+= time_hpet.o
 obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
Index: 2.6.15-misc/include/asm-i386/elf.h
===================================================================
--- 2.6.15-misc.orig/include/asm-i386/elf.h	2005-12-28 14:36:59.000000000 -0600
+++ 2.6.15-misc/include/asm-i386/elf.h	2005-12-28 14:51:47.000000000 -0600
@@ -134,11 +134,13 @@ extern int dump_task_extended_fpu (struc
 #define VSYSCALL_ENTRY	((unsigned long) &__kernel_vsyscall)
 extern void __kernel_vsyscall;
 
+#ifdef CONFIG_SYSENTER
 #define ARCH_DLINFO						\
 do {								\
 		NEW_AUX_ENT(AT_SYSINFO,	VSYSCALL_ENTRY);	\
 		NEW_AUX_ENT(AT_SYSINFO_EHDR, VSYSCALL_BASE);	\
 } while (0)
+#endif
 
 /*
  * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
Index: 2.6.15-misc/init/Kconfig
===================================================================
--- 2.6.15-misc.orig/init/Kconfig	2005-12-28 14:51:45.000000000 -0600
+++ 2.6.15-misc/init/Kconfig	2005-12-28 14:51:47.000000000 -0600
@@ -352,6 +352,14 @@ config VM86
           XFree86 to initialize some video cards via BIOS. Disabling this
           option saves about 6k.
 
+config SYSENTER
+	depends X86
+	default y
+	bool "Enable syscalls via sysenter" if EMBEDDED
+	help
+	  Disabling this feature removes sysenter handling as well as
+	  vsyscall fixmaps.
+ 
 config CC_OPTIMIZE_FOR_SIZE
 	bool "Optimize for size"
 	default y if ARM || H8300
Index: 2.6.15-misc/include/asm-i386/processor.h
===================================================================
--- 2.6.15-misc.orig/include/asm-i386/processor.h	2005-12-28 14:51:44.000000000 -0600
+++ 2.6.15-misc/include/asm-i386/processor.h	2005-12-28 14:51:41.000000000 -0600
@@ -709,8 +709,14 @@ extern void select_idle_routine(const st
 #define cache_line_size() (boot_cpu_data.x86_cache_alignment)
 
 extern unsigned long boot_option_idle_override;
+
+#ifdef CONFIG_SYSENTER
 extern void enable_sep_cpu(void);
 extern int sysenter_setup(void);
+#else
+#define enable_sep_cpu()
+static inline int sysenter_setup(void) { return 0; }
+#endif
 
 #ifdef CONFIG_MTRR
 extern void mtrr_ap_init(void);

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Fwd: [PATCH] Make sysenter support optional
       [not found] ` <a36005b50512281407x74415958tb0fa2b52f4dd7988@mail.gmail.com>
@ 2005-12-28 22:13   ` Ulrich Drepper
  2005-12-29 19:56     ` Matt Mackall
  0 siblings, 1 reply; 9+ messages in thread
From: Ulrich Drepper @ 2005-12-28 22:13 UTC (permalink / raw)
  To: mpm, akpm; +Cc: linux-kernel, linux-tiny

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

> This adds configurable sysenter support on x86. This saves about 5k on
> small systems.

You not only remove the sysenter support but also the vdso.  And the
later is a very bad idea.  It is already today basically impossible to
have reliable backtraces without the vdso and the unwind info it
contains for signal handlers.  And things can only get worse in future.
 The magic heuristics in the compiler are not reliable.  It's simply the
wrong face, this in a interface between the kernel and the libc, the
compiler should not have such knowledge.

The vdso should be mandatory for all configurations.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Make sysenter support optional
  2005-12-28 21:24 [PATCH] Make sysenter support optional Matt Mackall
       [not found] ` <a36005b50512281407x74415958tb0fa2b52f4dd7988@mail.gmail.com>
@ 2005-12-29  8:48 ` Ingo Molnar
  2005-12-29 19:48   ` Matt Mackall
  1 sibling, 1 reply; 9+ messages in thread
From: Ingo Molnar @ 2005-12-29  8:48 UTC (permalink / raw)
  To: Matt Mackall; +Cc: Andrew Morton, linux-kernel, linux-tiny


* Matt Mackall <mpm@selenic.com> wrote:

> This adds configurable sysenter support on x86. This saves about 5k on 
> small systems.

note that this also turns off vsyscalls. Right now vsyscalls are mostly 
about sysenter support, but that's not fundamentally so. 4k of the 5k 
savings come from the turn-off-vsyscalls portion.

	Ingo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Make sysenter support optional
  2005-12-29  8:48 ` Ingo Molnar
@ 2005-12-29 19:48   ` Matt Mackall
  0 siblings, 0 replies; 9+ messages in thread
From: Matt Mackall @ 2005-12-29 19:48 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Andrew Morton, linux-kernel, linux-tiny

On Thu, Dec 29, 2005 at 09:48:58AM +0100, Ingo Molnar wrote:
> 
> * Matt Mackall <mpm@selenic.com> wrote:
> 
> > This adds configurable sysenter support on x86. This saves about 5k on 
> > small systems.
> 
> note that this also turns off vsyscalls. Right now vsyscalls are mostly 
> about sysenter support, but that's not fundamentally so. 4k of the 5k 
> savings come from the turn-off-vsyscalls portion.

Yes, this patch would more properly be CONFIG_VSYSCALL.

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Fwd: [PATCH] Make sysenter support optional
  2005-12-28 22:13   ` Fwd: " Ulrich Drepper
@ 2005-12-29 19:56     ` Matt Mackall
       [not found]       ` <a36005b50512291901l6a5acb77ha17d3552ea9c9fd9@mail.gmail.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Matt Mackall @ 2005-12-29 19:56 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: akpm, linux-kernel, linux-tiny

On Wed, Dec 28, 2005 at 02:13:45PM -0800, Ulrich Drepper wrote:
> > This adds configurable sysenter support on x86. This saves about 5k on
> > small systems.
> 
> You not only remove the sysenter support but also the vdso.  And the
> later is a very bad idea.  It is already today basically impossible to
> have reliable backtraces without the vdso and the unwind info it
> contains for signal handlers.  And things can only get worse in future.
>  The magic heuristics in the compiler are not reliable.  It's simply the
> wrong face, this in a interface between the kernel and the libc, the
> compiler should not have such knowledge.
> 
> The vdso should be mandatory for all configurations.

It's under CONFIG_EMBEDDED. Think uclibc. Think systems without
interactive shells.

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Make sysenter support optional
       [not found]       ` <a36005b50512291901l6a5acb77ha17d3552ea9c9fd9@mail.gmail.com>
@ 2005-12-30  3:04         ` Ulrich Drepper
  2005-12-30  3:38           ` Matt Mackall
  0 siblings, 1 reply; 9+ messages in thread
From: Ulrich Drepper @ 2005-12-30  3:04 UTC (permalink / raw)
  To: Matt Mackall; +Cc: akpm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

> It's under CONFIG_EMBEDDED. Think uclibc. Think systems without
> interactive shells.

Interactive or not has absolutely nothing to do with this.  And other
libcs have the same issues wrt to backtraces.  And finally, there is
unfortunately no way to prevent somebody from using glibc on an
"embedded" kernel and I have no interest in getting "bug reports" caused
by this kind of user error.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Make sysenter support optional
  2005-12-30  3:04         ` Ulrich Drepper
@ 2005-12-30  3:38           ` Matt Mackall
  2005-12-30  4:03             ` Ulrich Drepper
  0 siblings, 1 reply; 9+ messages in thread
From: Matt Mackall @ 2005-12-30  3:38 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: akpm, linux-kernel

On Thu, Dec 29, 2005 at 07:04:42PM -0800, Ulrich Drepper wrote:
> > It's under CONFIG_EMBEDDED. Think uclibc. Think systems without
> > interactive shells.
> 
> Interactive or not has absolutely nothing to do with this.

Ok, let me be explicit: think systems with absolutely no facility for
recording or displaying a backtrace.

> And other
> libcs have the same issues wrt to backtraces.

As far as I'm aware, uclibc has no vdso support, so it might as well
not exist for systems using it.

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Make sysenter support optional
  2005-12-30  3:38           ` Matt Mackall
@ 2005-12-30  4:03             ` Ulrich Drepper
  2005-12-30 11:20               ` Bernd Petrovitsch
  0 siblings, 1 reply; 9+ messages in thread
From: Ulrich Drepper @ 2005-12-30  4:03 UTC (permalink / raw)
  To: Matt Mackall; +Cc: akpm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

Matt Mackall wrote:
> Ok, let me be explicit: think systems with absolutely no facility for
> recording or displaying a backtrace.

You don't know much about unwinding, do you?  The same information is
needed for C++ exception handling, thread cancellation, etc.  Now go on
and tell me you don't need this either.


> As far as I'm aware, uclibc has no vdso support, so it might as well
> not exist for systems using it.

And I told you that the support which magically makes all this sometimes
work without the unwind info in the vdso will sooner or later break.
Then whatever other libc is out there has to get vdso support to be able
to function correctly.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Make sysenter support optional
  2005-12-30  4:03             ` Ulrich Drepper
@ 2005-12-30 11:20               ` Bernd Petrovitsch
  0 siblings, 0 replies; 9+ messages in thread
From: Bernd Petrovitsch @ 2005-12-30 11:20 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Matt Mackall, akpm, linux-kernel

On Thu, 2005-12-29 at 20:03 -0800, Ulrich Drepper wrote:
> Matt Mackall wrote:
> > Ok, let me be explicit: think systems with absolutely no facility for
> > recording or displaying a backtrace.
> 
> You don't know much about unwinding, do you?  The same information is
> needed for C++ exception handling, thread cancellation, etc.  Now go on
> and tell me you don't need this either.

On (presumbly small) embedded devices?
Please be serious.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-12-30 11:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-28 21:24 [PATCH] Make sysenter support optional Matt Mackall
     [not found] ` <a36005b50512281407x74415958tb0fa2b52f4dd7988@mail.gmail.com>
2005-12-28 22:13   ` Fwd: " Ulrich Drepper
2005-12-29 19:56     ` Matt Mackall
     [not found]       ` <a36005b50512291901l6a5acb77ha17d3552ea9c9fd9@mail.gmail.com>
2005-12-30  3:04         ` Ulrich Drepper
2005-12-30  3:38           ` Matt Mackall
2005-12-30  4:03             ` Ulrich Drepper
2005-12-30 11:20               ` Bernd Petrovitsch
2005-12-29  8:48 ` Ingo Molnar
2005-12-29 19:48   ` Matt Mackall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox