ANDROID: KVM: arm64: Don't copy pvmfw pages more than once

If a pvmfw page is relinquished from the guest back to the host, disable
subsequent re-faulting of the pvmfw image for the pVM if a new page is
donated back to the same IPA region.

Bug: 432439762
Change-Id: Ibe7ba22bc19cad0a7c31dedae64c29e10537b669
Signed-off-by: Sebastian Ene <sebastianene@google.com>
This commit is contained in:
Sebastian Ene
2025-07-23 10:53:26 +00:00
parent a650639dac
commit 7f13e3e236
+4
View File
@@ -440,6 +440,10 @@ int __pkvm_guest_relinquish_to_host(struct pkvm_hyp_vcpu *vcpu,
psci_mem_protect_dec(1);
WARN_ON(host_stage2_set_owner_locked(phys, PAGE_SIZE, PKVM_ID_HOST));
if (pkvm_ipa_range_has_pvmfw(vm, ipa, ipa + PAGE_SIZE))
vm->kvm.arch.pkvm.pvmfw_load_addr = PVMFW_INVALID_LOAD_ADDR;
end:
guest_unlock_component(vm);
host_unlock_component();