1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright (c) 2025 Ventana Micro Systems Inc. 4 */ 5 6 #ifndef __RISCV_KVM_MMU_H_ 7 #define __RISCV_KVM_MMU_H_ 8 9 #include <asm/kvm_gstage.h> 10 11 int kvm_riscv_mmu_ioremap(struct kvm *kvm, gpa_t gpa, phys_addr_t hpa, 12 unsigned long size, bool writable, bool in_atomic); 13 void kvm_riscv_mmu_iounmap(struct kvm *kvm, gpa_t gpa, unsigned long size); 14 int kvm_riscv_mmu_map(struct kvm_vcpu *vcpu, struct kvm_memory_slot *memslot, 15 gpa_t gpa, unsigned long hva, bool is_write, 16 struct kvm_gstage_mapping *out_map); 17 int kvm_riscv_mmu_alloc_pgd(struct kvm *kvm); 18 void kvm_riscv_mmu_free_pgd(struct kvm *kvm); 19 void kvm_riscv_mmu_update_hgatp(struct kvm_vcpu *vcpu); 20 21 #endif 22