diff options
author | Roland McGrath <roland@redhat.com> | 2007-07-20 00:31:43 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-20 08:44:19 -0700 |
commit | d2eea68e7db759ce67807b42b7407236cccfde71 (patch) | |
tree | 41521fcbce645a492c83e45b4b73be829a4cc8b1 /arch/i386/xen | |
parent | 5ac12c6fe1b5fbda0d0caedb8214cde545a5737c (diff) | |
download | op-kernel-dev-d2eea68e7db759ce67807b42b7407236cccfde71.zip op-kernel-dev-d2eea68e7db759ce67807b42b7407236cccfde71.tar.gz |
xen: disable vdso "nosegneg" on native boot
One of the nice ideas behind paravirt is that CONFIG_XEN=y can be included
in a standard configuration and be no worse for native booting than as a
Xen guest. The glibc feature that supports the vDSO "nosegneg" note is
designed specifically to make this easy. You just have to flip one bit at
boot time. This patch makes Xen flip the bit, so a CONFIG_XEN=y kernel on
bare hardware does not make glibc use the less-optimized library builds.
Signed-off-by: Roland McGrath <roland@redhat.com>
Acked-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/i386/xen')
-rw-r--r-- | arch/i386/xen/setup.c | 15 | ||||
-rw-r--r-- | arch/i386/xen/vdso.h | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/arch/i386/xen/setup.c b/arch/i386/xen/setup.c index 2fe6eac..f84e772 100644 --- a/arch/i386/xen/setup.c +++ b/arch/i386/xen/setup.c @@ -19,6 +19,7 @@ #include <xen/features.h> #include "xen-ops.h" +#include "vdso.h" /* These are code, but not functions. Defined in entry.S */ extern const char xen_hypervisor_callback[]; @@ -55,6 +56,18 @@ static void xen_idle(void) } } +/* + * Set the bit indicating "nosegneg" library variants should be used. + */ +static void fiddle_vdso(void) +{ + extern u32 VDSO_NOTE_MASK; /* See ../kernel/vsyscall-note.S. */ + extern char vsyscall_int80_start; + u32 *mask = (u32 *) ((unsigned long) &VDSO_NOTE_MASK - VDSO_PRELINK + + &vsyscall_int80_start); + *mask |= 1 << VDSO_NOTE_NONEGSEG_BIT; +} + void __init xen_arch_setup(void) { struct physdev_set_iopl set_iopl; @@ -93,4 +106,6 @@ void __init xen_arch_setup(void) #endif paravirt_disable_iospace(); + + fiddle_vdso(); } diff --git a/arch/i386/xen/vdso.h b/arch/i386/xen/vdso.h new file mode 100644 index 0000000..861fedf --- /dev/null +++ b/arch/i386/xen/vdso.h @@ -0,0 +1,4 @@ +/* Bit used for the pseudo-hwcap for non-negative segments. We use + bit 1 to avoid bugs in some versions of glibc when bit 0 is + used; the choice is otherwise arbitrary. */ +#define VDSO_NOTE_NONEGSEG_BIT 1 |