On aarch64-4k and aarch64-64k kernels, the typical consumption values
for SMMU are 36MB and 384MB, respectively. That is a significant
difference. Hence for 64k kernel, the consumption by smmu should be
calculated carefully.
To address the problem, adding an extra 384MB value if installing a 64k
kernel. The upper limit value 384MB is decided by the formulas in the
smmu driver and should not vary.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
To: kexec(a)lists.fedoraproject.org
Cc: Coiby Xu <coxu(a)redhat.com>
---
kdump-lib.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 0869703..a665808 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -879,6 +879,16 @@ get_recommend_size()
echo "0M"
}
+# On a 64K system, the value 384MB is calculated by: cmdq_num * 16 bytes + evtq_num * 32B
+ priq_num * 16B
+kdump_get_aarch64_64k_smmu_consumption()
+{
+ local _delta=0
+
+ if ls /sys/devices/platform/arm-smmu-* 1> /dev/null 2>&1; then
+ _delta=384
+ fi
+ echo $_delta
+}
kdump_get_aarch64_64k_crashkernel()
{
@@ -889,6 +899,7 @@ kdump_get_aarch64_64k_crashkernel()
# Picking up 100M to cover this diff. And finally, we have
"1G-4G:356M;4G-64G:420M;64G-:676M"
local _64k_delta="100"
+ _64k_delta=$((_64k_delta + $(kdump_get_aarch64_64k_smmu_consumption)))
IFS=',' read -ra ADDR <<< "$_ck_cmdline"
for i in "${ADDR[@]}"; do
key=$(echo "$i" | cut -d':' -f 1)
--
2.31.1