ANDROID: KVM: arm64: Rename hyp_zero_page() and make available as helper

hyp_zero_page() is used for poisoning memory, so rename it to
hyp_poison_page() to avoid confusing with the concept of a "zero page"
and make it available outside of mem_protect.c as it will be used to
poison the pvmfw memory in a subsequent patch.

Signed-off-by: Will Deacon <will@kernel.org>
Bug: 254819795
Change-Id: Ia4aec46437db3ffe466ae09bd180392fa06c0b46
Signed-off-by: Will Deacon <willdeacon@google.com>
Signed-off-by: Quentin Perret <qperret@google.com>
This commit is contained in:
Will Deacon
2022-11-17 11:34:59 +00:00
committed by Quentin Perret
parent 8f9c7f7acb
commit 8b744c24f0
2 changed files with 3 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ extern hyp_spinlock_t pkvm_pgd_lock;
int hyp_create_pcpu_fixmap(void);
void *hyp_fixmap_map(phys_addr_t phys);
void hyp_fixmap_unmap(void);
void hyp_poison_page(phys_addr_t phys);
int hyp_create_idmap(u32 hyp_va_bits);
int hyp_map_vectors(void);

View File

@@ -1796,7 +1796,7 @@ int __pkvm_host_donate_guest(u64 pfn, u64 gfn, struct pkvm_hyp_vcpu *vcpu)
return ret;
}
static void hyp_zero_page(phys_addr_t phys)
void hyp_poison_page(phys_addr_t phys)
{
void *addr = hyp_fixmap_map(phys);
@@ -1835,7 +1835,7 @@ int __pkvm_host_reclaim_page(u64 pfn)
}
if (page->flags & HOST_PAGE_NEED_POISONING) {
hyp_zero_page(addr);
hyp_poison_page(addr);
page->flags &= ~HOST_PAGE_NEED_POISONING;
}