android_kernel_xiaomi_sm8350/arch
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
..
alpha [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
arm [ARM] Fix ARMv6 page table bits 2005-09-01 22:41:55 +01:00
arm26 [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
cris [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
frv [PATCH] frv: Remove export of strtok() 2005-09-05 00:06:01 -07:00
h8300 [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
i386 [PATCH] x86: make IOPL explicit 2005-09-05 00:06:12 -07:00
ia64 [IA64] uncached allocator: use generic (not sn2 specific) functions 2005-08-31 14:18:04 -07:00
m32r [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
m68k It wasn't just x86-64 that had hardcoded VM_FAULT_xxx numbers 2005-08-04 08:33:38 -07:00
m68knommu [PATCH] m68knommu: update defconfig for m68knommu 2005-09-02 00:57:30 -07:00
mips [PATCH] mips: fix build warnings 2005-09-05 00:06:08 -07:00
parisc [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
ppc [PATCH] ppc32: cpci690 updates 2005-09-05 00:06:01 -07:00
ppc64 [PATCH] ppc64: replace schedule_timeout() with msleep_interruptible() 2005-09-05 00:06:01 -07:00
s390 [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
sh [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
sh64 [PATCH] arch/sh64/Kconfig: doesn't need it's own LOG_BUF_SHIFT 2005-09-05 00:06:09 -07:00
sparc [SPARC]: remove use of asm/segment.h 2005-08-29 12:45:44 -07:00
sparc64 [SPARC64]: More fully work around Spitfire Errata 51. 2005-08-29 12:46:22 -07:00
um [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
v850 [PATCH] v850: Add show_mem 2005-09-02 00:57:31 -07:00
x86_64 [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
xtensa [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00