Skip to content

Commit ecc5400

Browse files
Zenghui Yuwilldeacon
authored andcommitted
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: 9684ec1 ("arm64: Enable LPA2 at boot if supported by the system") Signed-off-by: Zenghui Yu <[email protected]> Reviewed-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 895a370 commit ecc5400

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/kernel/pi/map_kernel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static void __init remap_idmap_for_lpa2(void)
173173
* Don't bother with the FDT, we no longer need it after this.
174174
*/
175175
memset(init_idmap_pg_dir, 0,
176-
(u64)init_idmap_pg_dir - (u64)init_idmap_pg_end);
176+
(u64)init_idmap_pg_end - (u64)init_idmap_pg_dir);
177177

178178
create_init_idmap(init_idmap_pg_dir, mask);
179179
dsb(ishst);

0 commit comments

Comments
 (0)