mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
Revert "ANDROID: KVM: arm64: Expose topup_hyp_memcache() to the rest of KVM"
This reverts commit c3e455cd33.
Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I1d5d4253d594b2f78ce85dffe079e00b057cd8aa
This commit is contained in:
@@ -124,9 +124,6 @@ static inline void __free_hyp_memcache(struct kvm_hyp_memcache *mc,
|
||||
free_fn(pop_hyp_memcache(mc, to_va), arg);
|
||||
}
|
||||
|
||||
void free_hyp_memcache(struct kvm_hyp_memcache *mc);
|
||||
int topup_hyp_memcache(struct kvm_vcpu *vcpu);
|
||||
|
||||
struct kvm_vmid {
|
||||
/* The VMID generation used for the virt. memory system */
|
||||
u64 vmid_gen;
|
||||
|
||||
@@ -820,14 +820,13 @@ void free_hyp_memcache(struct kvm_hyp_memcache *mc)
|
||||
kvm_host_va, NULL);
|
||||
}
|
||||
|
||||
int topup_hyp_memcache(struct kvm_vcpu *vcpu)
|
||||
static int topup_hyp_memcache(struct kvm_hyp_memcache *mc,
|
||||
unsigned long min_pages)
|
||||
{
|
||||
if (!is_protected_kvm_enabled())
|
||||
return 0;
|
||||
|
||||
return __topup_hyp_memcache(&vcpu->arch.pkvm_memcache,
|
||||
kvm_mmu_cache_min_pages(vcpu->kvm),
|
||||
hyp_mc_alloc_fn,
|
||||
return __topup_hyp_memcache(mc, min_pages, hyp_mc_alloc_fn,
|
||||
kvm_host_pa, NULL);
|
||||
}
|
||||
|
||||
@@ -1162,6 +1161,7 @@ static int pkvm_host_donate_guest(u64 pfn, u64 gfn, struct kvm_vcpu *vcpu)
|
||||
static int pkvm_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
|
||||
unsigned long hva)
|
||||
{
|
||||
struct kvm_hyp_memcache *hyp_memcache = &vcpu->arch.pkvm_memcache;
|
||||
struct mm_struct *mm = current->mm;
|
||||
unsigned int flags = FOLL_FORCE |
|
||||
FOLL_HWPOISON |
|
||||
@@ -1173,7 +1173,7 @@ static int pkvm_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
|
||||
u64 pfn;
|
||||
int ret;
|
||||
|
||||
ret = topup_hyp_memcache(vcpu);
|
||||
ret = topup_hyp_memcache(hyp_memcache, kvm_mmu_cache_min_pages(kvm));
|
||||
if (ret)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user