aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2012-11-19 17:55:44 -0500
committerAlexander Graf <agraf@suse.de>2012-12-05 19:33:55 -0500
commit6b445ad4f839b06e68dd8e178e1168482ca20310 (patch)
tree5d7706fad9b7a22ccdf5fc1774d6acf530ea056e /arch
parent44e5f6be62741bd44968f40f3afa1cff1df983f2 (diff)
KVM: PPC: Book3S HV: Make a HPTE removal function available
This makes a HPTE removal function, kvmppc_do_h_remove(), available outside book3s_hv_rm_mmu.c. This will be used by the HPT writing code. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/kvm_book3s.h3
-rw-r--r--arch/powerpc/kvm/book3s_hv_rm_mmu.c19
2 files changed, 16 insertions, 6 deletions
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h
index fea768f21cd7..46763d10ad52 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -160,6 +160,9 @@ extern long kvmppc_virtmode_h_enter(struct kvm_vcpu *vcpu, unsigned long flags,
160extern long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags, 160extern long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags,
161 long pte_index, unsigned long pteh, unsigned long ptel, 161 long pte_index, unsigned long pteh, unsigned long ptel,
162 pgd_t *pgdir, bool realmode, unsigned long *idx_ret); 162 pgd_t *pgdir, bool realmode, unsigned long *idx_ret);
163extern long kvmppc_do_h_remove(struct kvm *kvm, unsigned long flags,
164 unsigned long pte_index, unsigned long avpn,
165 unsigned long *hpret);
163extern long kvmppc_hv_get_dirty_log(struct kvm *kvm, 166extern long kvmppc_hv_get_dirty_log(struct kvm *kvm,
164 struct kvm_memory_slot *memslot, unsigned long *map); 167 struct kvm_memory_slot *memslot, unsigned long *map);
165 168
diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
index ed563a5f25c8..fc3da3208fda 100644
--- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c
+++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
@@ -365,11 +365,10 @@ static inline int try_lock_tlbie(unsigned int *lock)
365 return old == 0; 365 return old == 0;
366} 366}
367 367
368long kvmppc_h_remove(struct kvm_vcpu *vcpu, unsigned long flags, 368long kvmppc_do_h_remove(struct kvm *kvm, unsigned long flags,
369 unsigned long pte_index, unsigned long avpn, 369 unsigned long pte_index, unsigned long avpn,
370 unsigned long va) 370 unsigned long *hpret)
371{ 371{
372 struct kvm *kvm = vcpu->kvm;
373 unsigned long *hpte; 372 unsigned long *hpte;
374 unsigned long v, r, rb; 373 unsigned long v, r, rb;
375 struct revmap_entry *rev; 374 struct revmap_entry *rev;
@@ -411,10 +410,18 @@ long kvmppc_h_remove(struct kvm_vcpu *vcpu, unsigned long flags,
411 note_hpte_modification(kvm, rev); 410 note_hpte_modification(kvm, rev);
412 unlock_hpte(hpte, 0); 411 unlock_hpte(hpte, 0);
413 412
414 vcpu->arch.gpr[4] = v; 413 hpret[0] = v;
415 vcpu->arch.gpr[5] = r; 414 hpret[1] = r;
416 return H_SUCCESS; 415 return H_SUCCESS;
417} 416}
417EXPORT_SYMBOL_GPL(kvmppc_do_h_remove);
418
419long kvmppc_h_remove(struct kvm_vcpu *vcpu, unsigned long flags,
420 unsigned long pte_index, unsigned long avpn)
421{
422 return kvmppc_do_h_remove(vcpu->kvm, flags, pte_index, avpn,
423 &vcpu->arch.gpr[4]);
424}
418 425
419long kvmppc_h_bulk_remove(struct kvm_vcpu *vcpu) 426long kvmppc_h_bulk_remove(struct kvm_vcpu *vcpu)
420{ 427{