android_kernel_xiaomi_sm8350/arch/i386/kernel
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
..
acpi Remove some unused variables 2007-07-03 18:27:53 -07:00
cpu HOTPLUG: Adapt thermal throttle to CPU_DYING 2007-07-16 12:05:50 +03:00
.gitignore
alternative.c Revert "[PATCH] x86: __pa and __pa_symbol address space separation" 2007-05-07 08:44:24 -07:00
apic.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
apm.c Freezer: make kernel threads nonfreezable by default 2007-07-17 10:23:02 -07:00
asm-offsets.c xen: use iret directly when possible 2007-07-18 08:47:46 -07:00
bootflag.c
cpuid.c Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
crash_dump.c
crash.c move die notifier handling to common code 2007-05-08 11:15:04 -07:00
doublefault.c [PATCH] i386: i386 separate hardware-defined TSS from Linux additions 2007-05-02 19:27:13 +02:00
e820.c Make definitions for struct e820entry and struct e820map consistent 2007-07-12 10:55:54 -07:00
early_printk.c
efi_stub.S
efi.c arch/i386/* fs/* ipc/*: mark variables with uninitialized_var() 2007-07-17 16:23:19 -04:00
entry.S xen: use iret directly when possible 2007-07-18 08:47:46 -07:00
head.S xen: Core Xen implementation 2007-07-18 08:47:42 -07:00
hpet.c [PATCH] Add suspend/resume for HPET 2007-03-29 10:25:32 -07:00
i386_ksyms.c [PATCH] i386: Convert PDA into the percpu section 2007-05-02 19:27:16 +02:00
i387.c
i8237.c
i8253.c [VOYAGER] clockevents: correct boot cpu is zero assumption 2007-05-01 10:06:42 -05:00
i8259.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
init_task.c
io_apic.c Freezer: make kernel threads nonfreezable by default 2007-07-17 10:23:02 -07:00
ioport.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
irq.c [PATCH] i386: Convert PDA into the percpu section 2007-05-02 19:27:16 +02:00
kprobes.c Kprobes: The ON/OFF knob thru debugfs 2007-05-08 11:15:19 -07:00
ldt.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
legacy_serial.c x86, serial: convert legacy COM ports to platform devices 2007-05-08 11:15:23 -07:00
machine_kexec.c
Makefile i386: move common parts of smp into their own file 2007-05-15 08:54:00 -07:00
mca.c
microcode.c microcode: fix section mismatch warning 2007-06-01 08:18:30 -07:00
module.c
mpparse.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
msr.c Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
nmi.c i386: speedup touch_nmi_watchdog 2007-07-17 10:23:04 -07:00
numaq.c
paravirt.c Add a sched_clock paravirt_op 2007-07-18 08:47:42 -07:00
pci-dma.c x86: Disable DAC on VIA bridges 2007-06-20 14:27:25 -07:00
pcspeaker.c
process.c make seccomp zerocost in schedule 2007-07-16 09:05:50 -07:00
ptrace.c PTRACE_POKEDATA consolidation 2007-07-17 10:23:03 -07:00
quirks.c Clean up E7520/7320/7525 quirk printk. 2007-07-07 13:53:13 -07:00
reboot_fixups.c GEODE: reboot fixup for geode machines with CS5536 boards 2007-07-06 11:45:11 -07:00
reboot.c Work around Dell E520 BIOS reboot bug 2007-06-01 08:18:28 -07:00
relocate_kernel.S
scx200.c
setup.c paravirt: add a hook for once the allocator is ready 2007-07-18 08:47:41 -07:00
sigframe.h
signal.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
smp.c paravirt: unstatic leave_mm 2007-07-18 08:47:41 -07:00
smpboot.c paravirt: make siblingmap functions visible 2007-07-18 08:47:41 -07:00
smpcommon.c i386: Allow smp_call_function_single() to current cpu 2007-07-16 12:05:50 +03:00
srat.c
summit.c
sys_i386.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
syscall_table.S signal/timer/event: eventfd wire up x86 arches 2007-05-11 08:29:37 -07:00
sysenter.c [PATCH] i386: In compat mode, the return value here was uninitialized. 2007-05-02 19:27:16 +02:00
time.c [PATCH] i386: pit_latch_buggy has no effect 2007-05-02 19:27:05 +02:00
topology.c
trampoline.S [PATCH] i386: Rename boot_gdt_table to boot_gdt 2007-05-02 19:27:10 +02:00
traps.c Report that kernel is tainted if there was an OOPS 2007-07-17 10:23:02 -07:00
tsc_sync.c
tsc.c Add a sched_clock paravirt_op 2007-07-18 08:47:42 -07:00
vm86.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
vmi.c Add a sched_clock paravirt_op 2007-07-18 08:47:42 -07:00
vmiclock.c Add a sched_clock paravirt_op 2007-07-18 08:47:42 -07:00
vmlinux.lds.S xen: Core Xen implementation 2007-07-18 08:47:42 -07:00
vsyscall-int80.S
vsyscall-note.S Add nosegneg capability to the vsyscall page notes 2007-07-18 08:47:42 -07:00
vsyscall-sigreturn.S
vsyscall-sysenter.S
vsyscall.lds.S [PATCH] i386: VDSO_PRELINK warning fix 2007-05-02 19:27:09 +02:00
vsyscall.S