Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+4 -8
+2 -4
arch/powerpc/kvm/e500_mmu.c
··· 541 541 { 542 542 int i; 543 543 544 - clear_tlb1_bitmap(vcpu_e500); 544 + kvmppc_core_flush_tlb(&vcpu_e500->vcpu); 545 545 kfree(vcpu_e500->g2h_tlb1_map); 546 - 547 - clear_tlb_refs(vcpu_e500); 548 546 kfree(vcpu_e500->gtlb_priv[0]); 549 547 kfree(vcpu_e500->gtlb_priv[1]); 550 548 ··· 733 735 { 734 736 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu); 735 737 kvmppc_recalc_tlb1map_range(vcpu_e500); 736 - clear_tlb_refs(vcpu_e500); 738 + kvmppc_core_flush_tlb(vcpu); 737 739 return 0; 738 740 } 739 741
+2 -2
arch/powerpc/kvm/e500_mmu_host.c
··· 262 262 } 263 263 } 264 264 265 - void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500) 265 + static void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500) 266 266 { 267 267 if (vcpu_e500->g2h_tlb1_map) 268 268 memset(vcpu_e500->g2h_tlb1_map, 0, ··· 284 284 } 285 285 } 286 286 287 - void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500) 287 + static void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500) 288 288 { 289 289 int stlbsel = 1; 290 290 int i;
-2
arch/powerpc/kvm/e500_mmu_host.h
··· 12 12 void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500, int tlbsel, 13 13 int esel); 14 14 15 - void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500); 16 - void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500); 17 15 int e500_mmu_host_init(struct kvmppc_vcpu_e500 *vcpu_e500); 18 16 void e500_mmu_host_uninit(struct kvmppc_vcpu_e500 *vcpu_e500); 19 17