From nobody Mon Sep 28 02:05:31 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=1785160467; cv=none; d=zohomail.com; s=zohoarc; b=ADsn9SvKghFBci3jYlM05diA3tSKokLKplGpi+2Cc0btho3VNpxngUCH2XWQxCIScH4NNDZTk2VY4Wm9Mia5gYnXqoBrQUOwfl+4wyg/2PjGRyV4piQkFMqVMzTmTK3YHG4LjPZzZzhvPvLxtn5QNndHePiuCIadzWvD7eK5+Ic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785160467; 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=J8DO1WDLqTsmlnAIT3YU2owuhvopJxlcibMXrtFGv1yAxcNp6QQH3uqgnlmR6VwrQFMj1wARF6EFVB2CjyGrx7NumPi7Oy7XKxFU/yC2DD8jeXWvIqHRktX6B37MfEMInv5eSNsi+h3/bdOuqjDLeqg2YuZtmYv3avwvKqQCORM= 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 1785160467325838.0132684136844; Mon, 27 Jul 2026 06:54:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1woLm6-0001kz-QS; Mon, 27 Jul 2026 09:53:46 -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 1woLm0-0001f1-VF for qemu-devel@nongnu.org; Mon, 27 Jul 2026 09:53:43 -0400 Received: from mail-ua1-x929.google.com ([2607:f8b0:4864:20::929]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1woLlu-0005pA-Qr for qemu-devel@nongnu.org; Mon, 27 Jul 2026 09:53:37 -0400 Received: by mail-ua1-x929.google.com with SMTP id a1e0cc1a2514c-96935063700so1637837241.0 for ; Mon, 27 Jul 2026 06:53:32 -0700 (PDT) Received: from localhost.localdomain ([146.71.8.128]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-97774ce146csm5199734241.7.2026.07.27.06.53.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jul 2026 06:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785160412; x=1785765212; 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=PT9IDqqI9HA04Ng73/fZINk8rPMab1Pa7PKGFtbWkHHON1aSagI3tNI9Tdw7NBkyOn 9GS3vFmU3zSIDNWprw4DAU1eCG2FwsU43/nySu/Slur4CxbDQ0It7MEfbCgwcAYfHvHx ng9DQjPWmj2oa4cbH63yJOd9htAfgzOjqPYvP9AwDPI0CXDA1IyiO+HzgA8+4NtHeFJh GB3dBGLDZsGzsuaSeMoFD4pPYuc8wnHOJn3U6/Ql/aNJiHkMhS0taMFL+IS6az8Ff/DO fdvBBq6cRCpyaStSUVCPcPfttUy8938FBj10uPWhOrYD4i7PRDUYsKHDopHoC/v1QWZf EQFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785160412; x=1785765212; 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=dNnFMpoa90j+oBpVOJiWQA0HEiLpx2nzMcmvZaPJa5CJTGuEtVjvUxRWWopR0YvcLN 4z0L6lIijOCsbLEmjD4OysmN4HJZCl7U6MEHhpZ+UhH1txvEnUGnmBHXymGNSR2kYEhU z3La6j4eAK+wo0Npdlm7mwRYltO2OY7x7U1N/rvMKT5aYrqucWV2G7lCuNHGL7dn7Tkj QNcKTBDVf6bB/lJHEX2HqRevfI0mel5Lemrnj+khD6JQhk9znu4ZZu3bd7Xd4/laXR4u iQbx4yNFLhHE4+WLwHk0dzCOFrp5IlGaSNitxOiLLB0dF1BxIbLN3Rf9UIBpE0c5QoqU ds/A== X-Gm-Message-State: AOJu0YwDB+m9cQOr1R2H5X3oqMwubPmyC0SSv4kg/0eUe504QmXzlpk8 3yjyHbDsd2Cb9Beemkp9bYGLChFkS/6soWGJe4Gba3FuOceiFLx7ck4QcW4/gQ== X-Gm-Gg: AR+sD13h1Alkfp1m/I20FoTJSETNUaNQmfdvVvA2Lv1fJmKKrIVlL/doM9CYmMDZ0b+ 1JpYsa7qnC+XR9qeL8gGwPoxMMBRAA55ARFr62/IwQ5P05tHOe5aIhZ/NeGQkyIoDrow+EFKExo PbBZp0GixiZ6XS/dT5DVBSVCyvdf2q4I1YXYRoQFa0235F+gCHksP1IEhjQgUMdfq9QgkdvvCWZ 1siN2lIiFC8vPY23I3EvCp13k6IuNsimhMbZC4F7KRp0maxPseQzNpdwOOIuUTO9I5nOWIRTyo2 uKdYsi5vP6v064fzVEMeH0Nma4SqjHVbAJqfiXYmXMMmX/r4LatlGPAtKFMux+h5uaZOKeGtlWT F5QZPQKQBYb0D481uCJXEKwHh374TFpSmA7HNAAnVEHtCtpXPjq8r/sMfYDiX/w9uoDgQjNd0vc XGn2yFWHdw7aWoa2WOorFqHYWXBBR7y89L X-Received: by 2002:a05:6102:508c:b0:738:1ef6:51b9 with SMTP id ada2fe7eead31-7503dd5664emr4844947137.5.1785160411860; Mon, 27 Jul 2026 06:53:31 -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 v2 1/2] hw/arm/raspi4b: fix guest never seeing more than ~1 GiB of RAM Date: Mon, 27 Jul 2026 09:53:28 -0400 Message-ID: <20260727135329.97190-2-marcelomanzo@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260727135329.97190-1-marcelomanzo@gmail.com> References: <20260727135329.97190-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::929; envelope-from=marcelomanzo@gmail.com; helo=mail-ua1-x929.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=ham 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: 1785160468687158500 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 Mon Sep 28 02:05:31 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=1785160463; cv=none; d=zohomail.com; s=zohoarc; b=EqWd+ucseGPqcqaJOuZLMePnGVV+h3Q/Ytf/bI+1tx6DWQOValPrnITCCIelB8GEFiKo2RcLWdyBDUGZy5kXTLpHGzuxSKxc8EUypMMbhXBW1oYI0EOREOnChmxn7bnu2tOhMYqHHboz+Ewy1/x7TEafJmnU0deTpPC3gjuyVvs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785160463; 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=def94g1ZgIpxexyd5K9cV/aLU41QcCQ1hBKGNGZuG60=; b=d1i8wgXLd4Rlj1ZdPbLrKFyLDFhC8xDtXsEfiEzm3pK1bK/6+m1lY6HarrKW2vrOWhy2IjgQD7I30oNEdP1c72IyndvFOP4MJ/IAZUzWZ4By4u3DVhYTCcsCJWr3YJrJRmpAU2/0zpHVGl4F+Pf69Y74O6/F/6L97QbeU5V64kU= 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 1785160463696706.1989279899034; Mon, 27 Jul 2026 06:54:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1woLm6-0001hE-4J; Mon, 27 Jul 2026 09:53:46 -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 1woLm1-0001f8-0q for qemu-devel@nongnu.org; Mon, 27 Jul 2026 09:53:43 -0400 Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1woLlw-0005pL-OV for qemu-devel@nongnu.org; Mon, 27 Jul 2026 09:53:38 -0400 Received: by mail-vs1-xe2e.google.com with SMTP id ada2fe7eead31-738bcf9a573so986986137.2 for ; Mon, 27 Jul 2026 06:53:33 -0700 (PDT) Received: from localhost.localdomain ([146.71.8.128]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-97774ce146csm5199734241.7.2026.07.27.06.53.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jul 2026 06:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785160413; x=1785765213; 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=def94g1ZgIpxexyd5K9cV/aLU41QcCQ1hBKGNGZuG60=; b=ip316vu3wbUxqEMoEoUBulDikYDTCPXeYgTGr9o4clmTevz/YBWS926P3XA/IGbpMJ DjirRfQnXdkBJm7U2IUoBquIyx34talxw64f4ByrOesmmYwQYQ7W7UR5RyGXsqsuwJuS idGUt1eiOrf6+fIKz7DcKbaewlJaClkbVxY2KDkvvOOENE4HUmB8CH/HewEDbNijV6ii uG/I1e6gfXFdzBA71kT2Z9mvNmPgNaUJeG2kpUlbqavktLD3ONPY4W47+TXEuiBmIe8f zyCbRqk2hK1d7klC1Ei/9i2yZSOmy9l1gMql9jH7hE5hmLrejcJ2MSbKNZO3TpZk4lRS G6hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785160413; x=1785765213; 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=def94g1ZgIpxexyd5K9cV/aLU41QcCQ1hBKGNGZuG60=; b=NkTGkYRi28EXvlDPb/xOBRfLEdAcWcqt4XH5tpZJWoLZsHu7mboNpZvY4+FKNz5PMn Xum1EiJt4uwGHdiEFdE1kOwTZ7NdW1EzzacRkLlNs+uDZ0zRpjQTmq7QAmuFaaTNS54+ GV+tnKwQLOoD57V711IxI/xyQ+d9qA69mxflg6g524o9CV8FbBXoKKhZuvLXHj3L0dXV yS1BFDNRWSJc9o1/DLjSfv3CuKgzFSKVrusKVLSr8qDw9JdnfUaJBuNCMS75dflhkl45 EaELMkMIIE2a7yI/ctsZ7m/GofMwGufU+yhiVyjENOHyzzcRf+kHFPAd/RH1SYo3Fscs wU4g== X-Gm-Message-State: AOJu0Yz/ufRYIO59qqo2cVDIFk8ot9BO1qmLBFo/faFSRS3fiChaYXSR LwPv4fOLIn/DxczYo9nYL5oo2pWCaDdl2UkHhXt9MuqFwc9dR2HkaTgJWcyTcw== X-Gm-Gg: AR+sD11EfdmcLYnOMMVdLOWbBclEd5u6tkcH5Av1YLIlzAYlfGrtOG9XGPKNmbUJu5Z B03z3uz3pnglr7e9eak4cMUfP+BGhLl2uxbOjasRcgCLeOC2mt8trV98uHGwlwmhJQGnZzoifsP pQ8JetemFReCvVJAGFwClQsi8cM2HWw9Wj90EJRowMjzvQSMhWuqQUnmA83guXSQXMuY8NIhX4s hNxwOMIg5YX9XEOsLUIQq2WsXJhm5cSHXVrz0sznz5BcjHDfQuEVlYAP+Zqr5wGrCmPRFX8hka9 x7N8wo1NHD+3RKRptt8ZEH7DKIaawi+k4pD1Md4cadwINcpBq43JQVIB3/8pb+am6GsyZjbANx6 6ZPVGvwcy/q/xERORpaaQ6DiFKa2dCgn2WfKUHc57AVcM+rhH45fJWdbIyGBK3P8QPk7GEqoVIC O0yOPfr8EnQQCjiyUYjpgAHUoZuhuTHtWZ X-Received: by 2002:a05:6102:5126:b0:745:78d4:4856 with SMTP id ada2fe7eead31-7503e472da2mr4029224137.7.1785160412803; Mon, 27 Jul 2026 06:53:32 -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 v2 2/2] tests/functional/aarch64: add raspi4b full-RAM regression test Date: Mon, 27 Jul 2026 09:53:29 -0400 Message-ID: <20260727135329.97190-3-marcelomanzo@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260727135329.97190-1-marcelomanzo@gmail.com> References: <20260727135329.97190-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::e2e; envelope-from=marcelomanzo@gmail.com; helo=mail-vs1-xe2e.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=ham 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: 1785160464528158500 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). Signed-off-by: Marcelo Manzo --- tests/functional/aarch64/test_raspi4.py | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/functional/aarch64/test_raspi4.py b/tests/functional/aar= ch64/test_raspi4.py index 35ba6c24f7..55903e93d3 100755 --- a/tests/functional/aarch64/test_raspi4.py +++ b/tests/functional/aarch64/test_raspi4.py @@ -154,6 +154,57 @@ def test_arm_raspi4_rng_thermal(self): exec_command_and_wait_for_pattern(self, 'halt', 'reboot: System ha= lted') =20 =20 + def test_arm_raspi4_full_ram(self): + kernel_path =3D self.archive_extract(self.ASSET_KERNEL_20190215, + member=3D'boot/kernel8.img') + dtb_path =3D self.archive_extract(self.ASSET_KERNEL_20190215, + member=3D'boot/bcm2711-rpi-4-b.dtb= ') + initrd_path =3D self.uncompress(self.ASSET_INITRD) + + self.set_machine('raspi4b') + self.vm.set_console() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'earlycon=3Dpl011,mmio32,0xfe201000 ' + + 'console=3DttyAMA0,115200 ' + + 'panic=3D-1 noreboot ' + + 'dwc_otg.fiq_fsm_enable=3D0') + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-initrd', initrd_path, + '-append', kernel_command_line, + '-no-reboot') + self.vm.launch() + self.wait_for_console_pattern('Boot successful.') + + # raspi4b's default machine RAM is 2 GiB, but raspi4_modify_dtb() + # used to compare the wrong field when deciding whether to add a + # second memory node above the 1 GiB peripheral hole (it checked + # the boot-loader's kernel/initrd-loading RAM budget, which is + # itself always capped to at most 1 GiB, rather than the board's + # actual total RAM) -- so that second node was never added for any + # raspi4b configuration, and the guest never saw more than ~1 GiB + # regardless of the machine's nominal RAM size. With the bug, + # MemTotal here is 943524 kB; fixed, it is 1905824 kB. Guard + # against a regression back to the ~1 GiB figure without hardcoding + # the exact byte count of either, which depends on how this + # specific pinned kernel accounts for its own reservations. + 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') + + def test_arm_raspi4_pcie(self): kernel_path =3D self.archive_extract(self.ASSET_KERNEL_20190215, member=3D'boot/kernel8.img') --=20 2.47.1