From nobody Tue May 21 08:39:22 2024 Delivered-To: importer@patchew.org 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=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1578507443; cv=none; d=zohomail.com; s=zohoarc; b=McsW7VFGemFzOI9gbPryw6dVbGGEoXd9vGky4R3fXVcFbgJ6BQSFt8N35sduKx/w4lKfLJf/TNETVSmL/dWOUhJLfTYDJjNMCduH9KlP2s7dD8ms0FE7gHDH8bXUKCzPXDq+aivORH6gR4I0DaB9+sYKMlQKaxP9CVnDxc/t9eE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578507443; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=y2Tg6RArKJzvW5SKrSp0DhhlfAmjIjBGMeoq3WBnASo=; b=JrZIYD7AsPm2Gg17mZfkDyTqfRJ8AZdn4neyE/wSXeXG7qm3HgLzeEZXKUho/pYJVam8U8rOEwJIiDf9mj+8O9X29T1m4s9zSg8WwMy7Ce7DNs71xg3hSh9GGGPtFqO6ZIlBMS1AUxa4xOGrXsHib12sNhtNyOAC76vXmyF5gF4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578507443072151.24627150242407; Wed, 8 Jan 2020 10:17:23 -0800 (PST) Received: from localhost ([::1]:47760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipFtR-0002dz-HF for importer@patchew.org; Wed, 08 Jan 2020 13:17:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36888) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipFqh-0007rf-Rn for qemu-devel@nongnu.org; Wed, 08 Jan 2020 13:14:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipFqg-0000iV-Us for qemu-devel@nongnu.org; Wed, 08 Jan 2020 13:14:31 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:34277) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipFqg-0000ht-Of for qemu-devel@nongnu.org; Wed, 08 Jan 2020 13:14:30 -0500 Received: by mail-wr1-x442.google.com with SMTP id t2so4482902wrr.1 for ; Wed, 08 Jan 2020 10:14:30 -0800 (PST) Received: from x1w.redhat.com (34.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.34]) by smtp.gmail.com with ESMTPSA id l19sm2908653wmj.12.2020.01.08.10.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 10:14:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y2Tg6RArKJzvW5SKrSp0DhhlfAmjIjBGMeoq3WBnASo=; b=L+4AsO7uMVQQREXVcFhnoinweGpKQ7NZ+XlcsHULvpr77OaFD4/32aZa9dY7ee7tuQ XhJybgi9vcPqD/1vEEwryigEYNlwUj8QQRGFzWEq4UvNLACBq1vbDDLno+yL+6CXWhl9 X+3aiv9MqkdH41xhr2mlDYDMkXUxvfQfp5ifoG57h/ffcrT3/6As+RXuaXUm1rvo7fVB orTc4pJLYRssdVq4E3AwVjCdEmN7UVYuqYnl3wvj0vlHiJDhPRoLRT9VtUkxvpinlvmo vOE9XhFsC4MjIRisEs9h+siAoQpQ3fdXJD2sJPQwC9neg23Ae3q1mV7C3GWMVnlQvbOO smvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=y2Tg6RArKJzvW5SKrSp0DhhlfAmjIjBGMeoq3WBnASo=; b=f+Ak6v/RmWxuKRei85Em9iGuKAwRakCpnYLhtHUtob5H6eDSgwBYQ1LO+rkOdZM/xP JjRdRvVNY+OzOxcU4a6VN4sDnm2KVaIw2HVjA1mbtnQT2m7wZQiPkOKAuDpKfZ6kqoqU BF1M75w5DuqnDi/468ap5nWp1WNQRrAkb+cp/6jo/ScLKGG3LsLVxJxdsyVi7vwp9Ptf MUFIt4FkK27zbjSliF63c9XTRW7GEdmkXNLk2luMn12uylud6S5kJXLA2TkxwqcRZd7f thvfcQtOHBGOGNcAt3MiJHRtmqAEXfqjUsLaOgWd+sM3VWxSRmA583ABr1HvtnmN72hE JPFw== X-Gm-Message-State: APjAAAXF+f3Vr1ayhvykM2Jr8n7aiSk+Jd/Hnl5/uH9YWMCGSL3tSnEu gIlw5OZQQ868MhtRtN3wpOI= X-Google-Smtp-Source: APXvYqzih1S0+U1RwZyXikRP2XIG4hl2hltAMAZDoM1DYlAspi84x4qcUnp3CxAeBsn4KryOH4a+Jg== X-Received: by 2002:adf:e6c6:: with SMTP id y6mr6093125wrm.284.1578507269853; Wed, 08 Jan 2020 10:14:29 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Igor Mammedov , Helge Deller , qemu-devel@nongnu.org, Sven Schnelle Subject: [PATCH 1/3] hw/hppa/machine: Correctly check the firmware is in PDC range Date: Wed, 8 Jan 2020 19:14:23 +0100 Message-Id: <20200108181425.21485-2-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200108181425.21485-1-f4bug@amsat.org> References: <20200108181425.21485-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The firmware has to reside in the PDC range. If the Elf file expects to load it below FIRMWARE_START, it is incorrect, regardless the RAM size. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Helge Deller --- Note we define FIRMWARE_END=3D0xf0800000 but in the specs the PDC ends at 0xf1000000. --- hw/hppa/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 5d0de26140..6775d879f8 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -155,7 +155,7 @@ static void machine_hppa_init(MachineState *machine) qemu_log_mask(CPU_LOG_PAGE, "Firmware loaded at 0x%08" PRIx64 "-0x%08" PRIx64 ", entry at 0x%08" PRIx64 ".\n", firmware_low, firmware_high, firmware_entry); - if (firmware_low < ram_size || firmware_high >=3D FIRMWARE_END) { + if (firmware_low < FIRMWARE_START || firmware_high >=3D FIRMWARE_END) { error_report("Firmware overlaps with memory or IO space"); exit(1); } --=20 2.21.1 From nobody Tue May 21 08:39:22 2024 Delivered-To: importer@patchew.org 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=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1578507340; cv=none; d=zohomail.com; s=zohoarc; b=KBPVHqsedtmiRPibQbSXqQVMsBoDdyTnqtaPS1fajxcEX1KWvBTwazcvRYie9vdB4qrwCISzyA3X7GvUGBghG4+3kNczU4BkEGLb/wcwPx6iZ8SM/nx8KYS7hfrLJAydM/wgvxjvU2dZCLTxtfG1U4+j2OXcaa+YaIjDgjl8Efk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578507340; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Y0nCBh7LvS7wrnGHA1PHHJW7ya35z6WKzjOhE+TYtds=; b=inni3Lud8lWnl20INjcWWBi467Tn/VshZRpjxo1Du3l4zQZ6SenLLPY6vJ6S2ObVcGf2BBM0hMH37Dwuc4pY+BmZZoaC9obCORNaA/R69iiZOKaMmzgJETW7p0H4dTm7lTDYBdyB1N2P+CAhFhAqzigF3QAZlueLqmT9RgruZPQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578507340119320.242140207681; Wed, 8 Jan 2020 10:15:40 -0800 (PST) Received: from localhost ([::1]:47740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipFrm-0000M3-Nj for importer@patchew.org; Wed, 08 Jan 2020 13:15:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36924) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipFqk-0007sv-0a for qemu-devel@nongnu.org; Wed, 08 Jan 2020 13:14:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipFqj-0000js-1m for qemu-devel@nongnu.org; Wed, 08 Jan 2020 13:14:33 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:34140) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipFqi-0000jN-S8 for qemu-devel@nongnu.org; Wed, 08 Jan 2020 13:14:33 -0500 Received: by mail-wm1-x343.google.com with SMTP id w5so227068wmi.1 for ; Wed, 08 Jan 2020 10:14:32 -0800 (PST) Received: from x1w.redhat.com (34.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.34]) by smtp.gmail.com with ESMTPSA id l19sm2908653wmj.12.2020.01.08.10.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 10:14:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y0nCBh7LvS7wrnGHA1PHHJW7ya35z6WKzjOhE+TYtds=; b=HZ5s/Lq9qRRyE8yRT99Fh/JCCQslPKifdQW1Ri4lD/m1L2lEXy/jt73vBEV2tKjjkg m1VgDfqfYbLuuDYc0pYVJ7aKs5/cMZ/+Cg8gDLVsRcRKR9uwJ6U9QbyixR51rbvwVAyT yl9bJbyHHrvpV9UQbuNWRr4917dPA2oaB+JHObvjK+QfmUcy1hOjVi6LfRWVh/fdctG0 BHkzmffCA7GYSzDprbIFNHzUwEB9WJyi1PHYczoVM0LjxzxW2GJCW2ZEzknvgdwqy4N1 DQ5YgrcQLiGxiNtu9N9JLnKNn/0UyIBUKLax5vakHHZymLq3V9pKC+ZROmYvitJZP0/n vTzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Y0nCBh7LvS7wrnGHA1PHHJW7ya35z6WKzjOhE+TYtds=; b=Cp6FZ/4GrXhW3sOx5rcCjdwS8+9UxTmHLZCaGappxDNC+nppqNOW9APJX942NdVxzG /UtrkW4xaZ45QFsG5enTOb9qzd5/0UwMw7D8Q1PYMKcWMwil4yxxK6UrOyHP+6zwkeQz XqguAeEE0sCkSsAaJH1hbN3znC2Brjtju/w50zkaJtHEkLkqolEHb2KvbhdabKvjN8KH axGNzeWBDiPcrCQtiUfoHxn+38bRPR5QyxklesUF2ZaJ1wMO1nogmRaWquJMDQpz8Ye7 GGhu6H7Z9Tv8fUHiyU8O3YgRteZtbyVIdASPiA4WsTp9bxApnOCGf2hY+okcuSAQolQB D1Nw== X-Gm-Message-State: APjAAAWxq4j2TmPNTwHQC9SPS6A2CV1Ypqyf40qpy7nlasx/qJwDX+2G P5ymlBK+B/lXTRukXcTLSf0= X-Google-Smtp-Source: APXvYqwS9mTtCD+i1gqnZJXih6C4kIdZ7CtYv+eiP26Rza616D3p8SoH7BbC0bTjWTphua8FeCHdlA== X-Received: by 2002:a05:600c:224a:: with SMTP id a10mr5536589wmm.143.1578507271982; Wed, 08 Jan 2020 10:14:31 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Igor Mammedov , Helge Deller , qemu-devel@nongnu.org, Sven Schnelle Subject: [PATCH 2/3] hw/hppa/machine: Do not limit the RAM to 3840MB Date: Wed, 8 Jan 2020 19:14:24 +0100 Message-Id: <20200108181425.21485-3-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200108181425.21485-1-f4bug@amsat.org> References: <20200108181425.21485-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The hardware expects DIMM slots of 1 or 2 GB, allowing up to 4 GB of memory. Accept the same amount of memory the hardware can deal with. The CPU doesn't have access to the RAM mapped in the [0xf0000000 - 0xf1000000] range because this is the PDC area (Processor Dependent Code) where the firmware is loaded. To keep this region with higher priority than the RAM, lower the RAM priority. The PDC will overlap it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/hppa/machine.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 6775d879f8..d10c967d06 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -90,16 +90,15 @@ static void machine_hppa_init(MachineState *machine) g_free(name); } =20 - /* Limit main memory. */ - if (ram_size > FIRMWARE_START) { - machine->ram_size =3D ram_size =3D FIRMWARE_START; - } - /* Main memory region. */ + if (machine->ram_size > 4 * GiB) { + error_report("RAM size of 4GB or more is not supported"); + exit(EXIT_FAILURE); + } ram_region =3D g_new(MemoryRegion, 1); memory_region_allocate_system_memory(ram_region, OBJECT(machine), "ram", ram_size); - memory_region_add_subregion(addr_space, 0, ram_region); + memory_region_add_subregion_overlap(addr_space, 0, ram_region, -1); =20 /* Init Dino (PCI host bus chip). */ pci_bus =3D dino_init(addr_space, &rtc_irq, &serial_irq); --=20 2.21.1 From nobody Tue May 21 08:39:22 2024 Delivered-To: importer@patchew.org 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=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1578507523; cv=none; d=zohomail.com; s=zohoarc; b=VsGLH4zsMjhrly2e4jZQmruuc6OqiSLvLaZz9z77s+qNE5QrMErMhpv9eM7FmbmQZTVGmPN4dSCyIK+OSS5eNdUSBm6LnHKbcy4lxf1Im6UQxebhmBuA4eF4FBvOqPjk3Vf+g4UnBkyuBLw2rDjmKvq1gliOYU06g2XyG4mAsJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578507523; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kXtcRU+evWm4ZwyBxV8pmjYNaAs60PlKYV5qf3mHeDM=; b=FZqDxBJZXJGxLEoO2RoxNRsCwh7wRyHwnIsAmncd14Dg9MaHXKOp1UCjDGiBDJ4PM75hDNQMl4b2zot4yZrcUeMFqednJal8+AAEf+vJ5rttGKE5xCakgUORfxKJsyrucexZWbbvPqD7HuEPwqUgxF7dP05BOQiouR0TrqMxW78= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578507523452602.4318242037924; Wed, 8 Jan 2020 10:18:43 -0800 (PST) Received: from localhost ([::1]:47770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipFuk-0004GS-78 for importer@patchew.org; Wed, 08 Jan 2020 13:18:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36957) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipFql-0007us-Hu for qemu-devel@nongnu.org; Wed, 08 Jan 2020 13:14:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipFqk-0000kw-9z for qemu-devel@nongnu.org; Wed, 08 Jan 2020 13:14:35 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:41006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipFqk-0000kD-42 for qemu-devel@nongnu.org; Wed, 08 Jan 2020 13:14:34 -0500 Received: by mail-wr1-x441.google.com with SMTP id c9so4407806wrw.8 for ; Wed, 08 Jan 2020 10:14:34 -0800 (PST) Received: from x1w.redhat.com (34.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.34]) by smtp.gmail.com with ESMTPSA id l19sm2908653wmj.12.2020.01.08.10.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 10:14:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kXtcRU+evWm4ZwyBxV8pmjYNaAs60PlKYV5qf3mHeDM=; b=fKyQkm5A5TyB9ooCiKZxDdbvZvj9jS4PZaBW78UD8jhasA98Gsa5ITpQWI9ZyJHJbf aXuNYG5l9kctqArIcOb5MY01pAoISbyNuEmGLRNeq8NAKvzfW92q/Ru/KCTBQhcs41pz 6gODm2CT2B19JcNhcCq4ZR7nSUgAA2mLauyZPLFMwKT5yor96iO0FfXX3sokAWKdihNy YPp7a9kuE+Iwmz2hFNCL67m8yWY770JxMsAlBgZmtPpOezwRJ+cCzGNX/S5Rtk8mwvK9 NWtEySznJIEAaLasNh/C3bweSBC2os8098vZTRmkkfcTR5ks4OGiia1SgrBmNoZSHUR7 QT0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kXtcRU+evWm4ZwyBxV8pmjYNaAs60PlKYV5qf3mHeDM=; b=I3I7fgg/ilRYBZ/ZhX2Ljkv7NQqiplnsD/KQINIE0Xqk5fecFvX0Lq2TE3aUPI2L8W CMaye+4pbaaPoE4ZMUuJe99XZfE2mVwJ0luaQcvu3KUFucLSDFymiWc4SEBkz2bglff6 otwVpZss4ckAjin7QJeyjmGSDnMNA4dh9FJ3S2AClm+0P8YduPltZtcdOVBZmYCkRis0 DlkX9Rxx+COhyrOFetT3nP49XXkOjLEvPh2j91mmuKX0nxtWw6kF+DHge6U4rLacgrjc C3pjCY1QGk8ydXe3uNqvASyj9jZqM4rYDs4R2KNRTewm80OdsOlyqh4//puSCrKAt3cY q3bg== X-Gm-Message-State: APjAAAVcP4PgFypWlFEa2d8T93fCABFuvDVXV/R8lA1R3LJbiV9IisKS gR7ABjF27XY5H660e8ElWywgfFxe X-Google-Smtp-Source: APXvYqz5t5Ltixp0Z6P5pMTAyu8pmhlZi4LMoD9ExYhvdEKeO6KNxXDRL/3FfSOd3vnZzT/Z1L9tHA== X-Received: by 2002:a5d:5403:: with SMTP id g3mr6102580wrv.302.1578507273222; Wed, 08 Jan 2020 10:14:33 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Igor Mammedov , Helge Deller , qemu-devel@nongnu.org, Sven Schnelle Subject: [RFC PATCH 3/3] hw/hppa/machine: Warn when using more than 4095MB of RAM Date: Wed, 8 Jan 2020 19:14:25 +0100 Message-Id: <20200108181425.21485-4-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200108181425.21485-1-f4bug@amsat.org> References: <20200108181425.21485-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We use SeaBIOS as firmware, and pass the RAM size in a 32-bit wide register. When using 4GB of RAM, the register is truncated to 0, SeaBIOS is confused and halts the machine: $ qemu-system-hppa -m 4g -serial stdio SeaBIOS: Machine configured with too little memory (0 MB), minimum is 16 = MB. SeaBIOS wants SYSTEM HALT. Display a warning in case the user is not looking at the serial console. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/hppa/machine.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index d10c967d06..e74aafea2f 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -159,6 +159,10 @@ static void machine_hppa_init(MachineState *machine) exit(1); } g_free(firmware_filename); + if (machine->ram_size > 4095 * MiB) { + /* FIXME As we use 32-bit registers, 4GiB is truncated to 0 */ + warn_report("Firmware might misbehave with 4GB of RAM"); + } =20 rom_region =3D g_new(MemoryRegion, 1); memory_region_init_ram(rom_region, NULL, "firmware", --=20 2.21.1