KVM: powerpc: Map guest userspace with TID=0 mappings
authorHollis Blanchard <hollisb@us.ibm.com>
Fri, 25 Jul 2008 18:54:53 +0000 (13:54 -0500)
committerAvi Kivity <avi@qumranet.com>
Wed, 15 Oct 2008 08:15:16 +0000 (10:15 +0200)
commit49dd2c492895828a90ecdf889e7fe9cfb40a82a7
tree63b5f85b0ed5a94c8265d86dda4db262b00adf95
parent83aae4a8098eb8a40a2e9dab3714354182143b4f
KVM: powerpc: Map guest userspace with TID=0 mappings

When we use TID=N userspace mappings, we must ensure that kernel mappings have
been destroyed when entering userspace. Using TID=1/TID=0 for kernel/user
mappings and running userspace with PID=0 means that userspace can't access the
kernel mappings, but the kernel can directly access userspace.

The net is that we don't need to flush the TLB on privilege switches, but we do
on guest context switches (which are far more infrequent). Guest boot time
performance improvement: about 30%.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kvm/44x_tlb.c
arch/powerpc/kvm/booke_guest.c
arch/powerpc/kvm/booke_interrupts.S
arch/powerpc/kvm/emulate.c