mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

The MMU, TLB, and VMID management for KVM RISC-V already exists as seprate sources so create separate headers along these lines. This further simplifies asm/kvm_host.h header. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Tested-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com> Link: https://lore.kernel.org/r/20250618113532.471448-9-apatel@ventanamicro.com Signed-off-by: Anup Patel <anup@brainfault.org>
27 lines
714 B
C
27 lines
714 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2025 Ventana Micro Systems Inc.
|
|
*/
|
|
|
|
#ifndef __RISCV_KVM_VMID_H_
|
|
#define __RISCV_KVM_VMID_H_
|
|
|
|
#include <linux/kvm_types.h>
|
|
|
|
struct kvm_vmid {
|
|
/*
|
|
* Writes to vmid_version and vmid happen with vmid_lock held
|
|
* whereas reads happen without any lock held.
|
|
*/
|
|
unsigned long vmid_version;
|
|
unsigned long vmid;
|
|
};
|
|
|
|
void __init kvm_riscv_gstage_vmid_detect(void);
|
|
unsigned long kvm_riscv_gstage_vmid_bits(void);
|
|
int kvm_riscv_gstage_vmid_init(struct kvm *kvm);
|
|
bool kvm_riscv_gstage_vmid_ver_changed(struct kvm_vmid *vmid);
|
|
void kvm_riscv_gstage_vmid_update(struct kvm_vcpu *vcpu);
|
|
void kvm_riscv_gstage_vmid_sanitize(struct kvm_vcpu *vcpu);
|
|
|
|
#endif
|