Skip to content

Commit

Permalink
KVM: PPC: E500: Make clear_tlb_refs and clear_tlb1_bitmap static
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Graf committed Jan 24, 2013
1 parent c015c62 commit 483ba97
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions arch/powerpc/kvm/e500_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,8 @@ static void free_gtlb(struct kvmppc_vcpu_e500 *vcpu_e500)
{
int i;

clear_tlb1_bitmap(vcpu_e500);
kvmppc_core_flush_tlb(&vcpu_e500->vcpu);
kfree(vcpu_e500->g2h_tlb1_map);

clear_tlb_refs(vcpu_e500);
kfree(vcpu_e500->gtlb_priv[0]);
kfree(vcpu_e500->gtlb_priv[1]);

Expand Down Expand Up @@ -735,7 +733,7 @@ int kvm_vcpu_ioctl_dirty_tlb(struct kvm_vcpu *vcpu,
{
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
kvmppc_recalc_tlb1map_range(vcpu_e500);
clear_tlb_refs(vcpu_e500);
kvmppc_core_flush_tlb(vcpu);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kvm/e500_mmu_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ static inline void kvmppc_e500_ref_release(struct tlbe_ref *ref)
}
}

void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500)
static void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500)
{
if (vcpu_e500->g2h_tlb1_map)
memset(vcpu_e500->g2h_tlb1_map, 0,
Expand All @@ -284,7 +284,7 @@ static void clear_tlb_privs(struct kvmppc_vcpu_e500 *vcpu_e500)
}
}

void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500)
static void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500)
{
int stlbsel = 1;
int i;
Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/kvm/e500_mmu_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500, int tlbsel,
int esel);

void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500);
void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500);
int e500_mmu_host_init(struct kvmppc_vcpu_e500 *vcpu_e500);
void e500_mmu_host_uninit(struct kvmppc_vcpu_e500 *vcpu_e500);

Expand Down

0 comments on commit 483ba97

Please sign in to comment.