mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
ANDROID: KVM: arm64: pkvm: Share memory with non-protected guests
Instead of donating memory to non-pVMs, share the memory, which gives us a good enough approximation of the usual behaviour. Signed-off-by: Marc Zyngier <maz@kernel.org> Bug: 209580772 Change-Id: I47213754613110a6fb8157806eb96ddf92ead346 Signed-off-by: Will Deacon <willdeacon@google.com>
This commit is contained in:
committed by
Will Deacon
parent
4fe4fd6746
commit
3336b8073a
@@ -734,8 +734,12 @@ static void handle___pkvm_host_donate_guest(struct kvm_cpu_context *host_ctxt)
|
||||
|
||||
/* Topup shadow memcache with the host's */
|
||||
ret = pkvm_refill_memcache(state->vcpu, vcpu);
|
||||
if (!ret)
|
||||
ret = __pkvm_host_donate_guest(pfn, gfn, state->vcpu);
|
||||
if (!ret) {
|
||||
if (state->is_protected)
|
||||
ret = __pkvm_host_donate_guest(pfn, gfn, state->vcpu);
|
||||
else
|
||||
ret = __pkvm_host_share_guest(pfn, gfn, state->vcpu);
|
||||
}
|
||||
out:
|
||||
cpu_reg(host_ctxt, 1) = ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user