ANDROID: KVM: arm64: Add mapping removal interface for nVHE hyp
The new pkvm_remove_mappings() allows the caller to unmap a memory range from the hypervisor. This is to allow later introduction of in-hypervisor tracing. Bug: 244543039 Bug: 229972309 Change-Id: I9edc7c2ae55c4b7f5d464d26ce3351b5fd4bf9f3 Signed-off-by: Vincent Donnefort <vdonnefort@google.com> Signed-off-by: Quentin Perret <qperret@google.com>
This commit is contained in:
parent
d996511e43
commit
8a3e189fbd
@ -28,5 +28,6 @@ int __pkvm_create_private_mapping(phys_addr_t phys, size_t size,
|
||||
enum kvm_pgtable_prot prot,
|
||||
unsigned long *haddr);
|
||||
int pkvm_alloc_private_va_range(size_t size, unsigned long *haddr);
|
||||
void pkvm_remove_mappings(void *from, void *to);
|
||||
|
||||
#endif /* __KVM_HYP_MM_H */
|
||||
|
@ -136,6 +136,15 @@ int pkvm_create_mappings(void *from, void *to, enum kvm_pgtable_prot prot)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void pkvm_remove_mappings(void *from, void *to)
|
||||
{
|
||||
unsigned long size = (unsigned long)to - (unsigned long)from;
|
||||
|
||||
hyp_spin_lock(&pkvm_pgd_lock);
|
||||
WARN_ON(kvm_pgtable_hyp_unmap(&pkvm_pgtable, (u64)from, size) != size);
|
||||
hyp_spin_unlock(&pkvm_pgd_lock);
|
||||
}
|
||||
|
||||
int hyp_back_vmemmap(phys_addr_t back)
|
||||
{
|
||||
unsigned long i, start, size, end = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user