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>
This commit is contained in:

committed by
Avi Kivity

parent
df9b856c45
commit
fe4e771d5c
@@ -21,6 +21,7 @@
|
||||
#include <asm/dcr.h>
|
||||
#include <asm/dcr-regs.h>
|
||||
#include <asm/disassemble.h>
|
||||
#include <asm/kvm_44x.h>
|
||||
|
||||
#include "booke.h"
|
||||
#include "44x_tlb.h"
|
||||
@@ -38,14 +39,6 @@
|
||||
#define XOP_ICCCI 966
|
||||
#define XOP_TLBWE 978
|
||||
|
||||
static inline void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 new_pid)
|
||||
{
|
||||
if (vcpu->arch.pid != new_pid) {
|
||||
vcpu->arch.pid = new_pid;
|
||||
vcpu->arch.swap_pid = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void kvmppc_emul_rfi(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
vcpu->arch.pc = vcpu->arch.srr0;
|
||||
|
Reference in New Issue
Block a user