android_kernel_xiaomi_sm8350/arch/i386/kernel
Zachary Amsden a520112930 [PATCH] x86: make IOPL explicit
The pushf/popf in switch_to are ONLY used to switch IOPL.  Making this
explicit in C code is more clear.  This pushf/popf pair was added as a
bugfix for leaking IOPL to unprivileged processes when using
sysenter/sysexit based system calls (sysexit does not restore flags).

When requesting an IOPL change in sys_iopl(), it is just as easy to change
the current flags and the flags in the stack image (in case an IRET is
required), but there is no reason to force an IRET if we came in from the
SYSENTER path.

This change is the minimal solution for supporting a paravirtualized Linux
kernel that allows user processes to run with I/O privilege.  Other
solutions require radical rewrites of part of the low level fault / system
call handling code, or do not fully support sysenter based system calls.

Unfortunately, this added one field to the thread_struct.  But as a bonus,
on P4, the fastest time measured for switch_to() went from 312 to 260
cycles, a win of about 17% in the fast case through this performance
critical path.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-05 00:06:12 -07:00
..
acpi [PATCH] x86: sutomatically enable bigsmp when we have more than 8 CPUs 2005-09-05 00:06:10 -07:00
cpu [PATCH] x86: more asm cleanups 2005-09-05 00:06:12 -07:00
timers [PATCH] hpet: use read_timer_tsc only when CPU has TSC 2005-09-05 00:06:09 -07:00
apic.c [PATCH] x86: Remove obsolete get_cpu_vendor call 2005-08-18 12:53:59 -07:00
apm.c [PATCH] APM: Remove redundant call to set_cpus_allowed 2005-07-26 14:35:45 -07:00
asm-offsets.c
bootflag.c
cpuid.c
crash.c [PATCH] x86: more asm cleanups 2005-09-05 00:06:12 -07:00
dmi_scan.c
doublefault.c [PATCH] i386: inline assembler: cleanup and encapsulate descriptor and task register management 2005-09-05 00:06:11 -07:00
early_printk.c
efi_stub.S
efi.c [PATCH] i386: inline assembler: cleanup and encapsulate descriptor and task register management 2005-09-05 00:06:11 -07:00
entry.S
head.S [PATCH] kdump: Save parameter segment in protected mode (x86) 2005-09-05 00:06:09 -07:00
i386_ksyms.c
i387.c x86: make restore_fpu() use alternative assembler instructions 2005-07-22 16:06:16 -04:00
i8259.c
init_task.c
io_apic.c [PATCH] x86: i8253/i8259A lock cleanup 2005-06-30 08:45:10 -07:00
ioport.c [PATCH] x86: make IOPL explicit 2005-09-05 00:06:12 -07:00
irq.c
kprobes.c [PATCH] kprobes: fix namespace problem and sparc64 build 2005-07-05 19:19:00 -07:00
ldt.c
machine_kexec.c [PATCH] x86: more asm cleanups 2005-09-05 00:06:12 -07:00
Makefile
mca.c
microcode.c [PATCH] i386: cleanup serialize msr 2005-09-05 00:06:11 -07:00
module.c
mpparse.c [PATCH] x86: sutomatically enable bigsmp when we have more than 8 CPUs 2005-09-05 00:06:10 -07:00
msr.c [PATCH] x86: more asm cleanups 2005-09-05 00:06:12 -07:00
nmi.c [PATCH] Mobil Pentium 4 HT and the NMI 2005-08-19 18:44:56 -07:00
numaq.c [PATCH] re-disable TSC on NUMAQ 2005-07-28 21:46:05 -07:00
pci-dma.c
process.c [PATCH] x86: make IOPL explicit 2005-09-05 00:06:12 -07:00
ptrace.c
quirks.c
reboot_fixups.c
reboot.c [PATCH] i386: inline assembler: cleanup and encapsulate descriptor and task register management 2005-09-05 00:06:11 -07:00
relocate_kernel.S
scx200.c
semaphore.c
setup.c [PATCH] x86: sutomatically enable bigsmp when we have more than 8 CPUs 2005-09-05 00:06:10 -07:00
sigframe.h
signal.c [PATCH] x86: privilege cleanup 2005-09-05 00:06:12 -07:00
smp.c [PATCH] i386: inline asm cleanup 2005-09-05 00:06:11 -07:00
smpboot.c [PATCH] mostly_read data section 2005-07-07 18:23:46 -07:00
srat.c
summit.c
sys_i386.c
syscall_table.S [PATCH] remove sys_set_zone_reclaim() 2005-08-01 10:03:56 -07:00
sysenter.c
time_hpet.c
time.c [PATCH] mostly_read data section 2005-07-07 18:23:46 -07:00
trampoline.S
traps.c [PATCH] x86: privilege cleanup 2005-09-05 00:06:12 -07:00
vm86.c [PATCH] i386: inline assembler: cleanup and encapsulate descriptor and task register management 2005-09-05 00:06:11 -07:00
vmlinux.lds.S [PATCH] mostly_read data section 2005-07-07 18:23:46 -07:00
vsyscall-int80.S
vsyscall-note.S
vsyscall-sigreturn.S [PATCH] i386: clean up vDSO alignment padding 2005-09-05 00:06:10 -07:00
vsyscall-sysenter.S
vsyscall.lds.S
vsyscall.S