From nobody Mon Feb 9 05:28:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1732205300164724.2598782342153; Thu, 21 Nov 2024 08:08:20 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 145CCECD0A; Thu, 21 Nov 2024 16:08:14 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 8324EECCC5 for ; Thu, 21 Nov 2024 16:07:56 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-284-j5kj66SsPwC_VCx5JovhzA-1; Thu, 21 Nov 2024 11:07:54 -0500 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 35F411955D44 for ; Thu, 21 Nov 2024 16:07:53 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E1B9B30001A2; Thu, 21 Nov 2024 16:07:52 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) id 809DD1800630; Thu, 21 Nov 2024 17:07:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732205275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G7RC+SXQtHam6xCNEk2OQofE/smLqm2moCHB5KKHCF0=; b=Xm9R+6rCFySJbpNtOe5DaoA7YUp4JpJwKj9xUThnMYd0Pa0qbvvaKFD06pLmd06fHvIgxx NSNaMSty4bwUTqBBGR7h2InggXFf7SDeKMZei5MD3/rn4RsCDgsxYc5O94jMnZMaWBG90p HfvjFmhm73rdSnFy2LOsji8uCzkHFDs= X-MC-Unique: j5kj66SsPwC_VCx5JovhzA-1 X-Mimecast-MFC-AGG-ID: j5kj66SsPwC_VCx5JovhzA From: Gerd Hoffmann To: seabios@seabios.org Date: Thu, 21 Nov 2024 17:07:49 +0100 Message-ID: <20241121160750.158466-2-kraxel@redhat.com> In-Reply-To: <20241121160750.158466-1-kraxel@redhat.com> References: <20241121160750.158466-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: -99fIUvcWp7jOI2G2ibZYCkjC4KBU43-b4zab12IFR4_1732205273 X-Mimecast-Originator: redhat.com Message-ID-Hash: NJ4CRHXFAXBGFFHARF4UNX5GZKGR7N23 X-Message-ID-Hash: NJ4CRHXFAXBGFFHARF4UNX5GZKGR7N23 X-MailFrom: kraxel@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Gerd Hoffmann X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] [PATCH 1/2] update pci_pad_mem64 handling List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: / X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1732205301114116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Add a new possible state: '-1' means 'use default'. In that case seabios continue to use the current heuristic: In case memory above 4G is present enable 64-bit guest friendly configuration. This allows forcing the one or the other behavior by setting the pci_pad_mem64 variable beforehand (which is done by another patch). Signed-off-by: Gerd Hoffmann --- src/fw/pciinit.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index b3e359d7fe62..df63acc19e24 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -55,7 +55,7 @@ u64 pcimem64_end =3D BUILD_PCIMEM64_END; // Resource allocation limits static u64 pci_io_low_end =3D 0xa000; static u64 pci_mem64_top =3D 0; -static u32 pci_pad_mem64 =3D 0; +static u32 pci_pad_mem64 =3D -1; =20 struct pci_region_entry { struct pci_device *dev; @@ -1202,8 +1202,13 @@ pci_setup(void) } } =20 - if (CPUPhysBits >=3D 36 && CPULongMode && RamSizeOver4G) - pci_pad_mem64 =3D 1; + if (pci_pad_mem64 =3D=3D -1) + // when not set (via fw_cfg) enable in case memory over 4G is pres= ent + pci_pad_mem64 =3D RamSizeOver4G ? 1 : 0; + + if (!CPULongMode) + // force off for 32-bit CPUs + pci_pad_mem64 =3D 0; =20 dprintf(1, "=3D=3D=3D PCI bus & bridge init =3D=3D=3D\n"); if (pci_probe_host() !=3D 0) { --=20 2.47.0 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org From nobody Mon Feb 9 05:28:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1732205314711764.4297685046466; Thu, 21 Nov 2024 08:08:34 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 06CE9ECD2B; Thu, 21 Nov 2024 16:08:29 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 59ADFECCC5 for ; Thu, 21 Nov 2024 16:07:59 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-381-RgLNbZalM16kDyHqLEgLMg-1; Thu, 21 Nov 2024 11:07:57 -0500 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 31C10195608B for ; Thu, 21 Nov 2024 16:07:56 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C91D41955F3E; Thu, 21 Nov 2024 16:07:55 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) id 859A41800632; Thu, 21 Nov 2024 17:07:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732205278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2Qqt7fKXtxX4Cj7CpDwqbldQa5yYzZ4znpS23n6aDAk=; b=RWYMEP78Qf2x5ZcfJ2q3awKqLtmwGjxOIrtg4fpObfkR/itxeS+gtN5DGAlFvn9gXoeZSp txBEBK++7wA3ImLqQ7RyqGfYQlvx/DkFlGJ8rI/NPVrnc9AdbENFthLMoxpWHzk2xPuOwR vRZSo0mm1rK5/X1QeXcnjQrig4GuX2U= X-MC-Unique: RgLNbZalM16kDyHqLEgLMg-1 X-Mimecast-MFC-AGG-ID: RgLNbZalM16kDyHqLEgLMg From: Gerd Hoffmann To: seabios@seabios.org Date: Thu, 21 Nov 2024 17:07:50 +0100 Message-ID: <20241121160750.158466-3-kraxel@redhat.com> In-Reply-To: <20241121160750.158466-1-kraxel@redhat.com> References: <20241121160750.158466-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: XcGOTBLVuGWKoEZeefK0pf_Uw4YdY8Wu0rr0wgtNHHE_1732205276 X-Mimecast-Originator: redhat.com Message-ID-Hash: VO6X3GRG3SXUQIBTKBM2Z2NLMR5TEETJ X-Message-ID-Hash: VO6X3GRG3SXUQIBTKBM2Z2NLMR5TEETJ X-MailFrom: kraxel@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Gerd Hoffmann X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] [PATCH 2/2] add fwcfg override for pci_pad_mem64 List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: - X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1732205314999116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Allow setting pci_pad_mem64 via fw_cfg. Usage: qemu -fw_cfg name=3Dopt/org.seabios/pci64,string=3D{yes,no} Signed-off-by: Gerd Hoffmann --- src/util.h | 1 + src/fw/paravirt.c | 13 +++++++++++++ src/fw/pciinit.c | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/util.h b/src/util.h index aff8e888955e..03dcafb83794 100644 --- a/src/util.h +++ b/src/util.h @@ -135,6 +135,7 @@ void multiboot_init(void); extern u64 pcimem_start, pcimem_end; extern u64 pcimem64_start, pcimem64_end; extern const u8 pci_irqs[4]; +extern u32 pci_pad_mem64; void pci_setup(void); void pci_resume(void); =20 diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c index e5d4eca0cb5a..6428a70361c4 100644 --- a/src/fw/paravirt.c +++ b/src/fw/paravirt.c @@ -718,6 +718,19 @@ void qemu_cfg_init(void) dprintf(1, "Moving pm_base to 0x%x\n", acpi_pm_base); } =20 + // 64-bit pci mmio window + char *hint =3D romfile_loadfile("opt/org.seabios/pci64", NULL); + if (hint) { + if (0 =3D=3D strcmp(hint, "0") || + 0 =3D=3D strcmp(hint, "no") || + 0 =3D=3D strcmp(hint, "off")) + pci_pad_mem64 =3D 0; + if (0 =3D=3D strcmp(hint, "1") || + 0 =3D=3D strcmp(hint, "yes") || + 0 =3D=3D strcmp(hint, "on")) + pci_pad_mem64 =3D 1; + } + // serial console u16 nogfx =3D 0; qemu_cfg_read_entry(&nogfx, QEMU_CFG_NOGRAPHIC, sizeof(nogfx)); diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index df63acc19e24..5b4cf3bd5598 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -55,7 +55,7 @@ u64 pcimem64_end =3D BUILD_PCIMEM64_END; // Resource allocation limits static u64 pci_io_low_end =3D 0xa000; static u64 pci_mem64_top =3D 0; -static u32 pci_pad_mem64 =3D -1; +u32 pci_pad_mem64 =3D -1; =20 struct pci_region_entry { struct pci_device *dev; --=20 2.47.0 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org