From nobody Mon Nov 23 04:26:14 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1793784320; cv=none; d=zohomail.com; s=zohoarc; b=loVHyZKifi6kYeiKc3l5NGGBa8uiZZB0JeQzMzEdD7FWUEirjcq1Nranwaf58zlgCV6+IWJnGOFq2WDDIsLf65TWVuE7g8E8CoPOjJDM4CyHUNIn3s0CoR8InscsIQBc5vp/YPzZjw+KIYhK5iKwJtl84Yu3EBLQhwfG1pJk+Mw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793784320; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BFfHK97HAZVzOVicMNjPfUhsSwp5eAIY+fq6kQMYqVU=; b=Qb/0gW+H84VMdvGGIKBPUYD/wwTtItIcBZbleeiAJziZo9abYpBvoI0lteoTvNeAhscDT5ywXMhb2xDM6o7kH42DowI3yq2NuMlo2Ebl+W1e7jjbveuBcr3L7yqIhYUi6UNHxHJMwWxt+zAYIuq89AI8wUA83N0low8ifQMq0d8= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179378432048679.5856864446954; Wed, 4 Nov 2026 01:25:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOXEf-0001cd-QD; Wed, 04 Nov 2026 04:24:50 -0500 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 1xOXEb-0001cJ-Aw for qemu-devel@nongnu.org; Wed, 04 Nov 2026 04:24:45 -0500 Received: from tor.source.kernel.org ([172.105.4.254]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOXEZ-0000A4-Sp for qemu-devel@nongnu.org; Wed, 04 Nov 2026 04:24:45 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id CA8D360611; Wed, 4 Nov 2026 09:24:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 256741F000C1; Wed, 4 Nov 2026 09:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793784275; bh=BFfHK97HAZVzOVicMNjPfUhsSwp5eAIY+fq6kQMYqVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=e7uZ9CCGKUGa2VKoHhuNkI3X9NEdz7EnWT04ipnE5jgkFp6Dzwcv38Do6r2WDK2ul 3xjL1/GIsFB82gqYWho4DScOSVP0YbH384reWrF3NNVd5idMmLCrybjMh8DYFZ+Bda GJe4f9gGy+EEHe1pKAqFtri4ewFqNO+3BA6dH/zjDQAf153KNAySVsa/xS/LuVEqP5 /7D4jM0Oe0RIDoXyyenDxpyYkiuzPYha51UCduFr1RTEIDVxShucFdgVTPOs2KJJHF xxvYZkp6sNTHLu6QKHPRhLgpMC7AqHxRllT5Fu3gW8G0EmZ/HXoBMSjyw0fbvkVtYg FuMlRBOFfUSIw== From: Imre Kaloz To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Pierrick Bouvier Subject: [PATCH v2 1/2] hw/sparc/sun4m: End the empty slot at iommu_base Date: Wed, 4 Nov 2026 10:23:15 +0100 Message-ID: <20261104092316.13052-2-kaloz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261104092316.13052-1-kaloz@kernel.org> References: <20261104092316.13052-1-kaloz@kernel.org> 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=172.105.4.254; envelope-from=kaloz@kernel.org; helo=tor.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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 @kernel.org) X-ZM-MESSAGEID: 1793784321062158500 Memory decode on machines without ECC ends at iommu_base, so the empty slot for missing RAM should end there. max_mem equals iommu_base on these machines today, so nothing changes, but a later patch lowers max_mem. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Imre Kaloz --- hw/sparc/sun4m.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 550acdff6d..2f4eb19f7f 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -840,10 +840,13 @@ static void sun4m_hw_init(MachineState *machine) sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0); =20 - /* models without ECC don't trap when missing ram is accessed */ + /* + * models without ECC don't trap when missing ram is accessed, + * up to the end of memory decode at iommu_base + */ if (!hwdef->ecc_base) { empty_slot_init("ecc", machine->ram_size, - hwdef->max_mem - machine->ram_size); + hwdef->iommu_base - machine->ram_size); } =20 prom_init(hwdef->slavio_base, machine->firmware); --=20 2.47.3 From nobody Mon Nov 23 04:26:14 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=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1793784324; cv=none; d=zohomail.com; s=zohoarc; b=flDIBZhOrcj2Tt0MnNUHJN+izArga8MwmrCJnc52jDtHmGhmtBMU3Xf6kT0kPvC8GNLo4kBN+SZoT9z6qoczt9alF67IdIddP1wpR1IIQcduh+naqR7v/jyT8r9gh1DrgJ9UIU+74V2vTnEWTA+LzOIHUB6E8VpkxjXTiXGtlpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793784324; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Tg6W3Z+kxMjihx9hBST4llq0xvLeury7LLnVy2GBEXE=; b=NvaMtUMlNyQDOFiqYih2fNcqdxJFktyca3En4AqJbXQI5PznPpHN8QmA207nM7xbVQ6JQA2w7uOLpUXlSOQRVjYQROOPFP5arBMbbsy9YhgrHFeLGFcCPNmez+xgDX5UgqOFm836iQkIo+wO1ECdHYjOnpunLLvecLKBmuGkkTU= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793784324015613.3622996538962; Wed, 4 Nov 2026 01:25:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOXEm-0001dv-VR; Wed, 04 Nov 2026 04:24:56 -0500 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 1xOXEf-0001cj-MS for qemu-devel@nongnu.org; Wed, 04 Nov 2026 04:24:49 -0500 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOXEd-0000AC-Ke for qemu-devel@nongnu.org; Wed, 04 Nov 2026 04:24:49 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id C0ADA609D5; Wed, 4 Nov 2026 09:24:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B1731F000C1; Wed, 4 Nov 2026 09:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793784277; bh=Tg6W3Z+kxMjihx9hBST4llq0xvLeury7LLnVy2GBEXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Pw8xqdWH10SRCDFKIo2Jn5bPTm+l2AHJ2oR3h2wOi5aTEIT09QhkP5iabcr+lsrO1 r04w/3AHkI05tFqIHv9O2jHXaCeGb/LgZMXTFzOWh17I8Qck2T2UIAqrVFIUaL6n95 KpWQPQG/p1TGk/HHZxPTFvxMVuW1ltP8tZPIL62moL0aqMcpzgGz9ivhs2ozXzHl64 Bd1LsWlNyyD0D7oxNgakTg75jEsfqBYCcI1ltUvVtEbDroPyDhGW2wzWM6y7oew+oK T/iYvf6NIKcQNQHkeqzc0Tlx7PKNOQj32su4tybr/hi/5u1jOZ8u1L9bnpAQBXCRDS l67rkZqZrCW+A== From: Imre Kaloz To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko , Pierrick Bouvier Subject: [PATCH v2 2/2] hw/sparc/sun4m: Limit max_mem to what the memory controllers decode Date: Wed, 4 Nov 2026 10:23:16 +0100 Message-ID: <20261104092316.13052-3-kaloz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261104092316.13052-1-kaloz@kernel.org> References: <20261104092316.13052-1-kaloz@kernel.org> 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=2600:3c04:e001:324:0:1991:8:25; envelope-from=kaloz@kernel.org; helo=tor.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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 @kernel.org) X-ZM-MESSAGEID: 1793784325137158501 Limit max_mem on each machine to what its memory controller decodes, instead of the former 60 GiB or 256 MiB, and update the docs. The Voyager default RAM size becomes 80 MiB so -M Voyager without -m still starts. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Imre Kaloz --- docs/system/target-sparc.rst | 6 ++++-- hw/sparc/sun4m.c | 17 +++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/system/target-sparc.rst b/docs/system/target-sparc.rst index 4116cac493..de0acc76dc 100644 --- a/docs/system/target-sparc.rst +++ b/docs/system/target-sparc.rst @@ -52,8 +52,10 @@ QEMU emulates the following sun4m peripherals: - CS4231 sound device (only on SS-5, not working yet) =20 The number of peripherals is fixed in the architecture. Maximum memory -size depends on the machine type, for SS-5 it is 256MB and for others -2047MB. +size depends on the machine type: 512 MiB for the SS-10 and SS-20, +256 MiB for the SS-5, 160 MiB for the SS-4, 128 MiB for the LX, +SPARCclassic and SPARCbook, 80 MiB for the Voyager, and 1 GiB for the +SPARCserver 600MP. =20 Since version 0.8.2, QEMU uses OpenBIOS https://www.openbios.org/. OpenBIOS is a free (GPL v2) portable firmware implementation. The goal diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 2f4eb19f7f..c586b1c44e 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -1177,7 +1177,7 @@ static void ss10_class_init(ObjectClass *oc, const vo= id *data) .nvram_machine_id =3D 0x72, .machine_id =3D ss10_id, .iommu_version =3D 0x03000000, - .max_mem =3D 0xf00000000ULL, + .max_mem =3D 0x20000000, /* 512M: EMC has 29 DRAM address bits */ }; =20 mc->desc =3D "Sun4m platform, SPARCstation 10"; @@ -1210,7 +1210,7 @@ static void ss600mp_class_init(ObjectClass *oc, const= void *data) .nvram_machine_id =3D 0x71, .machine_id =3D ss600mp_id, .iommu_version =3D 0x01000000, - .max_mem =3D 0xf00000000ULL, + .max_mem =3D 0x40000000, /* 1G: onboard plus expansion boards */ }; =20 mc->desc =3D "Sun4m platform, SPARCserver 600MP"; @@ -1261,7 +1261,7 @@ static void ss20_class_init(ObjectClass *oc, const vo= id *data) .nvram_machine_id =3D 0x72, .machine_id =3D ss20_id, .iommu_version =3D 0x13000000, - .max_mem =3D 0xf00000000ULL, + .max_mem =3D 0x20000000, /* 512M: SMC has 29 DRAM address bits */ }; =20 mc->desc =3D "Sun4m platform, SPARCstation 20"; @@ -1294,11 +1294,12 @@ static void voyager_class_init(ObjectClass *oc, con= st void *data) .nvram_machine_id =3D 0x80, .machine_id =3D vger_id, .iommu_version =3D 0x05000000, - .max_mem =3D 0x10000000, + .max_mem =3D 0x05000000, /* 80M: 16M onboard plus two 32M cards */ }; =20 mc->desc =3D "Sun4m platform, SPARCstation Voyager"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); + mc->default_ram_size =3D 80 * MiB; smc->hwdef =3D &voyager_hwdef; } =20 @@ -1327,7 +1328,7 @@ static void ss_lx_class_init(ObjectClass *oc, const v= oid *data) .nvram_machine_id =3D 0x80, .machine_id =3D lx_id, .iommu_version =3D 0x04000000, - .max_mem =3D 0x10000000, + .max_mem =3D 0x08000000, /* 128M: microSPARC-I on-chip controller = */ }; =20 mc->desc =3D "Sun4m platform, SPARCstation LX"; @@ -1360,7 +1361,7 @@ static void ss4_class_init(ObjectClass *oc, const voi= d *data) .nvram_machine_id =3D 0x80, .machine_id =3D ss4_id, .iommu_version =3D 0x05000000, - .max_mem =3D 0x10000000, + .max_mem =3D 0x0a000000, /* 160M: 5 SIMM slots */ }; =20 mc->desc =3D "Sun4m platform, SPARCstation 4"; @@ -1392,7 +1393,7 @@ static void scls_class_init(ObjectClass *oc, const vo= id *data) .nvram_machine_id =3D 0x80, .machine_id =3D scls_id, .iommu_version =3D 0x05000000, - .max_mem =3D 0x10000000, + .max_mem =3D 0x08000000, /* 128M: microSPARC-I on-chip controller = */ }; =20 mc->desc =3D "Sun4m platform, SPARCClassic"; @@ -1424,7 +1425,7 @@ static void sbook_class_init(ObjectClass *oc, const v= oid *data) .nvram_machine_id =3D 0x80, .machine_id =3D sbook_id, .iommu_version =3D 0x05000000, - .max_mem =3D 0x10000000, + .max_mem =3D 0x08000000, /* 128M: microSPARC-I on-chip controller = */ }; =20 mc->desc =3D "Sun4m platform, SPARCbook"; --=20 2.47.3