]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: ppc: fix userspace mapping invalidation on context switch
authorHollis Blanchard <hollisb@us.ibm.com>
Mon, 10 Nov 2008 20:57:36 +0000 (14:57 -0600)
committerAvi Kivity <avi@redhat.com>
Thu, 13 Nov 2008 12:21:22 +0000 (14:21 +0200)
commit0ccca08a27f00fdb483c20dc3734fde7a179cb48
tree562ea43c1f0ceae478921564bf61b7d1130a6f60
parent631fba9dd3aca519355322cef035730609e91593
KVM: ppc: fix userspace mapping invalidation on context switch

We used to defer invalidating userspace TLB entries until jumping out of the
kernel. This was causing MMU weirdness most easily triggered by using a pipe in
the guest, e.g. "dmesg | tail". I believe the problem was that after the guest
kernel changed the PID (part of context switch), the old process's mappings
were still present, and so copy_to_user() on the "return to new process" path
ended up using stale mappings.

Testing with large pages (64K) exposed the problem, probably because with 4K
pages, pressure on the TLB faulted all process A's mappings out before the
guest kernel could insert any for process B.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/include/asm/kvm_44x.h
arch/powerpc/kvm/44x_emulate.c
arch/powerpc/kvm/44x_tlb.c