linux-stable/arch/i386/kernel
Rusty Russell 78be3706b2 [PATCH] i386: Allow a kernel not to be in ring 0
We allow for the fact that the guest kernel may not run in ring 0.  This
requires some abstraction in a few places when setting %cs or checking
privilege level (user vs kernel).

This is Chris' [RFC PATCH 15/33] move segment checks to subarch, except rather
than using #define USER_MODE_MASK which depends on a config option, we use
Zach's more flexible approach of assuming ring 3 == userspace.  I also used
"get_kernel_rpl()" over "get_kernel_cs()" because I think it reads better in
the code...

1) Remove the hardcoded 3 and introduce #define SEGMENT_RPL_MASK 3 2) Add a
get_kernel_rpl() macro, and don't assume it's zero.

And:

Clean up of patch for letting kernel run other than ring 0:

a. Add some comments about the SEGMENT_IS_*_CODE() macros.
b. Add a USER_RPL macro.  (Code was comparing a value to a mask
   in some places and to the magic number 3 in other places.)
c. Add macros for table indicator field and use them.
d. Change the entry.S tests for LDT stack segment to use the macros

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Andi Kleen <ak@suse.de>
2006-09-26 10:52:39 +02:00
..
acpi [PATCH] i386: Support physical cpu hotplug for x86_64 2006-09-26 10:52:35 +02:00
cpu [PATCH] i386: mark cpu cache functions as __cpuinit 2006-09-26 10:52:36 +02:00
.gitignore [PATCH] x86: gitignore some autogenerated files for i386 2006-02-14 16:09:35 -08:00
alternative.c [PATCH] lockdep: x86 smp alternatives workaround 2006-07-03 15:27:04 -07:00
apic.c [PATCH] i386: Make enable_local_apic static 2006-09-26 10:52:35 +02:00
apm.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
asm-offsets.c [PATCH] vdso: randomize the i386 vDSO by moving it into a vma 2006-06-27 17:32:38 -07:00
bootflag.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cpuid.c [PATCH] Fix modular cpuid.ko 2006-07-03 21:25:20 -07:00
crash.c [PATCH] i386: Kdump i386 nmi event notification fix 2006-09-26 10:52:27 +02:00
crash_dump.c [PATCH] kdump: read previous kernel's memory 2006-01-10 08:01:28 -08:00
doublefault.c [PATCH] i386: cpu_relax() in crash.c and doublefault.c 2006-06-25 10:00:55 -07:00
early_printk.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
efi.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
efi_stub.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
entry.S [PATCH] i386: Allow a kernel not to be in ring 0 2006-09-26 10:52:39 +02:00
head.S [PATCH] i386: Add kernel thread stack frame termination for properly stopping stack unwinds. 2006-08-30 16:05:15 -07:00
hpet.c [PATCH] Fix faulty HPET clocksource usage (fix for bug #7062) 2006-09-01 11:39:08 -07:00
i386_ksyms.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
i387.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
i8237.c [PATCH] ISA DMA suspend for i386 2005-09-05 00:06:14 -07:00
i8253.c [PATCH] time: fix time going backward w/ clock=pit 2006-06-26 09:58:21 -07:00
i8259.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
init_task.c [PATCH] Change maxaligned_in_smp alignemnt macros to internodealigned_in_smp macros 2006-01-08 20:13:38 -08:00
io_apic.c [PATCH] i386: Replace i386 open-coded cmdline parsing with 2006-09-26 10:52:32 +02:00
ioport.c [PATCH] i386: use thread_info flags for debug regs and IO bitmaps 2006-07-09 18:47:12 -07:00
irq.c [PATCH] i386: Fix stack switching in do_IRQ 2006-08-30 16:05:16 -07:00
kprobes.c [PATCH] kprobe-booster: disable in preemptible kernel 2006-07-31 13:28:38 -07:00
ldt.c [PATCH] arch/i386/kernel/ldt.c should #include <asm/mmu_context.h> 2005-11-07 07:53:29 -08:00
machine_kexec.c [PATCH] i386: Avoid overwriting the current pgd (V4, i386) 2006-09-26 10:52:38 +02:00
Makefile [PATCH] i386: Do stacktracer conversion too 2006-09-26 10:52:34 +02:00
mca.c [PATCH] i386: Disallow kprobes on NMI handlers 2006-09-26 10:52:36 +02:00
microcode.c [PATCH] devfs: Remove the miscdevice devfs_name field as it's no longer needed 2006-06-26 12:25:08 -07:00
module.c [PATCH] x86: SMP alternatives 2006-03-23 07:38:04 -08:00
mpparse.c [PATCH] i386: Support physical cpu hotplug for x86_64 2006-09-26 10:52:35 +02:00
msr.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-06-30 15:39:30 -07:00
nmi.c [PATCH] i386: Disallow kprobes on NMI handlers 2006-09-26 10:52:36 +02:00
numaq.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
pci-dma.c [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
process.c [PATCH] i386: Allow a kernel not to be in ring 0 2006-09-26 10:52:39 +02:00
ptrace.c [PATCH] i386/x86-64: rename is_at_popf(), add iret to tests and fix 2006-09-26 10:52:33 +02:00
quirks.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
reboot.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
reboot_fixups.c [PATCH] i386: Remove printk about reboot fixups at reboot 2006-04-09 11:53:53 -07:00
relocate_kernel.S [PATCH] i386: Avoid overwriting the current pgd (V4, i386) 2006-09-26 10:52:38 +02:00
scx200.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
setup.c [PATCH] i386/x86-64: Move acpi_disabled variables into acpi/boot.c 2006-09-26 10:52:33 +02:00
sigframe.h [PATCH] __user annotations for pointers in i386 sigframe 2005-09-09 10:31:59 -07:00
signal.c [PATCH] vdso: randomize the i386 vDSO by moving it into a vma 2006-06-27 17:32:38 -07:00
smp.c [PATCH] x86_64: Standardize i386/x86_64 handling of NMI_VECTOR 2006-06-26 10:48:22 -07:00
smpboot.c [PATCH] i386: don't taint UP K7's running SMP kernels. 2006-09-26 10:52:34 +02:00
srat.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
summit.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sys_i386.c [PATCH] Uninline sys_mmap common code (reduce binary size) 2006-03-22 07:54:02 -08:00
syscall_table.S [PATCH] x86: Add portable getcpu call 2006-09-26 10:52:28 +02:00
sysenter.c [PATCH] small fix for not releasing the mmap semaphore in i386/arch_setup_additional_pages 2006-06-28 12:05:50 -07:00
time.c [PATCH] i386: Account spinlocks to the caller during profiling for !FP kernels 2006-09-26 10:52:28 +02:00
time_hpet.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
topology.c [PATCH] i386: clean up topology.c 2006-09-26 10:52:35 +02:00
trampoline.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
traps.c [PATCH] i386: Disallow kprobes on NMI handlers 2006-09-26 10:52:36 +02:00
tsc.c [PATCH] i386: mark two more functions as __init 2006-09-26 10:52:35 +02:00
vm86.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
vmlinux.lds.S [PATCH] i386: reliable stack trace support (i386) 2006-06-26 10:48:17 -07:00
vsyscall-int80.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vsyscall-note.S [PATCH] i386 vDSO: add PT_NOTE segment 2005-04-16 15:24:48 -07:00
vsyscall-sigreturn.S [PATCH] Mark unwind info for signal trampolines in vDSOs 2006-03-31 12:18:52 -08:00
vsyscall-sysenter.S [PATCH] vdso: randomize the i386 vDSO by moving it into a vma 2006-06-27 17:32:38 -07:00
vsyscall.lds.S [PATCH] vDSO hash-style fix 2006-07-31 13:28:43 -07:00
vsyscall.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00