Revert "ANDROID: KVM: arm64: Allocate pages for hypervisor FF-A mailboxes"

This reverts commit 868e8504cc.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I0eddecd8d5bc4d3c30899dd95cfffd3436b17663
This commit is contained in:
Will Deacon
2022-07-07 15:49:17 +01:00
parent b422db4c25
commit 9c27aa05d6
5 changed files with 3 additions and 40 deletions

View File

@@ -322,12 +322,4 @@ static inline unsigned long host_s2_pgtable_pages(void)
return res;
}
#define KVM_FFA_MBOX_NR_PAGES 1
static inline unsigned long hyp_ffa_proxy_pages(void)
{
/* A page each for the hypervisor's RX and TX mailboxes. */
return 2 * KVM_FFA_MBOX_NR_PAGES;
}
#endif /* __ARM64_KVM_PKVM_H__ */

View File

@@ -7,18 +7,11 @@
#define __KVM_HYP_FFA_H
#include <asm/kvm_host.h>
#include <nvhe/spinlock.h>
#define FFA_MIN_FUNC_NUM 0x60
#define FFA_MAX_FUNC_NUM 0x7F
struct kvm_ffa_buffers {
hyp_spinlock_t lock;
void *tx;
void *rx;
};
int hyp_ffa_init(void *pages);
int hyp_ffa_init(void);
bool kvm_host_ffa_handler(struct kvm_cpu_context *host_ctxt);
#endif /* __KVM_HYP_FFA_H */

View File

@@ -28,8 +28,6 @@
#include <linux/arm-smccc.h>
#include <linux/arm_ffa.h>
#include <asm/kvm_pkvm.h>
#include <nvhe/ffa.h>
#include <nvhe/trap_handler.h>
@@ -39,13 +37,6 @@
*/
#define HOST_FFA_ID 0
/*
* Note that we don't currently lock these buffers explicitly, instead
* relying on the locking of the host FFA buffers as we only have one
* client.
*/
static struct kvm_ffa_buffers ffa_buffers;
static void ffa_to_smccc_error(struct arm_smccc_res *res, u64 ffa_errno)
{
*res = (struct arm_smccc_res) {
@@ -171,7 +162,7 @@ out_handled:
return true;
}
int hyp_ffa_init(void *pages)
int hyp_ffa_init(void)
{
struct arm_smccc_res res;
@@ -192,11 +183,5 @@ int hyp_ffa_init(void *pages)
if (res.a2 != HOST_FFA_ID)
return -EINVAL;
ffa_buffers = (struct kvm_ffa_buffers) {
.lock = __HYP_SPIN_LOCK_UNLOCKED,
.tx = pages,
.rx = pages + (KVM_FFA_MBOX_NR_PAGES * PAGE_SIZE),
};
return 0;
}

View File

@@ -31,7 +31,6 @@ phys_addr_t pvmfw_size;
static void *vmemmap_base;
static void *hyp_pgt_base;
static void *host_s2_pgt_base;
static void *ffa_proxy_pages;
static struct kvm_pgtable_mm_ops pkvm_pgtable_mm_ops;
static struct hyp_pool hpool;
@@ -61,11 +60,6 @@ static int divide_memory_pool(void *virt, unsigned long size)
if (!host_s2_pgt_base)
return -ENOMEM;
nr_pages = hyp_ffa_proxy_pages();
ffa_proxy_pages = hyp_early_alloc_contig(nr_pages);
if (!ffa_proxy_pages)
return -ENOMEM;
return 0;
}
@@ -338,7 +332,7 @@ void __noreturn __pkvm_init_finalise(void)
if (ret)
goto out;
ret = hyp_ffa_init(ffa_proxy_pages);
ret = hyp_ffa_init();
if (ret)
goto out;
out:

View File

@@ -82,7 +82,6 @@ void __init kvm_hyp_reserve(void)
hyp_mem_pages += host_s2_pgtable_pages();
hyp_mem_pages += hyp_shadow_table_pages(KVM_SHADOW_VM_SIZE);
hyp_mem_pages += hyp_vmemmap_pages(STRUCT_HYP_PAGE_SIZE);
hyp_mem_pages += hyp_ffa_proxy_pages();
/*
* Try to allocate a PMD-aligned region to reduce TLB pressure once