1 /*
2  * Copyright 2019 The Hafnium Authors.
3  *
4  * Use of this source code is governed by a BSD-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/BSD-3-Clause.
7  */
8 
9 #pragma once
10 
11 #include "hf/vm.h"
12 
13 /**
14  * Set architecture-specific features for the specified VM.
15  */
16 void arch_vm_features_set(struct vm *vm);
17 bool arch_vm_init_mm(struct vm *vm, struct mpool *ppool);
18 bool arch_vm_iommu_init_mm(struct vm *vm, struct mpool *ppool);
19 bool arch_vm_identity_prepare(struct vm_locked vm_locked, paddr_t begin,
20 			      paddr_t end, uint32_t mode, struct mpool *ppool);
21 void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin,
22 			     paddr_t end, uint32_t mode, struct mpool *ppool,
23 			     ipaddr_t *ipa);
24 bool arch_vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
25 		   struct mpool *ppool);
26 void arch_vm_ptable_defrag(struct vm_locked vm_locked, struct mpool *ppool);
27 bool arch_vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin,
28 			  ipaddr_t end, uint32_t *mode);
29 bool arch_vm_iommu_mm_identity_map(struct vm_locked vm_locked, paddr_t begin,
30 				   paddr_t end, uint32_t mode,
31 				   struct mpool *ppool, ipaddr_t *ipa,
32 				   uint8_t dma_device_id);
33