linux-headers/arch/e2k/include/asm/kvm/tlbflush.h

60 lines
2.1 KiB
C
Raw Normal View History

2021-07-14 00:44:10 +02:00
/*
* Guest MMU caches flushing on KVM host
*
* Copyright 2016 Salavat S. Gilyazov (atic@mcst.ru)
*/
#ifndef _E2K_KVM_TLBFLUSH_H
#define _E2K_KVM_TLBFLUSH_H
#include <linux/mm.h>
2021-08-26 00:47:50 +02:00
#include <linux/kvm_host.h>
2021-07-14 00:44:10 +02:00
2021-08-26 00:47:50 +02:00
#include <asm/kvm/hypercall.h>
2021-07-14 00:44:10 +02:00
/*
* Guest VM support on host
* TLB flushing:
*
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
* - flush_tlb_page(vma, vmaddr) flushes one page
* - flush_tlb_range(mm, start, end) flushes a range of pages
*/
2021-08-26 00:47:50 +02:00
extern void mmu_pv_flush_tlb_range(struct kvm_vcpu *vcpu, gmm_struct_t *gmm,
const e2k_addr_t start, const e2k_addr_t end);
extern void mmu_pv_flush_cpu_root_pt_mm(struct kvm_vcpu *vcpu, gmm_struct_t *gmm);
extern void mmu_pv_flush_cpu_root_pt(struct kvm_vcpu *vcpu);
2021-07-14 00:44:10 +02:00
2021-08-26 00:47:50 +02:00
extern long kvm_pv_sync_and_flush_tlb(struct kvm_vcpu *vcpu,
mmu_spt_flush_t __user *flush_user);
extern long kvm_pv_sync_addr_range(struct kvm_vcpu *vcpu,
gva_t start_gva, gva_t end_gva);
2021-07-14 00:44:10 +02:00
2021-08-26 00:47:50 +02:00
extern void host_flush_shadow_pt_tlb_range(struct kvm_vcpu *vcpu,
gva_t start, gva_t end, pgprot_t spte, int level);
2021-07-14 00:44:10 +02:00
2021-08-26 00:47:50 +02:00
extern void host_flush_shadow_pt_level_tlb(struct kvm *kvm, gmm_struct_t *gmm,
gva_t gva, int level, pgprot_t new_spte, pgprot_t old_spte);
2021-07-14 00:44:10 +02:00
2021-11-14 16:13:25 +01:00
/*
* Shadow PT TLB flushing (same as flush_tlb_*() but for gmm)
* Real switching to a new gmm context (PID) will be a little later
* while return from hypercall to the guest mode (host_guest_enter()),
* and it is then that the PID will become active, but now it is still passive.
*/
2022-01-17 12:36:48 +01:00
extern void host_local_flush_tlb_range_and_pgtables(gmm_struct_t *gmm,
unsigned long start, unsigned long end);
2021-11-14 16:13:25 +01:00
extern void host_flush_tlb_mm(gmm_struct_t *gmm);
extern void host_flush_tlb_page(gmm_struct_t *gmm, unsigned long addr);
extern void host_flush_tlb_range(gmm_struct_t *gmm,
unsigned long start, unsigned long end);
extern void host_flush_tlb_kernel_range(gmm_struct_t *gmm,
unsigned long start, unsigned long end);
extern void host_flush_tlb_range_and_pgtables(gmm_struct_t *gmm,
unsigned long start, unsigned long end);
extern void host_flush_pmd_tlb_range(gmm_struct_t *gmm,
unsigned long start, unsigned long end);
2021-07-14 00:44:10 +02:00
#endif /* _E2K_KVM_TLBFLUSH_H */