KVM: PPC: Book3S HV: Introduce kvmhv_update_nest_rmap_rc_list()
Subsystems (2)
PATCH 4/5 KVM: PPC: Book3S HV: Introduce kvmhv_update_nest_rmap_rc_list()
Introduce a function kvmhv_update_nest_rmap_rc_list() which for a given nest_rmap list will traverse it, find the corresponding pte in the shadow page tables, and if it still maps the same host page update the rc bits accordingly.
Signed-off-by Suraj Jitindar Singh <[email protected]>
--- arch/powerpc/include/asm/kvm_book3s.h | 2 ++ arch/powerpc/include/asm/kvm_book3s_64.h | 3 ++ arch/powerpc/kvm/book3s_64_mmu_radix.c | 4 +-- arch/powerpc/kvm/book3s_hv_nested.c | 51 ++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/kvm_book3s.h +2 -0
@@ -196,6 +196,8 @@ extern int kvmppc_mmu_radix_translate_table(struct kvm_vcpu *vcpu, gva_t eaddr, int table_index, u64 *pte_ret_p);extern int kvmppc_mmu_radix_xlate (struct kvm_vcpu *vcpu,gva_t eaddr,struct kvmppc_pte *gpte,bool data,bool iswrite); +extern void kvmppc_radix_tlbie_page (struct kvm *kvm,unsigned long addr, +unsigned int pshift,unsigned int lpid);extern void kvmppc_unmap_pte (struct kvm *kvm,pte_t *pte,unsigned long gpa,unsigned int shift,struct kvm_memory_slot *memslot,unsigned int lpid);
arch/powerpc/include/asm/kvm_book3s_64.h +3 -0
@@ -624,6 +624,9 @@ extern int kvmppc_create_pte(struct kvm *kvm, pgd_t *pgtable, pte_t pte, unsigned long *rmapp, struct rmap_nested **n_rmap);extern void kvmhv_insert_nest_rmap (struct kvm *kvm,unsigned long *rmapp,struct rmap_nested **n_rmap); +extern void kvmhv_update_nest_rmap_rc_list (struct kvm *kvm,unsigned long *rmapp, +unsigned long clr,unsigned long set, +unsigned long hpa,unsigned long nbytes); extern void kvmhv_remove_nest_rmap_range(struct kvm *kvm, struct kvm_memory_slot *memslot, unsigned long gpa, unsigned long hpa,
arch/powerpc/kvm/book3s_64_mmu_radix.c +2 -2
@@ -197,8 +197,8 @@ int kvmppc_mmu_radix_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,return 0 ; } -static void kvmppc_radix_tlbie_page (struct kvm *kvm,unsigned long addr, -unsigned int pshift,unsigned int lpid) +void kvmppc_radix_tlbie_page (struct kvm *kvm,unsigned long addr, +unsigned int pshift,unsigned int lpid) {unsigned long psize =PAGE_SIZE ;int psi;
arch/powerpc/kvm/book3s_hv_nested.c +51 -0
57 lines not on this page · raw message
Signature · 1 line
2.13.6