mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
ANDROID: KVM: arm64: iommu: Fix upper bound of PT walk
The second argument of the kvm_pgtable_walker callback was
misinterpreted as the end of the current entry, where in fact it is
the end of the walked memory region. Fix this by computing the end of
the current entry from the start and the level.
This did not affect correctness, as the code iterates linarly over
the entire address space, but it did affect boot time.
Bug: 190463801
Bug: 218012133
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I6d189b87645f47cd215a783c1bc9e1f032ff8c62
(cherry picked from commit 58f8121600)
Signed-off-by: Mostafa Saleh <smostafa@google.com>
This commit is contained in:
committed by
Mostafa Saleh
parent
da176539ff
commit
6d6564e273
@@ -174,12 +174,13 @@ static bool is_mmio_range(phys_addr_t base, size_t size)
|
||||
return true;
|
||||
}
|
||||
|
||||
static int __snapshot_host_stage2(u64 start, u64 end, u32 level,
|
||||
static int __snapshot_host_stage2(u64 start, u64 pa_max, u32 level,
|
||||
kvm_pte_t *ptep,
|
||||
enum kvm_pgtable_walk_flags flags,
|
||||
void * const arg)
|
||||
{
|
||||
struct pkvm_iommu_driver * const drv = arg;
|
||||
u64 end = start + kvm_granule_size(level);
|
||||
enum kvm_pgtable_prot prot;
|
||||
kvm_pte_t pte = *ptep;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user