aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2013-01-18 09:13:19 -0500
committerAlexander Graf <agraf@suse.de>2013-01-24 13:23:33 -0500
commit483ba97c0fafaade3a0ee61217ca5123b0d85c03 (patch)
tree3f709714fc1da0d319630c285d0c98b39cf352cf /arch
parentc015c62b13498629809185eb0ff04e3f13d1afb6 (diff)
KVM: PPC: E500: Make clear_tlb_refs and clear_tlb1_bitmap static
Host shadow TLB flushing is logic that the guest TLB code should have no insight about. Declare the internal clear_tlb_refs and clear_tlb1_bitmap functions static to the host TLB handling file. Instead of these, we can use the already exported kvmppc_core_flush_tlb(). This gives us a common API across the board to say "please flush any pending host shadow translation". Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kvm/e500_mmu.c6
-rw-r--r--arch/powerpc/kvm/e500_mmu_host.c4
-rw-r--r--arch/powerpc/kvm/e500_mmu_host.h2
3 files changed, 4 insertions, 8 deletions
diff --git a/arch/powerpc/kvm/e500_mmu.c b/arch/powerpc/kvm/e500_mmu.c
index c3d1721aa1b8..623a192c2658 100644
--- a/arch/powerpc/kvm/e500_mmu.c
+++ b/arch/powerpc/kvm/e500_mmu.c
@@ -541,10 +541,8 @@ static void free_gtlb(struct kvmppc_vcpu_e500 *vcpu_e500)
541{ 541{
542 int i; 542 int i;
543 543
544 clear_tlb1_bitmap(vcpu_e500); 544 kvmppc_core_flush_tlb(&vcpu_e500->vcpu);
545 kfree(vcpu_e500->g2h_tlb1_map); 545 kfree(vcpu_e500->g2h_tlb1_map);
546
547 clear_tlb_refs(vcpu_e500);
548 kfree(vcpu_e500->gtlb_priv[0]); 546 kfree(vcpu_e500->gtlb_priv[0]);
549 kfree(vcpu_e500->gtlb_priv[1]); 547 kfree(vcpu_e500->gtlb_priv[1]);
550 548
@@ -735,7 +733,7 @@ int kvm_vcpu_ioctl_dirty_tlb(struct kvm_vcpu *vcpu,
735{ 733{
736 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu); 734 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
737 kvmppc_recalc_tlb1map_range(vcpu_e500); 735 kvmppc_recalc_tlb1map_range(vcpu_e500);
738 clear_tlb_refs(vcpu_e500); 736 kvmppc_core_flush_tlb(vcpu);
739 return 0; 737 return 0;
740} 738}
741 739
diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index 9a150bced298..a222edfb9a9b 100644
--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -262,7 +262,7 @@ static inline void kvmppc_e500_ref_release(struct tlbe_ref *ref)
262 } 262 }
263} 263}
264 264
265void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500) 265static void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500)
266{ 266{
267 if (vcpu_e500->g2h_tlb1_map) 267 if (vcpu_e500->g2h_tlb1_map)
268 memset(vcpu_e500->g2h_tlb1_map, 0, 268 memset(vcpu_e500->g2h_tlb1_map, 0,
@@ -284,7 +284,7 @@ static void clear_tlb_privs(struct kvmppc_vcpu_e500 *vcpu_e500)
284 } 284 }
285} 285}
286 286
287void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500) 287static void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500)
288{ 288{
289 int stlbsel = 1; 289 int stlbsel = 1;
290 int i; 290 int i;
diff --git a/arch/powerpc/kvm/e500_mmu_host.h b/arch/powerpc/kvm/e500_mmu_host.h
index 9e4d4a20e694..7624835b76c7 100644
--- a/arch/powerpc/kvm/e500_mmu_host.h
+++ b/arch/powerpc/kvm/e500_mmu_host.h
@@ -12,8 +12,6 @@
12void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500, int tlbsel, 12void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500, int tlbsel,
13 int esel); 13 int esel);
14 14
15void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500);
16void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500);
17int e500_mmu_host_init(struct kvmppc_vcpu_e500 *vcpu_e500); 15int e500_mmu_host_init(struct kvmppc_vcpu_e500 *vcpu_e500);
18void e500_mmu_host_uninit(struct kvmppc_vcpu_e500 *vcpu_e500); 16void e500_mmu_host_uninit(struct kvmppc_vcpu_e500 *vcpu_e500);
19 17