Revert "ANDROID: KVM: arm64: Handle FFA_MEM_LEND calls from the host"

This reverts commit 1b0f98a2c2.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I745faba81b1d2108e4b850b8438dce7e0ff132f1
This commit is contained in:
Will Deacon
2022-07-07 15:49:16 +01:00
parent 955aa35d9d
commit 40c405c071

View File

@@ -114,10 +114,10 @@ static int spmd_unmap_ffa_buffers(void)
return res.a0 == FFA_SUCCESS ? FFA_RET_SUCCESS : res.a2;
}
static void spmd_mem_xfer(struct arm_smccc_res *res, u64 func_id, u32 len,
u32 fraglen)
static void spmd_mem_share(struct arm_smccc_res *res, u32 len, u32 fraglen)
{
arm_smccc_1_1_smc(func_id, len, fraglen,
arm_smccc_1_1_smc(FFA_FN64_MEM_SHARE,
len, fraglen,
0, 0, 0, 0, 0,
res);
}
@@ -288,9 +288,8 @@ static int ffa_host_unshare_ranges(struct ffa_mem_region_addr_range *ranges,
return ret;
}
static __always_inline void do_ffa_mem_xfer(const u64 func_id,
struct arm_smccc_res *res,
struct kvm_cpu_context *ctxt)
static void do_ffa_mem_share(struct arm_smccc_res *res,
struct kvm_cpu_context *ctxt)
{
DECLARE_REG(u32, len, ctxt, 1);
DECLARE_REG(u32, fraglen, ctxt, 2);
@@ -301,9 +300,6 @@ static __always_inline void do_ffa_mem_xfer(const u64 func_id,
int ret = 0;
u32 offset;
BUILD_BUG_ON(func_id != FFA_FN64_MEM_SHARE &&
func_id != FFA_FN64_MEM_LEND);
if (addr_mbz || npages_mbz || fraglen > len ||
fraglen > KVM_FFA_MBOX_NR_PAGES * PAGE_SIZE) {
ret = FFA_RET_INVALID_PARAMETERS;
@@ -353,7 +349,7 @@ static __always_inline void do_ffa_mem_xfer(const u64 func_id,
if (ret)
goto out_unlock;
spmd_mem_xfer(res, func_id, len, fraglen);
spmd_mem_share(res, len, fraglen);
if (res->a0 != FFA_SUCCESS) {
WARN_ON(ffa_host_unshare_ranges(reg->constituents,
reg->addr_range_cnt));
@@ -505,15 +501,13 @@ bool kvm_host_ffa_handler(struct kvm_cpu_context *host_ctxt)
goto out_handled;
case FFA_MEM_SHARE:
case FFA_FN64_MEM_SHARE:
do_ffa_mem_xfer(FFA_FN64_MEM_SHARE, &res, host_ctxt);
do_ffa_mem_share(&res, host_ctxt);
goto out_handled;
case FFA_MEM_RECLAIM:
do_ffa_mem_reclaim(&res, host_ctxt);
goto out_handled;
case FFA_MEM_LEND:
case FFA_FN64_MEM_LEND:
do_ffa_mem_xfer(FFA_FN64_MEM_LEND, &res, host_ctxt);
goto out_handled;
case FFA_MEM_FRAG_TX:
break;
}