]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Use kmemleak_free_part_phys() to unregister hyp_mem_base
authorZenghui Yu <yuzenghui@huawei.com>
Thu, 8 Sep 2022 13:06:59 +0000 (21:06 +0800)
committerMarc Zyngier <maz@kernel.org>
Mon, 19 Sep 2022 16:59:48 +0000 (17:59 +0100)
commitc1b10455a7f08a250600f1c36c15a711539a0a32
treec8756f0c8ea83b7bc846ca71dc8928d82e5542b3
parentacaa855d21c1fc8e8a1fab873003c0736c2d01f6
KVM: arm64: Use kmemleak_free_part_phys() to unregister hyp_mem_base

With commit ae2a1f131a41 ("mm: kmemleak: add rbtree and store physical
address for objects allocated with PA"), kmemleak started to put the
objects allocated with physical address onto object_phys_tree_root tree.
The kmemleak_free_part() therefore no longer worked as expected on
physically allocated objects (hyp_mem_base in this case) as it attempted to
search and remove things in object_tree_root tree.

Fix it by using kmemleak_free_part_phys() to unregister hyp_mem_base. This
fixes an immediate crash when booting a KVM host in protected mode with
kmemleak enabled.

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220908130659.2021-1-yuzenghui@huawei.com
arch/arm64/kvm/arm.c