ANDROID: KVM: arm64: scmi: Rely on donation logic

Instead of using custom functions to map/unmap memory in host, that
doesn't check any state, rely on the donation logic which should do
the right thing.

Bug: 357781595
Bug: 384432312
Change-Id: I311bbcebfb2eb94d627e85da463226e97898c9a5
Signed-off-by: Mostafa Saleh <smostafa@google.com>
This commit is contained in:
Mostafa Saleh
2024-12-20 13:58:06 +00:00
parent 6b9bb2f47f
commit 5da8469f80
+2 -2
View File
@@ -180,12 +180,12 @@ bool kvm_host_scmi_handler(struct kvm_cpu_context *host_ctxt)
* it's unlikely with the SMC-based transport, this too requires some
* tightening in the spec.
*/
if (WARN_ON(__pkvm_host_add_remove_page(scmi_channel.shmem_pfn, true)))
if (WARN_ON(__pkvm_host_donate_hyp(scmi_channel.shmem_pfn, 1)))
return true;
__kvm_host_scmi_handler(host_ctxt);
WARN_ON(__pkvm_host_add_remove_page(scmi_channel.shmem_pfn, false));
WARN_ON(__pkvm_hyp_donate_host(scmi_channel.shmem_pfn, 1));
return true; /* Handled */
}