linux/arch/powerpc
Hari Bathini 353d7a84c2 powerpc/64s/radix/kfence: map __kfence_pool at page granularity
When KFENCE is enabled, total system memory is mapped at page level
granularity. But in radix MMU mode, ~3GB additional memory is needed
to map 100GB of system memory at page level granularity when compared
to using 2MB direct mapping.This is not desired considering KFENCE is
designed to be enabled in production kernels [1].

Mapping only the memory allocated for KFENCE pool at page granularity is
sufficient to enable KFENCE support. So, allocate __kfence_pool during
bootup and map it at page granularity instead of mapping all system
memory at page granularity.

Without patch:
  # cat /proc/meminfo
  MemTotal:       101201920 kB

With patch:
  # cat /proc/meminfo
  MemTotal:       104483904 kB

Note that enabling KFENCE at runtime is disabled for radix MMU for now,
as it depends on the ability to split page table mappings and such APIs
are not currently implemented for radix MMU.

All kfence_test.c testcases passed with this patch.

[1] https://lore.kernel.org/all/20201103175841.3495947-2-elver@google.com/

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240701130021.578240-1-hbathini@linux.ibm.com
2024-07-04 21:55:18 +10:00
..
boot powerpc/boot: Remove all 40x platforms from boot 2024-06-28 22:28:47 +10:00
configs powerpc: Remove 40x from Kconfig and defconfig 2024-06-28 22:28:47 +10:00
crypto powerpc/crypto/chacha-p10: Fix failure on non Power10 2024-04-05 00:02:18 +11:00
include powerpc/64s/radix/kfence: map __kfence_pool at page granularity 2024-07-04 21:55:18 +10:00
kernel powerpc/prom: Add CPU info to hardware description string later 2024-06-28 22:31:00 +10:00
kexec powerpc/kexec_file: fix cpus node update to FDT 2024-06-17 22:48:45 +10:00
kvm powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
lib powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc/64s/radix/kfence: map __kfence_pool at page granularity 2024-07-04 21:55:18 +10:00
net powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH 2024-05-29 22:12:42 +10:00
perf powerpc/perf: Set cpumode flags using sample address 2024-06-17 22:47:16 +10:00
platforms powerpc/pseries/iommu: Define spapr_tce_table_group_ops only with CONFIG_IOMMU_API 2024-07-04 21:54:57 +10:00
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev powerpc: Replace CONFIG_4xx with CONFIG_44x 2024-06-28 22:28:48 +10:00
tools powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh 2023-10-20 17:46:33 +11:00
xmon powerpc/xmon: Check cpu id in commands "c#", "dp#" and "dx#" 2024-05-08 00:48:32 +10:00
Kbuild powerpc: Fix fatal warnings flag for LLVM's integrated assembler 2024-04-08 16:06:41 +10:00
Kconfig powerpc: Replace CONFIG_4xx with CONFIG_44x 2024-06-28 22:28:48 +10:00
Kconfig.debug powerpc: Remove 40x from Kconfig and defconfig 2024-06-28 22:28:47 +10:00
Makefile powerpc: Remove 40x from Kconfig and defconfig 2024-06-28 22:28:47 +10:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00