book3s64/hash: Disable kfence if not early init
authorRitesh Harjani (IBM) <ritesh.list@gmail.com>
Fri, 18 Oct 2024 17:29:52 +0000 (22:59 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 23 Oct 2024 07:53:20 +0000 (18:53 +1100)
commit76b7d6463fc504ac266472f5948b83902dfca4c6
treef5b1c03849b0944f05ac68e0bb9dd3bcf79aff58
parentb5fbf7e2c6a403344e83139a14322f0c42911f2d
book3s64/hash: Disable kfence if not early init

Enable kfence on book3s64 hash only when early init is enabled.
This is because, kfence could cause the kernel linear map to be mapped
at PAGE_SIZE level instead of 16M (which I guess we don't want).

Also currently there is no way to -
1. Make multiple page size entries for the SLB used for kernel linear
   map.
2. No easy way of getting the hash slot details after the page table
   mapping for kernel linear setup. So even if kfence allocate the
   pool in late init, we won't be able to get the hash slot details in
   kfence linear map.

Thus this patch disables kfence on hash if kfence early init is not
enabled.

Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/4a6eea8cfd1cd28fccfae067026bff30cbec1d4b.1729271995.git.ritesh.list@gmail.com
arch/powerpc/mm/book3s64/hash_utils.c