mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
Revert "ANDROID: KVM: arm64: Fix size calculation of FFA memory range"
This reverts commit 3d21efc81c.
Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ie1a4e5117d51af64d2bd2641dc68d13c13015dd5
This commit is contained in:
@@ -284,13 +284,10 @@ static u32 __ffa_host_share_ranges(struct ffa_mem_region_addr_range *ranges,
|
||||
|
||||
for (i = 0; i < nranges; ++i) {
|
||||
struct ffa_mem_region_addr_range *range = &ranges[i];
|
||||
u64 sz = (u64)range->pg_cnt * FFA_PAGE_SIZE;
|
||||
u64 npages = (range->pg_cnt * FFA_PAGE_SIZE) / PAGE_SIZE;
|
||||
u64 pfn = hyp_phys_to_pfn(range->address);
|
||||
|
||||
if (!PAGE_ALIGNED(sz))
|
||||
break;
|
||||
|
||||
if (__pkvm_host_share_ffa(pfn, sz / PAGE_SIZE))
|
||||
if (__pkvm_host_share_ffa(pfn, npages))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -304,13 +301,10 @@ static u32 __ffa_host_unshare_ranges(struct ffa_mem_region_addr_range *ranges,
|
||||
|
||||
for (i = 0; i < nranges; ++i) {
|
||||
struct ffa_mem_region_addr_range *range = &ranges[i];
|
||||
u64 sz = (u64)range->pg_cnt * FFA_PAGE_SIZE;
|
||||
u64 npages = (range->pg_cnt * FFA_PAGE_SIZE) / PAGE_SIZE;
|
||||
u64 pfn = hyp_phys_to_pfn(range->address);
|
||||
|
||||
if (!PAGE_ALIGNED(sz))
|
||||
break;
|
||||
|
||||
if (__pkvm_host_unshare_ffa(pfn, sz / PAGE_SIZE))
|
||||
if (__pkvm_host_unshare_ffa(pfn, npages))
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user