From nobody Wed Aug 26 07:24:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1786459042; cv=none; d=zohomail.com; s=zohoarc; b=JfM8ASq3wA39lPmlMHEUwcF9T3rfA/3WfZ7aykUeNTvzoDuoVQegYB5d/Q8/LFpG6GI5kpSQtyJOsrCDkAFFO+jOAB+hQNIsyjeWR7n1fQX22nB0eR94PFd9v+eXm2/nNngCG1zHp7DlAA2a5VKAdwuqYRS1Lx3zVqh4qh8+7O0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786459042; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nUDoFYam/Cs4djr+4VD+W1090TdsQ0zW6Cv5SU9lt7c=; b=L0JmRxCRwgm2yClgTlMGf26O5T75nDJ6FQ3ONaaGujG7pXq0KKsHZflPGMolVliE7QkIJEChaYpwiV/CHlfwL8J5jEvJuyCopYxfVa+Q1tEYegFAUJb8O8tBdLHdh+BtmmB9h8F9mRxcEzBg314dzhEfZQ1/esYazSJbk5CSiFQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786459042301702.5694788213867; Tue, 11 Aug 2026 07:37:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtna0-00005m-6V; Tue, 11 Aug 2026 10:35:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtnZy-0008WQ-Mf for qemu-devel@nongnu.org; Tue, 11 Aug 2026 10:35:46 -0400 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wtnZw-0001oX-C3 for qemu-devel@nongnu.org; Tue, 11 Aug 2026 10:35:46 -0400 Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-8f29ec73064so17583576d6.1 for ; Tue, 11 Aug 2026 07:35:44 -0700 (PDT) Received: from localhost.localdomain ([198.16.145.87]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90a6c3ec565sm376396d6.43.2026.08.11.07.35.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Aug 2026 07:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786458943; x=1787063743; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=nUDoFYam/Cs4djr+4VD+W1090TdsQ0zW6Cv5SU9lt7c=; b=D8H7Kj4AW4tN2gP+xyIWGEcTJ9VDeRPfOeXhCVR0NKvfNiTc7ozzhfaTkcexgMN1Io CP/RwBQMc87Td1A5itGJLrbgH8IbNI3O96wvqWuxrhlHRBrQuf6JyjCGEyYEPDyhugRP /yaylbivvgJ+t95mR2/5eThY/N77iDfOp2m7DsZ1HrM99ZDZvbmteCEiSJm5FlN6SCMu ro/bcCcxzw/q9dXhiqMFnH7yQNzGOJ7a/GbfCjzgReCXvMOn9gtg59vUSCwrU6chGcJi P4tWWtUv6IRKFx5bdj4LmwXEZNaSN7EgWd2PVvQow41J21LGvpUjv4pdr1TxMpQbl9LD IPoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786458943; x=1787063743; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=nUDoFYam/Cs4djr+4VD+W1090TdsQ0zW6Cv5SU9lt7c=; b=n+vFpBNwxclSPGXWI11yNNvMyOHEkEAxDC6uhbdPpdzd9f0o3QOn7vFMi8T4UYUa+a Vij2hKgE6GntsDboGYkfEt6Y17U5lD1vXp/OtZKUkWRboWniQ8b5KN5hF6z9YUEMsfPw KE22IwwoAukJNlh7QnScVb7nVCp+Fno3jnhT2isKWNXYLY2jIf86tKzKe4z7lMNy1HyU oM6FPltI51fqIRX9jJEinGNX4voCYRWtJxAGArOA6+Ed5WMmtgzkm8FfZBilMq2J5bDS ez1qYXBdeSRg9f2wB8lndNjEDlJ4b8WpUL/NF0qswxOuZQjMvWfZOYa272qsHBj/CdzG c0jA== X-Gm-Message-State: AOJu0Yyb8Kbs8pUqXqFeMXxkNcNgHP0bMNpeqLrYyP55Gxq+D6vM2yd8 Ci5W2qP4mITApgnOlaJ4114frN8rWQUlw79NM/F22WCu6g4jIscv8vL6ySEsBQ== X-Gm-Gg: AR+sD10bxAoITlNf1xVToOa33X8tHI05BR8uvLqNLLstEKNddHfOht6ZpSPyMq73kEv Wf5yCxcgT05DXbMYBittzzYYQwJzvnm01L5lfHNXaRCcd47WpHP0crtUobfWRLQQEBzqOyv/P4p 1Z/8brW9BGBHzyGOeeF9wb1NJF3QSEujwsl5163SfHzE93Zw/ILrzwRZsq+3L7CEc+gMVRsic3o aGfUlSzFKh87EgbDEU63iYJGrqOhyzo1TrccJyoLiRFhFK6KeyUFW12pfsg74CKora/VssmhSmK GpAek2qLs+gx2AQtfcGbAtgyZYKOxUguYXp1wwaun+qKwNT5mK5mWNO+SWgx7KPODc0RCbVHPeM 8avoO4QThEc3jEWpg4avscr8iNRuO3IMeq19LxBxLZ6zcztKCRz68B6WJQ5kAkjuiEjs0DrTk4d +7c/cNraqZv0qkjMNLLHq1ZU4CzZT+J9oQY2pRZNnsXU9KMjlvY9phN9gz31l6Tc8hztnatpD9k OYe6Q/tNpuHG5fM4kM= X-Received: by 2002:a05:6214:540e:b0:8f0:5b55:1f64 with SMTP id 6a1803df08f44-90a66901679mr36615686d6.20.1786458943057; Tue, 11 Aug 2026 07:35:43 -0700 (PDT) From: Marcelo Manzo To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcelo Manzo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 1/2] hw/arm/raspi4b: fix guest never seeing more than ~1 GiB of RAM Date: Tue, 11 Aug 2026 10:35:38 -0400 Message-ID: <20260811143539.7835-2-marcelomanzo@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260811143539.7835-1-marcelomanzo@gmail.com> References: <20260811143539.7835-1-marcelomanzo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::f35; envelope-from=marcelomanzo@gmail.com; helo=mail-qv1-xf35.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1786459043736158500 raspi4_modify_dtb() decides whether to add a second memory node above the 1 GiB peripheral hole by checking info->ram_size -- but that field is the boot loader's RAM budget for loading the kernel/initrd/dtb image, itself always capped to at most UPPER_RAM_BASE - vcram_size by raspi_base_machine_init(). Since that capped value can never exceed UPPER_RAM_BASE by construction, the condition was never true for any raspi4b configuration, and the second node was never added: the guest never saw more than ~1 GiB of its nominal RAM, regardless of the machine's actual size. board_ram_size(info->board_id), computed one line above in the same function, is the value that was actually needed -- the board's real total RAM, not the boot loader's own budget for where it's allowed to place the kernel image. Confirmed via direct measurement inside the guest ("free -h" / /proc/meminfo) on raspi4b's default 2 GiB configuration, before and after: before: MemTotal: 943524 kB (~921 MiB) after: MemTotal: 1905824 kB (~1861 MiB) Also verified against two real, unmodified Raspberry Pi OS releases (Debian 11/Bullseye and Debian 13/Trixie): both now report ~1.8 GiB of usable RAM instead of ~900 MiB, with clean boots, working SSH, and no kernel errors on either. Signed-off-by: Marcelo Manzo Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/raspi4b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/raspi4b.c b/hw/arm/raspi4b.c index b92840e1b6..821ddb42ed 100644 --- a/hw/arm/raspi4b.c +++ b/hw/arm/raspi4b.c @@ -64,7 +64,7 @@ static void raspi4_modify_dtb(const struct arm_boot_info = *info, void *fdt) =20 ram_size =3D board_ram_size(info->board_id); =20 - if (info->ram_size > UPPER_RAM_BASE) { + if (ram_size > UPPER_RAM_BASE) { raspi_add_memory_node(fdt, UPPER_RAM_BASE, ram_size - UPPER_RAM_BA= SE); } } --=20 2.47.1 From nobody Wed Aug 26 07:24:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1786459022; cv=none; d=zohomail.com; s=zohoarc; b=iL+bKsc1Sgntdb8A9B3IutGpIz3xXkvQLCwbHPpJCOo41jJYEj5AtrFHmlCK/83/kGs6LUKQ1hikekR2zLzoFmqpJKoTFZLJaoshs6ufaEyM0U2K46/V2hUp7RSB6sabDiMYtL6ZuFyXW5AOn0z/JydqnRbPFIWmgZvpuvALBMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786459022; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qtwJ48c2jv1FFgaa3GcNc1BiQL2QiF7L65p40Cem4T0=; b=aiuM0EyQTmPVoKmPQk62vUB4DLwMsYrOQfO3K+GiQ5Fv6/zWEnHp10p9gh4/5xMAq8Z0mydyYbfuiONhKwNXkTNBzl5yMOWd1FjlqIPx7u1DYBNjiJ1ju7L0RnyIb6cosLeXwM1nVTUd/o5YdWD69gfcaC4FMUcq/XpW3EfyNbU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786459022278277.0621287522757; Tue, 11 Aug 2026 07:37:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wtna0-000068-JG; Tue, 11 Aug 2026 10:35:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wtnZz-000055-3U for qemu-devel@nongnu.org; Tue, 11 Aug 2026 10:35:47 -0400 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wtnZx-0001oj-EG for qemu-devel@nongnu.org; Tue, 11 Aug 2026 10:35:46 -0400 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-51c05dcdf49so30248991cf.0 for ; Tue, 11 Aug 2026 07:35:45 -0700 (PDT) Received: from localhost.localdomain ([198.16.145.87]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90a6c3ec565sm376396d6.43.2026.08.11.07.35.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Aug 2026 07:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786458944; x=1787063744; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=qtwJ48c2jv1FFgaa3GcNc1BiQL2QiF7L65p40Cem4T0=; b=jCUPPo1PuVjifc5P8py4KEx+NyON8DhRqLFXi9mLb0Y66vOSSacHBZ7Z2LNaUKVD2K 1SRRue4WS9UpLh+dq03RmC64++fbekkYnP9VB1zM3kK6EPMwRufv5z01uV76JOQO39ub 9Awtl7oDsd4pDmZCI8U4HX4jVtU6e6Q3/16Eb2OFAi8bhgI6Ue2FEBKQjHpe0JMmDrPL unUM/20ukUZ+TuFf65XvoiGILyzwVUxQxkDKVtOg35arSSsdv8I5Q75nOL7kL7gJ5Rda YKGyMbPSvrS+blX8j/wV6bPPddXZkXolTnKyzP2v6z5/OGkEIs/CoajN/pnVyQ2903mJ e2fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786458944; x=1787063744; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=qtwJ48c2jv1FFgaa3GcNc1BiQL2QiF7L65p40Cem4T0=; b=mXCa3sk6PmXW8l4y9i+SsTB9LBD7uPRdoicVoi6caggTUZcEjjPapcZ2K0MKOgi8nm JjOoJMub81Oi2ju5iinDLL9zv/Z6NwjzwPgsDuW7DbveRWARTULLdG8voSKZ529Cno/t lFnxg7mCJCvvJuP9b6BAk5tod2gTmZfGuqDZw7Yjm+P2rRydby34TcfFst5v87jj22DA sxdlevyKb+NPMDXv6zFNgnpDg9noBcPRYzMRnAfKfvV2E1bP5EPDZOmets27iCZwmJZM soN6YMkcfuH+qMg3TNd2ZWjx71tWbcYoPwY72+4ZSX3cm48OdweO6WeLpWOhCehBr+gQ qj+A== X-Gm-Message-State: AOJu0YxbumwLP2WkpYya5W+S27Q/gj0Qyv7nuZQRfEy57VZ5nAMcrsek 09TdsKLBFsYrtrGENz6FPgXoAntbrRxb1QUFgg85yT5nPO4H27sFtJmGP4ZeIg== X-Gm-Gg: AR+sD127bPsvg/9ptVhCOBUvNd6plW/r6WgxEn/SPBjBkn0GN629o9aEbfdLBn3iitF 5OcbqY9Fl+Kz+83/hUo426oSJBvzVFzE9kjZxY1pm4dD0bw25SrNTWQakJORhgnAkeMvq8jORja jufmSg2n98ITLyFAiYkLj4Ld8VXxXdVwDSo9BkVFsg+4f2W4NUI3VOK4Gs1IN/xAQipJH9a+cyF Qg6AF4qUEO18ZRxgTjukyq7N8/Dx7Xuze65MNl/wTUdM2jh2J2UWZso0dhHBe7jBnRlNugyXDY/ adsk6lcKH1u0b0gulLAt3bwVOYEkNkK5S13jH4Bt46dJiDMh8GUsW1UPnjl+AfljpkV5tdnwfD3 T7xF163gNdTFTwRl/5pLFg2WeHxD6dqD6RVEHFhRDQPAMtLmfzoodL+r31vUYM0IqcQOjWnqw/6 yrujRTWCQS/I9e/q+TY1fvu+bLWjRMGIswiLtIAUgmdNP/eD1oCpkZOtHkhGE5p7q3pdgy4WQ+r jU7dcpIqQlYhjacv3U= X-Received: by 2002:ac8:7f07:0:b0:51c:239:42da with SMTP id d75a77b69052e-52d584f6403mr33135831cf.15.1786458944155; Tue, 11 Aug 2026 07:35:44 -0700 (PDT) From: Marcelo Manzo To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcelo Manzo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 2/2] tests/functional/aarch64: add raspi4b full-RAM regression test Date: Tue, 11 Aug 2026 10:35:39 -0400 Message-ID: <20260811143539.7835-3-marcelomanzo@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260811143539.7835-1-marcelomanzo@gmail.com> References: <20260811143539.7835-1-marcelomanzo@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=marcelomanzo@gmail.com; helo=mail-qt1-x835.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1786459023507158500 Content-Type: text/plain; charset="utf-8" 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 --- tests/functional/aarch64/test_raspi4.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/functional/aarch64/test_raspi4.py b/tests/functional/aar= ch64/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 =3D None + cmd_output =3D exec_command_and_wait_for_pattern( + self, 'cat /proc/meminfo', 'MemAvailable') + for line in cmd_output.decode('ascii', errors=3D'replace').splitli= nes(): + if line.startswith('MemTotal:'): + mem_total_kb =3D 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 ha= lted') # TODO: Raspberry Pi4 doesn't shut down properly with recent kerne= ls # Wait for VM to shut down gracefully --=20 2.47.1