From nobody Sat Apr 20 14:26:44 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) client-ip=80.81.252.135; envelope-from=seabios-bounces@seabios.org; helo=mail.coreboot.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 1515701748736775.9506196191743; Thu, 11 Jan 2018 12:15:48 -0800 (PST) Received: from [127.0.0.1] (helo=ra.coreboot.org) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1eZjHr-0005sL-0G; Thu, 11 Jan 2018 21:17:19 +0100 Received: from mx1.redhat.com ([209.132.183.28]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1eZjHj-0005r5-0w for seabios@seabios.org; Thu, 11 Jan 2018 21:17:18 +0100 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B960A78541; Thu, 11 Jan 2018 20:15:22 +0000 (UTC) Received: from localhost.localdomain (unknown [10.35.206.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 781A48509; Thu, 11 Jan 2018 20:15:14 +0000 (UTC) From: Marcel Apfelbaum To: seabios@seabios.org Date: Thu, 11 Jan 2018 22:15:12 +0200 Message-Id: <20180111201512.43546-1-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 11 Jan 2018 20:15:23 +0000 (UTC) X-Spam-Score: -6.5 (------) Subject: [SeaBIOS] [PATCH] pci: fix 'io hints' capability for RedHat PCI bridges X-BeenThere: seabios@seabios.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SeaBIOS mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kraxel@redhat.com, mst@redhat.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: seabios-bounces@seabios.org Sender: "SeaBIOS" X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Commit ec6cb17f (pci: enable RedHat PCI bridges to reserve additional resources on PCI init) added a new vendor specific PCI capability for RedHat PCI bridges allowing them to reserve additional buses and/or IO/MEM space. When adding the IO hints PCI capability to the pcie-root-port without specifying a value for bus reservation, the subordinate bus computation is wrong and the guest kernel gets messed up. Fix it by returning to prev code if the value for bus reservation is not set. Removed also a wrong debug print "PCI: invalid QEMU resource reserve cap offset" which appears if the 'IO hints' capability is not present. Signed-off-by: Marcel Apfelbaum Acked-by: Michael S. Tsirkin --- src/fw/pciinit.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index 7f0e439..3a2f747 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -540,8 +540,6 @@ static u8 pci_find_resource_reserve_capability(u16 bdf) dprintf(1, "PCI: QEMU resource reserve cap length %d is in= valid\n", cap_len); } - } else { - dprintf(1, "PCI: invalid QEMU resource reserve cap offset\n"); } return cap; } else { @@ -619,13 +617,11 @@ pci_bios_init_bus_rec(int bus, u8 *pci_bus) res_bus); res_bus =3D 0; } - } - if (secbus + res_bus > *pci_bus) { - dprintf(1, "PCI: QEMU resource reserve cap: bus =3D %u= \n", - res_bus); - res_bus =3D secbus + res_bus; - } else { - res_bus =3D *pci_bus; + if (secbus + res_bus > *pci_bus) { + dprintf(1, "PCI: QEMU resource reserve cap: bus = =3D %u\n", + res_bus); + res_bus =3D secbus + res_bus; + } } } dprintf(1, "PCI: subordinate bus =3D 0x%x -> 0x%x\n", --=20 2.13.5 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios