linux/arch/powerpc/kvm
Hollis Blanchard 7924bd4109 KVM: ppc: directly insert shadow mappings into the hardware TLB
Formerly, we used to maintain a per-vcpu shadow TLB and on every entry to the
guest would load this array into the hardware TLB. This consumed 1280 bytes of
memory (64 entries of 16 bytes plus a struct page pointer each), and also
required some assembly to loop over the array on every entry.

Instead of saving a copy in memory, we can just store shadow mappings directly
into the hardware TLB, accepting that the host kernel will clobber these as
part of the normal 440 TLB round robin. When we do that we need less than half
the memory, and we have decreased the exit handling time for all guest exits,
at the cost of increased number of TLB misses because the host overwrites some
guest entries.

These savings will be increased on processors with larger TLBs or which
implement intelligent flush instructions like tlbivax (which will avoid the
need to walk arrays in software).

In addition to that and to the code simplification, we have a greater chance of
leaving other host userspace mappings in the TLB, instead of forcing all
subsequent tasks to re-fault all their mappings.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31 16:55:09 +02:00
..
44x_emulate.c KVM: ppc: fix userspace mapping invalidation on context switch 2008-12-31 16:52:26 +02:00
44x_tlb.c KVM: ppc: directly insert shadow mappings into the hardware TLB 2008-12-31 16:55:09 +02:00
44x_tlb.h KVM: ppc: directly insert shadow mappings into the hardware TLB 2008-12-31 16:55:09 +02:00
44x.c KVM: ppc: directly insert shadow mappings into the hardware TLB 2008-12-31 16:55:09 +02:00
booke_interrupts.S KVM: ppc: directly insert shadow mappings into the hardware TLB 2008-12-31 16:55:09 +02:00
booke.c KVM: ppc: directly insert shadow mappings into the hardware TLB 2008-12-31 16:55:09 +02:00
booke.h KVM: ppc: optimize irq delivery path 2008-12-31 16:52:23 +02:00
emulate.c KVM: ppc: improve trap emulation 2008-12-31 16:52:24 +02:00
Kconfig KVM: ppc: fix Kconfig constraints 2008-12-31 16:52:25 +02:00
Makefile KVM: ppc: refactor instruction emulation into generic and core-specific pieces 2008-12-31 16:52:21 +02:00
powerpc.c KVM: ppc: adjust vcpu types to support 64-bit cores 2008-12-31 16:52:22 +02:00