kernel_optimize_test/arch
Jeremy Fitzhardinge 9ec2b804e0 xen: use iret directly when possible
Most of the time we can simply use the iret instruction to exit the
kernel, rather than having to use the iret hypercall - the only
exception is if we're returning into vm86 mode, or from delivering an
NMI (which we don't support yet).

When running native, iret has the behaviour of testing for a pending
interrupt atomically with re-enabling interrupts.  Unfortunately
there's no way to do this with Xen, so there's a window in which we
could get a recursive exception after enabling events but before
actually returning to userspace.

This causes a problem: if the nested interrupt causes one of the
task's TIF_WORK_MASK flags to be set, they will not be checked again
before returning to userspace.  This means that pending work may be
left pending indefinitely, until the process enters and leaves the
kernel again.  The net effect is that a pending signal or reschedule
event could be delayed for an unbounded amount of time.

To deal with this, the xen event upcall handler checks to see if the
EIP is within the critical section of the iret code, after events
are (potentially) enabled up to the iret itself.  If its within this
range, it calls the iret critical section fixup, which adjusts the
stack to deal with any unrestored registers, and then shifts the
stack frame up to replace the previous invocation.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
2007-07-18 08:47:46 -07:00
..
alpha missing exports of csum_... 2007-07-17 11:01:07 -07:00
arm csb337 supports "new style" rtc-ds1307 2007-07-17 10:23:09 -07:00
arm26 PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
avr32 PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
blackfin Blackfin arch: add missing CONFIG_LARGE_ALLOCS when upstream merging 2007-07-12 14:55:05 +08:00
cris PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
frv serial: add early_serial_setup() back to header file 2007-07-18 08:38:22 -07:00
h8300 PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
i386 xen: use iret directly when possible 2007-07-18 08:47:46 -07:00
ia64 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2007-07-17 11:31:57 -07:00
m32r PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
m68k missing exports of csum_... 2007-07-17 11:01:07 -07:00
m68knommu PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
mips serial: add early_serial_setup() back to header file 2007-07-18 08:38:22 -07:00
parisc kallsyms: make KSYM_NAME_LEN include space for trailing '\0' 2007-07-17 10:23:03 -07:00
powerpc Cell: Draw SPE helper penguin logos 2007-07-17 10:23:13 -07:00
ppc serial: add early_serial_setup() back to header file 2007-07-18 08:38:22 -07:00
s390 Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2007-07-17 15:29:33 -07:00
sh PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
sh64 missing exports of csum_... 2007-07-17 11:01:07 -07:00
sparc sparc32 has working dma-mapping only with CONFIG_PCI 2007-07-17 11:01:07 -07:00
sparc64 [SPARC64]: Kill bogus set_fs(KERNEL_DS) in do_rt_sigreturn(). 2007-07-17 14:37:54 -07:00
um um_kmalloc() remnants 2007-07-17 11:01:07 -07:00
v850 PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
x86_64 xen: use the hvc console infrastructure for Xen console 2007-07-18 08:47:44 -07:00
xtensa PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00