diff options
author | Hollis Blanchard <hollisb@us.ibm.com> | 2008-12-02 16:51:56 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-12-31 09:55:09 -0500 |
commit | c5fbdffbda79254047ec83b09c1a61a3655d052a (patch) | |
tree | 4fb1ba38fe722d514b62c284cc618768856eedf8 /arch/powerpc/include/asm | |
parent | 7924bd41097ae8991c6d38cef8b1e4058e30d198 (diff) |
KVM: ppc: save and restore guest mappings on context switch
Store shadow TLB entries in memory, but only use it on host context switch
(instead of every guest entry). This improves performance for most workloads on
440 by reducing the guest TLB miss rate.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/kvm_44x.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_44x.h b/arch/powerpc/include/asm/kvm_44x.h index e770ea2bbb1..f49031b632c 100644 --- a/arch/powerpc/include/asm/kvm_44x.h +++ b/arch/powerpc/include/asm/kvm_44x.h | |||
@@ -42,6 +42,10 @@ struct kvmppc_vcpu_44x { | |||
42 | /* References to guest pages in the hardware TLB. */ | 42 | /* References to guest pages in the hardware TLB. */ |
43 | struct kvmppc_44x_shadow_ref shadow_refs[PPC44x_TLB_SIZE]; | 43 | struct kvmppc_44x_shadow_ref shadow_refs[PPC44x_TLB_SIZE]; |
44 | 44 | ||
45 | /* State of the shadow TLB at guest context switch time. */ | ||
46 | struct kvmppc_44x_tlbe shadow_tlb[PPC44x_TLB_SIZE]; | ||
47 | u8 shadow_tlb_mod[PPC44x_TLB_SIZE]; | ||
48 | |||
45 | struct kvm_vcpu vcpu; | 49 | struct kvm_vcpu vcpu; |
46 | }; | 50 | }; |
47 | 51 | ||
@@ -51,5 +55,7 @@ static inline struct kvmppc_vcpu_44x *to_44x(struct kvm_vcpu *vcpu) | |||
51 | } | 55 | } |
52 | 56 | ||
53 | void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 new_pid); | 57 | void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 new_pid); |
58 | void kvmppc_44x_tlb_put(struct kvm_vcpu *vcpu); | ||
59 | void kvmppc_44x_tlb_load(struct kvm_vcpu *vcpu); | ||
54 | 60 | ||
55 | #endif /* __ASM_44X_H__ */ | 61 | #endif /* __ASM_44X_H__ */ |