Skip to content

Commit f1f9bdb

Browse files
committed
T9014: Makefile: cap TEST_MEM at 4GB on arm64/aarch64
QEMU's virt board cannot place guest RAM above the 4GiB boundary when the vCPU only exposes a 32-bit IPA range, aborting with "Addressing limited to 32 bits, but memory exceeds it by ... bytes". Force TEST_MEM to 4 on arm64/aarch64 regardless of host RAM to avoid it.
1 parent 4058d50 commit f1f9bdb

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ UEFI_FLAG := $(if $(filter arm64 aarch64,$(ARCH)),--uefi,)
1212
TEST_CPUS := $(shell printf '%s\n' "$$(nproc)" 4 | sort -n | head -n1)
1313

1414
# Common memory size (GB) for QEMU test targets: 8GB if the host has at
15-
# least 10GB of RAM, otherwise 4GB
16-
TEST_MEM := $(shell awk '/MemTotal/{if ($$2/1024/1024 >= 10) print 8; else print 4}' /proc/meminfo)
15+
# least 10GB of RAM, otherwise 4GB. Capped at 4GB on arm64/aarch64
16+
# regardless of host RAM - QEMU's virt board cannot place guest RAM above
17+
# the 4GiB boundary when the vCPU only exposes a 32-bit IPA range, and
18+
# exceeding it aborts with "Addressing limited to 32 bits".
19+
TEST_MEM := $(if $(filter arm64 aarch64,$(ARCH)),4,$(shell awk '/MemTotal/{if ($$2/1024/1024 >= 10) print 8; else print 4}' /proc/meminfo))
1720

1821
# Test targets forward extra CLI arguments (e.g. `make test -- --match foo`)
1922
# to their scripts via $(MAKECMDGOALS). Those extra words are also goals as

0 commit comments

Comments
 (0)