| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
#ifndef __KVM_HYP_MM_H |
| 3 |
#define __KVM_HYP_MM_H |
| 4 |
|
| 5 |
#include <asm/kvm_pgtable.h> |
| 6 |
#include <asm/spectre.h> |
| 7 |
#include <linux/memblock.h> |
| 8 |
#include <linux/types.h> |
| 9 |
|
| 10 |
#include <nvhe/memory.h> |
| 11 |
#include <nvhe/spinlock.h> |
| 12 |
|
| 13 |
extern struct kvm_pgtable pkvm_pgtable; |
| 14 |
extern hyp_spinlock_t pkvm_pgd_lock; |
| 15 |
|
| 16 |
int hyp_create_fixmap(void); |
| 17 |
void *hyp_fixmap_map(phys_addr_t phys); |
| 18 |
void hyp_fixmap_unmap(void); |
| 19 |
void *hyp_fixblock_map(phys_addr_t phys, size_t *size); |
| 20 |
void hyp_fixblock_unmap(void); |
| 21 |
|
| 22 |
int hyp_create_idmap(u32 hyp_va_bits); |
| 23 |
int hyp_map_vectors(void); |
| 24 |
int hyp_back_vmemmap(phys_addr_t back); |
| 25 |
int pkvm_cpu_set_vector(enum arm64_hyp_spectre_vector slot); |
| 26 |
int pkvm_create_mappings(void *from, void *to, enum kvm_pgtable_prot prot); |
| 27 |
int pkvm_create_mappings_locked(void *from, void *to, enum kvm_pgtable_prot prot); |
| 28 |
int __pkvm_create_private_mapping(phys_addr_t phys, size_t size, |
| 29 |
enum kvm_pgtable_prot prot, |
| 30 |
unsigned long *haddr); |
| 31 |
int pkvm_create_stack(phys_addr_t phys, unsigned long *haddr); |
| 32 |
int pkvm_alloc_private_va_range(size_t size, unsigned long *haddr); |
| 33 |
|
| 34 |
#endif /* __KVM_HYP_MM_H */ |