original_kernel/arch/s390/kernel
Christian Borntraeger ce6a04ac1b s390/kvm: Fix address space mixup
I was chasing down a bug of random validity intercepts on s390.
(guest prefix page not mapped in the host virtual aspace). Turns out
that the problem was a wrong address space control element. The
cause was quite complex:

During paging activity a DAT protection during SIE caused a program
interrupt. Normally, the sie retry loop tries to catch all
interrupts during and shortly before sie to rerun the setup. The
problem is now that protection causes a suppressing program interrupt,
causing the PSW to point to the instruction AFTER SIE in case of DAT
protection. This confused the logic of the retry loop to not trigger,
instead we jumped directly back to SIE after return from
the program  interrupt. (the protection fault handler itself did
a rewind of the psw). This usually works quite well, but:

If now the protection fault handler has to wait, another program
might be scheduled in. Later on the sie process will be schedules
in again. In that case the content of CR1 (primary address space)
will be wrong because switch_to will put the user space ASCE into CR1
and not the guest ASCE.

In addition the program parameter is also wrong for every protection
fault of a guest, since we dont issue the SPP instruction.

So lets also check for PSW == instruction after SIE in the program
check handler. Instead of expensively checking all program
interruption codes that might be suppressing we assume that a program
interrupt pointing after SIE was always a program interrupt in SIE.
(Otherwise we have a kernel bug anyway).

We also have to compensate the rewinding, since the C-level handlers
will do that. Therefore we need to add a nop with the same length
as SIE before the sie_loop.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
CC: stable@vger.kernel.org
CC: Heiko Carstens <heiko.carstens@de.ibm.com>
2012-11-23 11:14:34 +01:00
..
vdso32
vdso64
.gitignore
Makefile s390/traps: preinitialize program check table 2012-11-23 11:14:25 +01:00
asm-offsets.c
audit.c
audit.h
base.S
bitmap.c
cache.c s390/cache: fix data/instruction cache output 2012-10-18 17:50:11 +02:00
compat_audit.c
compat_exec_domain.c
compat_linux.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-10-10 12:02:25 +09:00
compat_linux.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-10-10 12:02:25 +09:00
compat_ptrace.h
compat_signal.c s390/signal: set correct address space control 2012-11-12 16:24:38 +01:00
compat_wrapper.S Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-10-10 12:02:25 +09:00
cpcmd.c
crash_dump.c
debug.c
diag.c
dis.c s390/disassembler: add new instructions 2012-11-23 11:14:33 +01:00
early.c s390/mm: use pfmf instruction to initialize storage keys 2012-10-09 14:16:55 +02:00
ebcdic.c
entry.S s390/ptrace: race of single stepping vs signal delivery 2012-11-23 11:14:33 +01:00
entry.h s390/traps: preinitialize program check table 2012-11-23 11:14:25 +01:00
entry64.S s390/kvm: Fix address space mixup 2012-11-23 11:14:34 +01:00
ftrace.c
head.S s390: add zEC12 code generation support 2012-11-23 11:14:31 +01:00
head31.S s390/mm: let kernel text section always begin at 1MB 2012-10-09 14:16:59 +02:00
head64.S s390/mm: let kernel text section always begin at 1MB 2012-10-09 14:16:59 +02:00
head_kdump.S s390/kdump: Use 64 bit mode for 0x10000 entry point 2012-10-18 17:50:09 +02:00
ipl.c
irq.c
jump_label.c
kprobes.c
lgr.c
machine_kexec.c
mcount.S
mcount64.S
mem_detect.c
module.c s390/vmalloc: have separate modules area 2012-10-09 14:17:01 +02:00
nmi.c
os_info.c
perf_cpum_cf.c perf_cpum_cf: Add support for counters available with IBM zEC12 2012-10-18 17:50:09 +02:00
perf_event.c
pgm_check.S s390/traps: preinitialize program check table 2012-11-23 11:14:25 +01:00
process.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-10-10 12:02:25 +09:00
processor.c
ptrace.c
reipl.S
reipl64.S
relocate_kernel.S
relocate_kernel64.S
runtime_instr.c
s390_ksyms.c
sclp.S s390/sclp: fix addressing mode clobber 2012-11-06 22:39:51 +01:00
setup.c s390: add zEC12 code generation support 2012-11-23 11:14:31 +01:00
signal.c s390/ptrace: race of single stepping vs signal delivery 2012-11-23 11:14:33 +01:00
smp.c
stacktrace.c
suspend.c
swsusp_asm64.S
sys_s390.c
syscalls.S
sysinfo.c
time.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-10-12 22:17:48 +09:00
topology.c s390/topology: cleanup topology code 2012-11-23 11:14:31 +01:00
traps.c s390/traps: preinitialize program check table 2012-11-23 11:14:25 +01:00
vdso.c
vmlinux.lds.S s390: fix linker script for 31 bit builds 2012-10-18 17:50:10 +02:00
vtime.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-10-01 11:49:56 -07:00