2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
2012-10-08 03:27:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-18 20:08:19 +01:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:29 -07:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:29 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:29 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
2007-05-06 14:51:29 -07:00
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-06-05 22:46:13 -07:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:56 -08:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2014-07-20 12:56:34 +02:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2007-12-17 16:19:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-20 12:56:34 +02:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-23 21:28:49 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uml: fix FP register corruption
Commit ee3d9bd4de1ed93d2a7ee41c331ed30a1c7b8acd ("uml: simplify SIGSEGV
handling"), while greatly simplifying the kernel SIGSEGV handler that
runs in the process address space, introduced a bug which corrupts FP
state in the process.
Previously, the SIGSEGV handler called the sigreturn system call by hand - it
couldn't return through the restorer provided to it because that could try to
call the libc restorer which likely wouldn't exist in the process address
space. So, it blocked off some signals, including SIGUSR1, on entry to the
SIGSEGV handler, queued a SIGUSR1 to itself, and invoked sigreturn. The
SIGUSR1 was delivered, and was visible to the UML kernel after sigreturn
finished.
The commit eliminated the signal masking and the call to sigreturn. The
handler simply hits itself with a SIGTRAP to let the UML kernel know that it
is finished. UML then restores the process registers, which effectively
longjmps the process out of the signal handler, skipping sigreturn's restoring
of register state and the signal mask.
The bug is that the host apparently sets used_fp to 0 when it saves the
process FP state in the sigcontext on the process signal stack. Thus, when
the process is longjmped out of the handler, its FP state is corrupt because
it wasn't saved on the context switch to the UML kernel.
This manifested itself as sleep hanging. For some reason, sleep uses floating
point in order to calculate the sleep interval. When a page fault corrupts
its FP state, it is faked into essentially sleeping forever.
This patch saves the FP state before entering the SIGSEGV handler and restores
it afterwards.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23 15:23:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uml: fix FP register corruption
Commit ee3d9bd4de1ed93d2a7ee41c331ed30a1c7b8acd ("uml: simplify SIGSEGV
handling"), while greatly simplifying the kernel SIGSEGV handler that
runs in the process address space, introduced a bug which corrupts FP
state in the process.
Previously, the SIGSEGV handler called the sigreturn system call by hand - it
couldn't return through the restorer provided to it because that could try to
call the libc restorer which likely wouldn't exist in the process address
space. So, it blocked off some signals, including SIGUSR1, on entry to the
SIGSEGV handler, queued a SIGUSR1 to itself, and invoked sigreturn. The
SIGUSR1 was delivered, and was visible to the UML kernel after sigreturn
finished.
The commit eliminated the signal masking and the call to sigreturn. The
handler simply hits itself with a SIGTRAP to let the UML kernel know that it
is finished. UML then restores the process registers, which effectively
longjmps the process out of the signal handler, skipping sigreturn's restoring
of register state and the signal mask.
The bug is that the host apparently sets used_fp to 0 when it saves the
process FP state in the sigcontext on the process signal stack. Thus, when
the process is longjmped out of the handler, its FP state is corrupt because
it wasn't saved on the context switch to the UML kernel.
This manifested itself as sleep hanging. For some reason, sleep uses floating
point in order to calculate the sleep interval. When a page fault corrupts
its FP state, it is faked into essentially sleeping forever.
This patch saves the FP state before entering the SIGSEGV handler and restores
it afterwards.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23 15:23:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:26:58 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:26:58 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:31:12 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:07 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-18 20:12:19 +01:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2007-12-17 16:19:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-09-25 23:33:05 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:35 -07:00
|
|
|
|
2008-02-04 22:30:56 -08:00
|
|
|
|
2007-10-16 01:27:22 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:48 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-01-18 17:42:48 -08:00
|
|
|
|
uml: fix stub address calculations
The calculation of CONFIG_STUB_CODE and CONFIG_STUB_DATA didn't take into
account anything but 3G/1G and 2G/2G, leaving the other vmsplits out in the
cold.
I'd rather not duplicate the four known host vmsplit cases for each of these
symbols. I'd also like to calculate them based on the highest userspace
address.
The Kconfig language seems not to allow calculation of hex constants, so I
moved this to as-layout.h. CONFIG_STUB_CODE, CONFIG_STUB_DATA, and
CONFIG_STUB_START are now gone. In their place are STUB_CODE, STUB_DATA, and
STUB_START in as-layout.h.
i386 and x86_64 seem to differ as to whether an unadorned constant is an int
or a long, so I cast them to unsigned long so they can be printed
consistently. However, they are also used in stub.S, where C types don't work
so well. So, there are ASM_ versions of these constants for use in stub.S. I
also ifdef-ed the non-asm-friendly portion of as-layout.h.
With this in place, most of the rest of this patch is changing CONFIG_STUB_*
to STUB_*, except in stub.S, where they are changed to ASM_STUB_*.
defconfig has the old symbols deleted.
I also print these addresses out in case there is any problem mapping them on
the host.
The two stub.S files had some trailing whitespace, so that is cleaned up here.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 01:27:33 -07:00
|
|
|
|
2006-01-18 17:42:48 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
uml: fix stub address calculations
The calculation of CONFIG_STUB_CODE and CONFIG_STUB_DATA didn't take into
account anything but 3G/1G and 2G/2G, leaving the other vmsplits out in the
cold.
I'd rather not duplicate the four known host vmsplit cases for each of these
symbols. I'd also like to calculate them based on the highest userspace
address.
The Kconfig language seems not to allow calculation of hex constants, so I
moved this to as-layout.h. CONFIG_STUB_CODE, CONFIG_STUB_DATA, and
CONFIG_STUB_START are now gone. In their place are STUB_CODE, STUB_DATA, and
STUB_START in as-layout.h.
i386 and x86_64 seem to differ as to whether an unadorned constant is an int
or a long, so I cast them to unsigned long so they can be printed
consistently. However, they are also used in stub.S, where C types don't work
so well. So, there are ASM_ versions of these constants for use in stub.S. I
also ifdef-ed the non-asm-friendly portion of as-layout.h.
With this in place, most of the rest of this patch is changing CONFIG_STUB_*
to STUB_*, except in stub.S, where they are changed to ASM_STUB_*.
defconfig has the old symbols deleted.
I also print these addresses out in case there is any problem mapping them on
the host.
The two stub.S files had some trailing whitespace, so that is cleaned up here.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 01:27:33 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
uml: fix stub address calculations
The calculation of CONFIG_STUB_CODE and CONFIG_STUB_DATA didn't take into
account anything but 3G/1G and 2G/2G, leaving the other vmsplits out in the
cold.
I'd rather not duplicate the four known host vmsplit cases for each of these
symbols. I'd also like to calculate them based on the highest userspace
address.
The Kconfig language seems not to allow calculation of hex constants, so I
moved this to as-layout.h. CONFIG_STUB_CODE, CONFIG_STUB_DATA, and
CONFIG_STUB_START are now gone. In their place are STUB_CODE, STUB_DATA, and
STUB_START in as-layout.h.
i386 and x86_64 seem to differ as to whether an unadorned constant is an int
or a long, so I cast them to unsigned long so they can be printed
consistently. However, they are also used in stub.S, where C types don't work
so well. So, there are ASM_ versions of these constants for use in stub.S. I
also ifdef-ed the non-asm-friendly portion of as-layout.h.
With this in place, most of the rest of this patch is changing CONFIG_STUB_*
to STUB_*, except in stub.S, where they are changed to ASM_STUB_*.
defconfig has the old symbols deleted.
I also print these addresses out in case there is any problem mapping them on
the host.
The two stub.S files had some trailing whitespace, so that is cleaned up here.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 01:27:33 -07:00
|
|
|
|
2007-05-06 14:51:22 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
uml: fix stub address calculations
The calculation of CONFIG_STUB_CODE and CONFIG_STUB_DATA didn't take into
account anything but 3G/1G and 2G/2G, leaving the other vmsplits out in the
cold.
I'd rather not duplicate the four known host vmsplit cases for each of these
symbols. I'd also like to calculate them based on the highest userspace
address.
The Kconfig language seems not to allow calculation of hex constants, so I
moved this to as-layout.h. CONFIG_STUB_CODE, CONFIG_STUB_DATA, and
CONFIG_STUB_START are now gone. In their place are STUB_CODE, STUB_DATA, and
STUB_START in as-layout.h.
i386 and x86_64 seem to differ as to whether an unadorned constant is an int
or a long, so I cast them to unsigned long so they can be printed
consistently. However, they are also used in stub.S, where C types don't work
so well. So, there are ASM_ versions of these constants for use in stub.S. I
also ifdef-ed the non-asm-friendly portion of as-layout.h.
With this in place, most of the rest of this patch is changing CONFIG_STUB_*
to STUB_*, except in stub.S, where they are changed to ASM_STUB_*.
defconfig has the old symbols deleted.
I also print these addresses out in case there is any problem mapping them on
the host.
The two stub.S files had some trailing whitespace, so that is cleaned up here.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 01:27:33 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-09-25 23:33:04 -07:00
|
|
|
|
|
|
|
|
|
uml: fix stub address calculations
The calculation of CONFIG_STUB_CODE and CONFIG_STUB_DATA didn't take into
account anything but 3G/1G and 2G/2G, leaving the other vmsplits out in the
cold.
I'd rather not duplicate the four known host vmsplit cases for each of these
symbols. I'd also like to calculate them based on the highest userspace
address.
The Kconfig language seems not to allow calculation of hex constants, so I
moved this to as-layout.h. CONFIG_STUB_CODE, CONFIG_STUB_DATA, and
CONFIG_STUB_START are now gone. In their place are STUB_CODE, STUB_DATA, and
STUB_START in as-layout.h.
i386 and x86_64 seem to differ as to whether an unadorned constant is an int
or a long, so I cast them to unsigned long so they can be printed
consistently. However, they are also used in stub.S, where C types don't work
so well. So, there are ASM_ versions of these constants for use in stub.S. I
also ifdef-ed the non-asm-friendly portion of as-layout.h.
With this in place, most of the rest of this patch is changing CONFIG_STUB_*
to STUB_*, except in stub.S, where they are changed to ASM_STUB_*.
defconfig has the old symbols deleted.
I also print these addresses out in case there is any problem mapping them on
the host.
The two stub.S files had some trailing whitespace, so that is cleaned up here.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 01:27:33 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uml: fix stub address calculations
The calculation of CONFIG_STUB_CODE and CONFIG_STUB_DATA didn't take into
account anything but 3G/1G and 2G/2G, leaving the other vmsplits out in the
cold.
I'd rather not duplicate the four known host vmsplit cases for each of these
symbols. I'd also like to calculate them based on the highest userspace
address.
The Kconfig language seems not to allow calculation of hex constants, so I
moved this to as-layout.h. CONFIG_STUB_CODE, CONFIG_STUB_DATA, and
CONFIG_STUB_START are now gone. In their place are STUB_CODE, STUB_DATA, and
STUB_START in as-layout.h.
i386 and x86_64 seem to differ as to whether an unadorned constant is an int
or a long, so I cast them to unsigned long so they can be printed
consistently. However, they are also used in stub.S, where C types don't work
so well. So, there are ASM_ versions of these constants for use in stub.S. I
also ifdef-ed the non-asm-friendly portion of as-layout.h.
With this in place, most of the rest of this patch is changing CONFIG_STUB_*
to STUB_*, except in stub.S, where they are changed to ASM_STUB_*.
defconfig has the old symbols deleted.
I also print these addresses out in case there is any problem mapping them on
the host.
The two stub.S files had some trailing whitespace, so that is cleaned up here.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 01:27:33 -07:00
|
|
|
|
2006-09-25 23:33:04 -07:00
|
|
|
|
2011-08-18 20:04:09 +01:00
|
|
|
|
|
|
|
|
|
2006-09-25 23:33:04 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:11 -07:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-06-16 10:16:09 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:31:21 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-06-16 10:16:09 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-12-17 16:19:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
2007-12-17 16:19:46 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:31:21 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-12-17 16:19:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:31:21 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:31:21 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:26:58 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:25 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-05-10 22:22:32 -07:00
|
|
|
|
|
|
|
|
|
2012-08-02 00:49:17 +02:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2012-05-23 00:25:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:25 -07:00
|
|
|
|
2008-02-08 04:22:08 -08:00
|
|
|
|
2007-10-16 01:27:28 -07:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:25 -07:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:57 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2011-09-14 16:21:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-10 22:22:32 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-12-17 16:19:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:26:58 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:57 -08:00
|
|
|
|
2011-09-14 16:21:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2012-08-02 00:49:17 +02:00
|
|
|
|
2013-07-19 11:31:36 +02:00
|
|
|
|
2012-08-02 00:49:17 +02:00
|
|
|
|
2008-02-08 04:22:08 -08:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-19 11:31:36 +02:00
|
|
|
|
2012-08-02 00:49:17 +02:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-19 11:31:36 +02:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:25 -07:00
|
|
|
|
2008-02-04 22:30:57 -08:00
|
|
|
|
2007-10-16 01:27:25 -07:00
|
|
|
|
|
|
|
|
|
2013-07-19 11:31:36 +02:00
|
|
|
|
2007-10-16 01:27:25 -07:00
|
|
|
|
2007-10-16 01:27:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2013-07-19 11:31:36 +02:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2008-05-12 14:01:48 -07:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2007-10-16 01:27:07 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2011-09-14 16:21:23 -07:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-14 16:21:23 -07:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
uml: fix stub address calculations
The calculation of CONFIG_STUB_CODE and CONFIG_STUB_DATA didn't take into
account anything but 3G/1G and 2G/2G, leaving the other vmsplits out in the
cold.
I'd rather not duplicate the four known host vmsplit cases for each of these
symbols. I'd also like to calculate them based on the highest userspace
address.
The Kconfig language seems not to allow calculation of hex constants, so I
moved this to as-layout.h. CONFIG_STUB_CODE, CONFIG_STUB_DATA, and
CONFIG_STUB_START are now gone. In their place are STUB_CODE, STUB_DATA, and
STUB_START in as-layout.h.
i386 and x86_64 seem to differ as to whether an unadorned constant is an int
or a long, so I cast them to unsigned long so they can be printed
consistently. However, they are also used in stub.S, where C types don't work
so well. So, there are ASM_ versions of these constants for use in stub.S. I
also ifdef-ed the non-asm-friendly portion of as-layout.h.
With this in place, most of the rest of this patch is changing CONFIG_STUB_*
to STUB_*, except in stub.S, where they are changed to ASM_STUB_*.
defconfig has the old symbols deleted.
I also print these addresses out in case there is any problem mapping them on
the host.
The two stub.S files had some trailing whitespace, so that is cleaned up here.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 01:27:33 -07:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
|
|
|
|
|
uml: fix stub address calculations
The calculation of CONFIG_STUB_CODE and CONFIG_STUB_DATA didn't take into
account anything but 3G/1G and 2G/2G, leaving the other vmsplits out in the
cold.
I'd rather not duplicate the four known host vmsplit cases for each of these
symbols. I'd also like to calculate them based on the highest userspace
address.
The Kconfig language seems not to allow calculation of hex constants, so I
moved this to as-layout.h. CONFIG_STUB_CODE, CONFIG_STUB_DATA, and
CONFIG_STUB_START are now gone. In their place are STUB_CODE, STUB_DATA, and
STUB_START in as-layout.h.
i386 and x86_64 seem to differ as to whether an unadorned constant is an int
or a long, so I cast them to unsigned long so they can be printed
consistently. However, they are also used in stub.S, where C types don't work
so well. So, there are ASM_ versions of these constants for use in stub.S. I
also ifdef-ed the non-asm-friendly portion of as-layout.h.
With this in place, most of the rest of this patch is changing CONFIG_STUB_*
to STUB_*, except in stub.S, where they are changed to ASM_STUB_*.
defconfig has the old symbols deleted.
I also print these addresses out in case there is any problem mapping them on
the host.
The two stub.S files had some trailing whitespace, so that is cleaned up here.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 01:27:33 -07:00
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:28 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:05 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2011-09-14 16:21:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:48 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:33 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:05 -07:00
|
|
|
|
2006-01-18 17:42:48 -08:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-06-16 10:16:09 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:48 -08:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-05-06 14:51:35 -07:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2007-05-06 14:51:35 -07:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-06 01:42:19 -08:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2007-10-16 01:27:05 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-06-16 10:16:09 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:35 -07:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
[PATCH] uml: thread creation tidying
fork on UML has always somewhat subtle. The underlying cause has been the
need to initialize a stack for the new process. The only portable way to
initialize a new stack is to set it as the alternate signal stack and take a
signal. The signal handler does whatever initialization is needed and jumps
back to the original stack, where the fork processing is finished. The basic
context switching mechanism is a jmp_buf for each process. You switch to a
new process by longjmping to its jmp_buf.
Now that UML has its own implementation of setjmp and longjmp, and I can poke
around inside a jmp_buf without fear that libc will change the structure, a
much simpler mechanism is possible. The jmpbuf can simply be initialized by
hand.
This eliminates -
the need to set up and remove the alternate signal stack
sending and handling a signal
the signal blocking needed around the stack switching, since
there is no stack switching
setting up the jmp_buf needed to jump back to the original
stack after the new one is set up
In addition, since jmp_buf is now defined by UML, and not by libc, it can be
embedded in the thread struct. This makes it unnecessary to have it exist on
the stack, where it used to be. It also simplifies interfaces, since the
switch jmp_buf used to be a void * inside the thread struct, and functions
which took it as an argument needed to define a jmp_buf variable and assign it
from the void *.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 01:50:40 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
[PATCH] uml: thread creation tidying
fork on UML has always somewhat subtle. The underlying cause has been the
need to initialize a stack for the new process. The only portable way to
initialize a new stack is to set it as the alternate signal stack and take a
signal. The signal handler does whatever initialization is needed and jumps
back to the original stack, where the fork processing is finished. The basic
context switching mechanism is a jmp_buf for each process. You switch to a
new process by longjmping to its jmp_buf.
Now that UML has its own implementation of setjmp and longjmp, and I can poke
around inside a jmp_buf without fear that libc will change the structure, a
much simpler mechanism is possible. The jmpbuf can simply be initialized by
hand.
This eliminates -
the need to set up and remove the alternate signal stack
sending and handling a signal
the signal blocking needed around the stack switching, since
there is no stack switching
setting up the jmp_buf needed to jump back to the original
stack after the new one is set up
In addition, since jmp_buf is now defined by UML, and not by libc, it can be
embedded in the thread struct. This makes it unnecessary to have it exist on
the stack, where it used to be. It also simplifies interfaces, since the
switch jmp_buf used to be a void * inside the thread struct, and functions
which took it as an argument needed to define a jmp_buf variable and assign it
from the void *.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 01:50:40 -07:00
|
|
|
|
2007-05-10 22:22:31 -07:00
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2006-02-07 12:58:43 -08:00
|
|
|
|
[PATCH] uml: thread creation tidying
fork on UML has always somewhat subtle. The underlying cause has been the
need to initialize a stack for the new process. The only portable way to
initialize a new stack is to set it as the alternate signal stack and take a
signal. The signal handler does whatever initialization is needed and jumps
back to the original stack, where the fork processing is finished. The basic
context switching mechanism is a jmp_buf for each process. You switch to a
new process by longjmping to its jmp_buf.
Now that UML has its own implementation of setjmp and longjmp, and I can poke
around inside a jmp_buf without fear that libc will change the structure, a
much simpler mechanism is possible. The jmpbuf can simply be initialized by
hand.
This eliminates -
the need to set up and remove the alternate signal stack
sending and handling a signal
the signal blocking needed around the stack switching, since
there is no stack switching
setting up the jmp_buf needed to jump back to the original
stack after the new one is set up
In addition, since jmp_buf is now defined by UML, and not by libc, it can be
embedded in the thread struct. This makes it unnecessary to have it exist on
the stack, where it used to be. It also simplifies interfaces, since the
switch jmp_buf used to be a void * inside the thread struct, and functions
which took it as an argument needed to define a jmp_buf variable and assign it
from the void *.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 01:50:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-02-07 12:58:43 -08:00
|
|
|
|
[PATCH] uml: thread creation tidying
fork on UML has always somewhat subtle. The underlying cause has been the
need to initialize a stack for the new process. The only portable way to
initialize a new stack is to set it as the alternate signal stack and take a
signal. The signal handler does whatever initialization is needed and jumps
back to the original stack, where the fork processing is finished. The basic
context switching mechanism is a jmp_buf for each process. You switch to a
new process by longjmping to its jmp_buf.
Now that UML has its own implementation of setjmp and longjmp, and I can poke
around inside a jmp_buf without fear that libc will change the structure, a
much simpler mechanism is possible. The jmpbuf can simply be initialized by
hand.
This eliminates -
the need to set up and remove the alternate signal stack
sending and handling a signal
the signal blocking needed around the stack switching, since
there is no stack switching
setting up the jmp_buf needed to jump back to the original
stack after the new one is set up
In addition, since jmp_buf is now defined by UML, and not by libc, it can be
embedded in the thread struct. This makes it unnecessary to have it exist on
the stack, where it used to be. It also simplifies interfaces, since the
switch jmp_buf used to be a void * inside the thread struct, and functions
which took it as an argument needed to define a jmp_buf variable and assign it
from the void *.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 01:50:40 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
[PATCH] uml: thread creation tidying
fork on UML has always somewhat subtle. The underlying cause has been the
need to initialize a stack for the new process. The only portable way to
initialize a new stack is to set it as the alternate signal stack and take a
signal. The signal handler does whatever initialization is needed and jumps
back to the original stack, where the fork processing is finished. The basic
context switching mechanism is a jmp_buf for each process. You switch to a
new process by longjmping to its jmp_buf.
Now that UML has its own implementation of setjmp and longjmp, and I can poke
around inside a jmp_buf without fear that libc will change the structure, a
much simpler mechanism is possible. The jmpbuf can simply be initialized by
hand.
This eliminates -
the need to set up and remove the alternate signal stack
sending and handling a signal
the signal blocking needed around the stack switching, since
there is no stack switching
setting up the jmp_buf needed to jump back to the original
stack after the new one is set up
In addition, since jmp_buf is now defined by UML, and not by libc, it can be
embedded in the thread struct. This makes it unnecessary to have it exist on
the stack, where it used to be. It also simplifies interfaces, since the
switch jmp_buf used to be a void * inside the thread struct, and functions
which took it as an argument needed to define a jmp_buf variable and assign it
from the void *.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 01:50:40 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2006-04-18 22:21:41 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-04-18 22:21:41 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
[PATCH] uml: thread creation tidying
fork on UML has always somewhat subtle. The underlying cause has been the
need to initialize a stack for the new process. The only portable way to
initialize a new stack is to set it as the alternate signal stack and take a
signal. The signal handler does whatever initialization is needed and jumps
back to the original stack, where the fork processing is finished. The basic
context switching mechanism is a jmp_buf for each process. You switch to a
new process by longjmping to its jmp_buf.
Now that UML has its own implementation of setjmp and longjmp, and I can poke
around inside a jmp_buf without fear that libc will change the structure, a
much simpler mechanism is possible. The jmpbuf can simply be initialized by
hand.
This eliminates -
the need to set up and remove the alternate signal stack
sending and handling a signal
the signal blocking needed around the stack switching, since
there is no stack switching
setting up the jmp_buf needed to jump back to the original
stack after the new one is set up
In addition, since jmp_buf is now defined by UML, and not by libc, it can be
embedded in the thread struct. This makes it unnecessary to have it exist on
the stack, where it used to be. It also simplifies interfaces, since the
switch jmp_buf used to be a void * inside the thread struct, and functions
which took it as an argument needed to define a jmp_buf variable and assign it
from the void *.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 01:50:40 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2006-07-14 00:24:02 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2011-08-18 20:04:39 +01:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-05-06 14:51:40 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 04:22:08 -08:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
[PATCH] uml: thread creation tidying
fork on UML has always somewhat subtle. The underlying cause has been the
need to initialize a stack for the new process. The only portable way to
initialize a new stack is to set it as the alternate signal stack and take a
signal. The signal handler does whatever initialization is needed and jumps
back to the original stack, where the fork processing is finished. The basic
context switching mechanism is a jmp_buf for each process. You switch to a
new process by longjmping to its jmp_buf.
Now that UML has its own implementation of setjmp and longjmp, and I can poke
around inside a jmp_buf without fear that libc will change the structure, a
much simpler mechanism is possible. The jmpbuf can simply be initialized by
hand.
This eliminates -
the need to set up and remove the alternate signal stack
sending and handling a signal
the signal blocking needed around the stack switching, since
there is no stack switching
setting up the jmp_buf needed to jump back to the original
stack after the new one is set up
In addition, since jmp_buf is now defined by UML, and not by libc, it can be
embedded in the thread struct. This makes it unnecessary to have it exist on
the stack, where it used to be. It also simplifies interfaces, since the
switch jmp_buf used to be a void * inside the thread struct, and functions
which took it as an argument needed to define a jmp_buf variable and assign it
from the void *.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 01:50:40 -07:00
|
|
|
|
|
|
|
|
|
2007-05-10 22:22:31 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-06 14:51:40 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
2007-05-06 14:51:40 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-04-18 22:21:41 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-04-18 22:21:41 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-04-18 22:21:41 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-04-18 22:21:41 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:26:58 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:26:58 -07:00
|
|
|
|
2007-10-16 01:27:00 -07:00
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
2008-02-04 22:30:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-18 17:42:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|