ANDROID: KVM: arm64: Use fixmap when poisoning pvmfw pages

When poisoning the pvmfw pages during system reset at EL2, ensure that we
use a writable fixmap mapping rather than the persistent read-only mapping
of the region.

Signed-off-by: Will Deacon <will@kernel.org>
Bug: 254819795
Change-Id: I4c8be092d3c822695afd7d03d0d64163664a9f64
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-15 14:24:02 +00:00
committed by Quentin Perret
parent a542a1202a
commit 677980a696

View File

@@ -889,10 +889,13 @@ int pkvm_load_pvmfw_pages(struct pkvm_hyp_vm *vm, u64 ipa, phys_addr_t phys,
void pkvm_poison_pvmfw_pages(void)
{
void *addr = hyp_phys_to_virt(pvmfw_base);
u64 npages = pvmfw_size >> PAGE_SHIFT;
phys_addr_t addr = pvmfw_base;
memset(addr, 0, pvmfw_size);
kvm_flush_dcache_to_poc(addr, pvmfw_size);
while (npages--) {
hyp_poison_page(addr);
addr += PAGE_SIZE;
}
}
/*