xref: /openbmc/linux/arch/arm64/kvm/hyp/include/nvhe/mm.h (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
1f320bc74SQuentin Perret /* SPDX-License-Identifier: GPL-2.0-only */
2f320bc74SQuentin Perret #ifndef __KVM_HYP_MM_H
3f320bc74SQuentin Perret #define __KVM_HYP_MM_H
4f320bc74SQuentin Perret 
5f320bc74SQuentin Perret #include <asm/kvm_pgtable.h>
6f320bc74SQuentin Perret #include <asm/spectre.h>
7f320bc74SQuentin Perret #include <linux/memblock.h>
8f320bc74SQuentin Perret #include <linux/types.h>
9f320bc74SQuentin Perret 
10f320bc74SQuentin Perret #include <nvhe/memory.h>
11f320bc74SQuentin Perret #include <nvhe/spinlock.h>
12f320bc74SQuentin Perret 
13f320bc74SQuentin Perret extern struct kvm_pgtable pkvm_pgtable;
14f320bc74SQuentin Perret extern hyp_spinlock_t pkvm_pgd_lock;
15f320bc74SQuentin Perret 
16aa6948f8SQuentin Perret int hyp_create_pcpu_fixmap(void);
17aa6948f8SQuentin Perret void *hyp_fixmap_map(phys_addr_t phys);
18aa6948f8SQuentin Perret void hyp_fixmap_unmap(void);
19aa6948f8SQuentin Perret 
20f320bc74SQuentin Perret int hyp_create_idmap(u32 hyp_va_bits);
21f320bc74SQuentin Perret int hyp_map_vectors(void);
228e6bcc3aSQuentin Perret int hyp_back_vmemmap(phys_addr_t back);
23f320bc74SQuentin Perret int pkvm_cpu_set_vector(enum arm64_hyp_spectre_vector slot);
24f320bc74SQuentin Perret int pkvm_create_mappings(void *from, void *to, enum kvm_pgtable_prot prot);
25f9370010SQuentin Perret int pkvm_create_mappings_locked(void *from, void *to, enum kvm_pgtable_prot prot);
26f922c13eSKalesh Singh int __pkvm_create_private_mapping(phys_addr_t phys, size_t size,
27f922c13eSKalesh Singh 				  enum kvm_pgtable_prot prot,
28f922c13eSKalesh Singh 				  unsigned long *haddr);
29*f156a7d1SVincent Donnefort int pkvm_create_stack(phys_addr_t phys, unsigned long *haddr);
30f922c13eSKalesh Singh int pkvm_alloc_private_va_range(size_t size, unsigned long *haddr);
31f320bc74SQuentin Perret 
32f320bc74SQuentin Perret #endif /* __KVM_HYP_MM_H */
33