From: Marcelo Manzo <marcelomanzo@gmail.com>
To: qemu-devel@nongnu.org, qemu-arm@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Marcelo Manzo" <marcelomanzo@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@mailo.com>
Subject: [PATCH v3 2/2] tests/functional/aarch64: add raspi4b full-RAM regression test
Date: Tue, 11 Aug 2026 10:35:39 -0400 [thread overview]
Message-ID: <20260811143539.7835-3-marcelomanzo@gmail.com> (raw)
In-Reply-To: <20260811143539.7835-1-marcelomanzo@gmail.com>
Guards against the bug fixed in the previous commit: boots raspi4b's
default 2 GiB configuration and checks that the guest actually sees
close to that (>1.9M kB), not the ~921 MiB the bug left it capped at.
Deliberately checks a threshold rather than the exact byte count of
either figure, since the precise number depends on how this specific
pinned kernel accounts for its own early reservations; the threshold
is comfortably between the two (943524 kB broken, 1905824 kB fixed,
confirmed by hand against this exact kernel/initrd).
Folded into the existing test_arm_raspi4_initrd test rather than a
new standalone boot, since it needs no machine state that test isn't
already setting up, and the functional-test suite is already slow
enough from how many separate guest boots it runs.
Signed-off-by: Marcelo Manzo <marcelomanzo@gmail.com>
---
tests/functional/aarch64/test_raspi4.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tests/functional/aarch64/test_raspi4.py b/tests/functional/aarch64/test_raspi4.py
index 35ba6c24f7..8506854d99 100755
--- a/tests/functional/aarch64/test_raspi4.py
+++ b/tests/functional/aarch64/test_raspi4.py
@@ -86,6 +86,23 @@ def test_arm_raspi4_initrd(self):
'BCM2835')
exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
'cprman@7e101000')
+
+ # We used to get the RAM size wrong; guard against a regression
+ # (see git history for details).
+ mem_total_kb = None
+ cmd_output = exec_command_and_wait_for_pattern(
+ self, 'cat /proc/meminfo', 'MemAvailable')
+ for line in cmd_output.decode('ascii', errors='replace').splitlines():
+ if line.startswith('MemTotal:'):
+ mem_total_kb = int(line.split()[1])
+ break
+ self.assertIsNotNone(mem_total_kb, 'MemTotal line not found')
+ self.assertGreater(mem_total_kb, 1900000,
+ 'guest RAM (%d kB) is far below the ~1.9 GiB '
+ 'expected for a 2 GiB raspi4b -- the second '
+ 'memory node above the 1 GiB peripheral hole '
+ 'is probably not being added' % mem_total_kb)
+
exec_command_and_wait_for_pattern(self, 'halt', 'reboot: System halted')
# TODO: Raspberry Pi4 doesn't shut down properly with recent kernels
# Wait for VM to shut down gracefully
--
2.47.1
next prev parent reply other threads:[~2026-08-11 14:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 14:35 [PATCH v3 0/2] hw/arm/raspi4b: fix guest RAM capped at ~1 GiB regardless of machine size Marcelo Manzo
2026-08-11 14:35 ` [PATCH v3 1/2] hw/arm/raspi4b: fix guest never seeing more than ~1 GiB of RAM Marcelo Manzo
2026-08-11 14:35 ` Marcelo Manzo [this message]
2026-08-12 10:24 ` [PATCH v3 0/2] hw/arm/raspi4b: fix guest RAM capped at ~1 GiB regardless of machine size Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260811143539.7835-3-marcelomanzo@gmail.com \
--to=marcelomanzo@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@mailo.com \
--cc=philmd@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox