From nobody Thu Nov 21 17:41:52 2024 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=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass(p=reject dis=none) header.from=seabios.org ARC-Seal: i=1; a=rsa-sha256; t=1726665054; cv=none; d=zohomail.com; s=zohoarc; b=jqub93YRPMQnGs7wKLpe4kLN7OqObzLe7/jjxDde3Csq92SHkcWoqk5vxaVVsXSeeiPIR2dEY2Cwuvj32I0CZXurG73DfGd7gVoYifJ96jYrpkwaSYfyBy/DcuojBIzbS0/FXnZ69kygLWSGqVSVaBriozzR+lUOjVPWrapxg64= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726665054; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=rRD7vxeKecIBvU8XSZqg1oVlebnVLP5iX7cGxrNLoSg=; b=ZrGPV8jUqcVSfpvoeNBpEltmu6eIrzR46HD/vA/4THLGBeW0uudMxbkyTh3ydxp/Bb+Y6NMbPxfqDa44k7okycWVxgAc+/LngikqZimVF+iszz/UkL+TZkrWfguUpjxDzt+NaaHivZ0GPgY7Lh2/4nQRDgcUydVWFdsFHTDB/Mw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1726665054040820.22650271822; Wed, 18 Sep 2024 06:10:54 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 3B658E29B9; Wed, 18 Sep 2024 13:10:49 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 982A8E0E86 for ; Wed, 18 Sep 2024 13:10:20 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2024 13:10:20 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.16.194:2525] with esmtp (Farcaster) id 6206f1d9-5fe6-4d1d-ab39-5a2e72877780; Wed, 18 Sep 2024 13:10:19 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) EX19MTAEUC001.ant.amazon.com (10.252.51.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.34; Wed, 18 Sep 2024 13:10:19 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) EX19D019EUA003.ant.amazon.com (10.252.50.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.34; Wed, 18 Sep 2024 13:10:19 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (10.43.8.2) by mail-relay.amazon.com (10.252.134.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.34 via Frontend Transport; Wed, 18 Sep 2024 13:10:18 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by email-imr-corp-prod-pdx-all-2c-8a67eb17.us-west-2.amazon.com (Postfix) with ESMTPS id 75E0440498; Wed, 18 Sep 2024 13:10:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seabios.org; s=dkim; t=1726665050; h=from:from:sender:reply-to: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:list-id:list-owner: list-unsubscribe:list-subscribe:list-post; bh=rRD7vxeKecIBvU8XSZqg1oVlebnVLP5iX7cGxrNLoSg=; b=kgpEKVRFqMI0alb7OGNp/8xkkYFt6enHH9neOQdbBnCDkly+r0ggAuYe+UFs5VcaYFyd1b 8ZEhcy/HikukiVQooAJ8V3wSh1UOgkGNGlKfKPzDow0mBLe1pzliDorC+PCUQ9FilDVVBJ z6DZdgY3o0L1ratDYlNxk4dESqb7bwo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1726665021; x=1758201021; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wI+Ai/Gb9czXffBmE0ml2s6sQAbu+rzgQO1eB2MXZS0=; b=tqhk/XdKfrXdLjDtJ1xgIEskE53u3+mogDh9be1K5t85TfDZSheBEHt8 n74FsHXxZNtzUH8JpZGAjspimt26onTlgfS9unwqJGTcDeS8ZMVH0IRbX TujqDtcjjvXcAS7g79muHdQXhpArf6nzuEtDEUFKOStj/xXKyqcj64Sun 4=; X-IronPort-AV: E=Sophos;i="6.10,238,1719878400"; d="scan'208";a="434269222" X-Farcaster-Flow-ID: 6206f1d9-5fe6-4d1d-ab39-5a2e72877780 To: Date: Wed, 18 Sep 2024 13:10:00 +0000 Message-ID: <20240918131000.55955-3-sainiabr@amazon.de> In-Reply-To: <20240918131000.55955-1-sainiabr@amazon.de> References: <20240918131000.55955-1-sainiabr@amazon.de> MIME-Version: 1.0 Message-ID-Hash: CMJAXEFJ2ZKETO533OYJJU2CIKMEL2AI X-Message-ID-Hash: CMJAXEFJ2ZKETO533OYJJU2CIKMEL2AI X-MailFrom: prvs=984d2d70c=sainiabr@amazon.de 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: nh-open-source@amazon.com, rkagan@amazon.de, kraxel@redhat.com, Abhimanyu Saini X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] [PATCH 2/2] pci: skip pci resource allocation if instructed by platform List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Abhimanyu Saini via SeaBIOS Reply-To: Abhimanyu Saini 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: pass (identity @seabios.org) X-ZM-MESSAGEID: 1726665056131116600 Content-Type: text/plain; charset="utf-8" A hypervisor may want to perform PCI resource allocation (bus numbers, io and mmio ranges) and program the resulting values into the devices itself rather than delegate this to the firmware. One possible reason for doing so is more control for the hypervisor over assigned ranges. This will also be faster than entering the guest and then trapping on config space accesses. Introduce a new flag in fw_cfg, "etc/pci-noalloc", to instruct the firmware to skip the resource allocation phase and use whatever is already programmed in the devices. Signed-off-by: Abhimanyu Saini --- src/fw/pciinit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index 334fd30c..e1c05410 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -1176,8 +1176,13 @@ static void pci_bios_map_devices(struct pci_bus *bus= ses) =20 static void pci_allocate_resources(void) { + u64 noalloc; struct pci_bus *busses; =20 + noalloc =3D romfile_loadint("etc/pci-noalloc", 0); + if (noalloc) + return; + dprintf(1, "=3D=3D=3D PCI new allocation pass #1 =3D=3D=3D\n"); busses =3D malloc_tmp(sizeof(*busses) * (MaxPCIBus + 1)); if (!busses) { --=20 2.40.1 Amazon Web Services Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B Sitz: Berlin Ust-ID: DE 365 538 597 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org