mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-01 06:39:05 +00:00

The upcoming nested virtualization can share g-stage page table management with the current host g-stage implementation hence factor-out g-stage page table management as separate sources and also use "kvm_riscv_mmu_" prefix for host g-stage functions. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Tested-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com> Link: https://lore.kernel.org/r/20250618113532.471448-12-apatel@ventanamicro.com Signed-off-by: Anup Patel <anup@brainfault.org>
22 lines
721 B
C
22 lines
721 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2025 Ventana Micro Systems Inc.
|
|
*/
|
|
|
|
#ifndef __RISCV_KVM_MMU_H_
|
|
#define __RISCV_KVM_MMU_H_
|
|
|
|
#include <asm/kvm_gstage.h>
|
|
|
|
int kvm_riscv_mmu_ioremap(struct kvm *kvm, gpa_t gpa, phys_addr_t hpa,
|
|
unsigned long size, bool writable, bool in_atomic);
|
|
void kvm_riscv_mmu_iounmap(struct kvm *kvm, gpa_t gpa, unsigned long size);
|
|
int kvm_riscv_mmu_map(struct kvm_vcpu *vcpu, struct kvm_memory_slot *memslot,
|
|
gpa_t gpa, unsigned long hva, bool is_write,
|
|
struct kvm_gstage_mapping *out_map);
|
|
int kvm_riscv_mmu_alloc_pgd(struct kvm *kvm);
|
|
void kvm_riscv_mmu_free_pgd(struct kvm *kvm);
|
|
void kvm_riscv_mmu_update_hgatp(struct kvm_vcpu *vcpu);
|
|
|
|
#endif
|