arm64: Clear the initial ID map correctly before remapping
authorZenghui Yu <yuzenghui@huawei.com>
Fri, 21 Jun 2024 09:28:09 +0000 (17:28 +0800)
committerWill Deacon <will@kernel.org>
Mon, 24 Jun 2024 11:37:46 +0000 (12:37 +0100)
commitecc54006f158ae0245a13e59026da2f0239c1b86
tree3a3e33892ac6af7c621c767fc12f3db39f32bf85
parent895a37028a4854962def6e2f2820a23c84062f66
arm64: Clear the initial ID map correctly before remapping

In the attempt to clear and recreate the initial ID map for LPA2, we
wrongly use 'start - end' as the map size and make the memset() almost a
nop.

Fix it by passing the correct map size.

Fixes: 9684ec186f8f ("arm64: Enable LPA2 at boot if supported by the system")
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20240621092809.162-1-yuzenghui@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/pi/map_kernel.c