mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
ANDROID: KVM: arm64: Donate memory to protected guests
Instead of sharing memory with protected guests, which still leaves the host with r/w access, donate the underlying pages so that they are unmapped from the host stage-2. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Will Deacon <willdeacon@google.com> Bug: 233587962 Change-Id: I3e0d1d31877acf3978e82350ebbe92136919507c
This commit is contained in:
committed by
Will Deacon
parent
2ab0cf79ec
commit
5c41ce5227
@@ -457,7 +457,10 @@ static void handle___pkvm_host_map_guest(struct kvm_cpu_context *host_ctxt)
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
ret = __pkvm_host_share_guest(pfn, gfn, hyp_vcpu);
|
||||
if (pkvm_hyp_vcpu_is_protected(hyp_vcpu))
|
||||
ret = __pkvm_host_donate_guest(pfn, gfn, hyp_vcpu);
|
||||
else
|
||||
ret = __pkvm_host_share_guest(pfn, gfn, hyp_vcpu);
|
||||
out:
|
||||
cpu_reg(host_ctxt, 1) = ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user