From nobody Thu Nov 14 06:29:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 1705564760925184.35100199131455; Wed, 17 Jan 2024 23:59:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQNGf-0007ei-Pq; Thu, 18 Jan 2024 02:56:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQNGS-0007JM-Nz; Thu, 18 Jan 2024 02:56:42 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQNGO-0007w0-GQ; Thu, 18 Jan 2024 02:56:39 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id BB9F445048; Thu, 18 Jan 2024 10:54:36 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id E3455661B0; Thu, 18 Jan 2024 10:54:06 +0300 (MSK) Received: (nullmailer pid 2381716 invoked by uid 1000); Thu, 18 Jan 2024 07:54:05 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Helge Deller , "Nelson H . F . Beebe" , Richard Henderson , Bruno Haible , Michael Tokarev Subject: [Stable-8.2.1 29/38] hw/hppa/machine: Allow up to 3840 MB total memory Date: Thu, 18 Jan 2024 10:52:56 +0300 Message-Id: <20240118075404.2381519-29-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: 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=lists.gnu.org; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 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-ZM-MESSAGEID: 1705564761145100001 Content-Type: text/plain; charset="utf-8" From: Helge Deller The physical hardware allows DIMMs of 4 MB size and above, allowing up to 3840 MB of memory, but is restricted by setup code to 3 GB. Increase the limit to allow up to the maximum amount of memory. Btw. the memory area from 0xf000.0000 to 0xffff.ffff is reserved by the architecture for firmware and I/O memory and can not be used for standard memory. An upcoming 64-bit SeaBIOS-hppa firmware will allow more than 3.75GB on 64-bit HPPA64. In this case the ram_max for the pa20 case will change. Signed-off-by: Helge Deller Noticed-by: Nelson H. F. Beebe Fixes: b7746b1194c8 ("hw/hppa/machine: Restrict the total memory size to 3G= B") Reviewed-by: Richard Henderson Tested-by: Bruno Haible (cherry picked from commit 92039f61af89629f268e04255946c2a3fa0c453f) Signed-off-by: Michael Tokarev diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index c8da7c18d5..b11907617e 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -276,6 +276,7 @@ static TranslateFn *machine_HP_common_init_cpus(Machine= State *machine) unsigned int smp_cpus =3D machine->smp.cpus; TranslateFn *translate; MemoryRegion *cpu_region; + uint64_t ram_max; =20 /* Create CPUs. */ for (unsigned int i =3D 0; i < smp_cpus; i++) { @@ -288,8 +289,10 @@ static TranslateFn *machine_HP_common_init_cpus(Machin= eState *machine) */ if (hppa_is_pa20(&cpu[0]->env)) { translate =3D translate_pa20; + ram_max =3D 0xf0000000; /* 3.75 GB (limited by 32-bit firmwar= e) */ } else { translate =3D translate_pa10; + ram_max =3D 0xf0000000; /* 3.75 GB (32-bit CPU) */ } =20 for (unsigned int i =3D 0; i < smp_cpus; i++) { @@ -311,9 +314,9 @@ static TranslateFn *machine_HP_common_init_cpus(Machine= State *machine) cpu_region); =20 /* Main memory region. */ - if (machine->ram_size > 3 * GiB) { - error_report("RAM size is currently restricted to 3GB"); - exit(EXIT_FAILURE); + if (machine->ram_size > ram_max) { + info_report("Max RAM size limited to %" PRIu64 " MB", ram_max / Mi= B); + machine->ram_size =3D ram_max; } memory_region_add_subregion_overlap(addr_space, 0, machine->ram, -1); =20 --=20 2.39.2