summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Coleman <doug.coleman@gmail.com>2023-06-21 17:20:22 -0500
committerDoug Coleman <doug.coleman@gmail.com>2023-06-21 17:22:22 -0500
commit20be812612f163542502ef57cad04983c9bcfe16 (patch)
tree57ec3f19ed83d0d80d80ddbfce3413d9132bf2e8
parentd3c0266fd538780302513a5329feaaadad4d8f89 (diff)
libktest: 1T is too high a memory limit, use system's actual RAM
fixes qemu error (dell xps 13 plus 32G, arch linux): qemu-system-x86_64: Address space limit 0x7fffffffff < 0x10a7fffffff phys-bits too low (39)
-rw-r--r--lib/libktest.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libktest.sh b/lib/libktest.sh
index 506b050..ff6f08e 100644
--- a/lib/libktest.sh
+++ b/lib/libktest.sh
@@ -322,8 +322,10 @@ start_vm()
;;
esac
+ local maxmem=$(awk '/MemTotal/ {printf "%dG\n", $2/1024/1024}' /proc/meminfo 2>/dev/null) || maxmem="1T"
+
qemu_cmd+=( \
- -m "$ktest_mem,slots=8,maxmem=1T" \
+ -m "$ktest_mem,slots=8,maxmem=$maxmem" \
-smp "$ktest_cpus" \
-kernel "$ktest_kernel_binary/vmlinuz" \
-append "$(join_by " " ${kernelargs[@]})" \