From nobody Tue Apr 23 21:41:31 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; dkim=fail; spf=none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 154342386530483.99253380388302; Wed, 28 Nov 2018 08:51:05 -0800 (PST) Received: from [127.0.0.1] (helo=ra.coreboot.org) by mail.coreboot.org with esmtp (Exim 4.88) (envelope-from ) id 1gS32A-0007AG-3E; Wed, 28 Nov 2018 17:49:54 +0100 Received: from userp2130.oracle.com ([156.151.31.86]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88) (envelope-from ) id 1gS31t-00079i-R5 for seabios@seabios.org; Wed, 28 Nov 2018 17:49:52 +0100 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wASGhuGP068736; Wed, 28 Nov 2018 16:50:15 GMT Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2nxx2ubf2k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Nov 2018 16:50:15 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wASGo9Oa026678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Nov 2018 16:50:09 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wASGo83v008351; Wed, 28 Nov 2018 16:50:09 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 28 Nov 2018 08:50:08 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=rRtgSVqn6Q00FHjNV4tisF3tIrFsDmra/vwEng8TU1A=; b=s412x38ZBbY3x39JZn2Cbw0WZq48cRHYfw7mR6WUE05rNi/VDkas00nROqmp19JdcMXD hVD9jZpAHiIUJ8QppUG7vYM+V2LXD/lWXU7//XE0mae6W9kz9+YaEm4nA/oOUUgt/8cL IZzzgwLD26j7ketnNTNkBkiMuFrdwkDKi5MjtJMFvDGUClFfnfD0OhESmYAPfAVR9oFm 99janHI82GWLMdhke5b9+KwbWugnwMuy5/ZkcIfzd4KONTElnJVrbZRCaCtGDcr4TLca qYaQfC8LRYnQ594+mnXylEdEQ81loJBEJIdrIzEoPOtA4WD+S7HYFc10ZUtZBZ7srsYD gA== From: Liran Alon To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Wed, 28 Nov 2018 18:49:51 +0200 Message-Id: <20181128164951.95230-1-liran.alon@oracle.com> X-Mailer: git-send-email 2.16.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9091 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811280146 X-Spam-Score: -5.6 (-----) Subject: [SeaBIOS] [PATCH] Revert "mptable: Don't describe pci-to-pci bridges." X-BeenThere: seabios@seabios.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SeaBIOS mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arbel Moshe Content-Type: text/plain; charset="utf-8" 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-DKIM: fail (Header signature does not verify) From: Arbel Moshe This reverts commit 3c3a3fa6522f ("mptable: Don't describe pci-to-pci bridges.=E2=80=9D) The reverted commit removed the description of non-root PCI busses from the MPTable in claim they are not necessary. However, it seems that some guests rely on this information in order to correclty configure IOAPIC redirection-table entries for interrupts originated from PCI devices on non-root PCI busses. One such guest is "Extreme Networks OS". We observed that if this guest is setup with an E1000 NIC behind a PCI bridge, the OS wouldn't configure the IOAPIC redirection-table entry for the IRQ that the E1000 PIN is connected to. Therefore, interrupts from the NIC were not delivered to OS which caused guest to not have network connectivity. Fixes: 3c3a3fa6522f ("mptable: Don't describe pci-to-pci bridges.=E2=80=9D) Reviewed-by: Liran Alon Reviewed-by: Mark Kanda Signed-off-by: Arbel Moshe --- src/fw/mptable.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/fw/mptable.c b/src/fw/mptable.c index 47385cc5d32d..27686369e98c 100644 --- a/src/fw/mptable.c +++ b/src/fw/mptable.c @@ -72,25 +72,30 @@ mptable_setup(void) } int entrycount =3D cpu - cpus; =20 - // PCI bus + // PCI buses struct mpt_bus *buses =3D (void*)cpu, *bus =3D buses; - if (!hlist_empty(&PCIDevices)) { + int lastbus =3D -1; + struct pci_device *pci; + foreachpci(pci) { + int curbus =3D pci_bdf_to_bus(pci->bdf); + if (curbus =3D=3D lastbus) + continue; + lastbus =3D curbus; memset(bus, 0, sizeof(*bus)); bus->type =3D MPT_TYPE_BUS; - bus->busid =3D 0; + bus->busid =3D curbus; memcpy(bus->bustype, "PCI ", sizeof(bus->bustype)); bus++; - entrycount++; } =20 /* isa bus */ - int isabusid =3D bus - buses; + int isabusid; memset(bus, 0, sizeof(*bus)); bus->type =3D MPT_TYPE_BUS; - bus->busid =3D isabusid; + isabusid =3D bus->busid =3D lastbus + 1; memcpy(bus->bustype, "ISA ", sizeof(bus->bustype)); bus++; - entrycount++; + entrycount +=3D bus - buses; =20 /* ioapic */ u8 ioapic_id =3D BUILD_IOAPIC_ID; @@ -108,11 +113,8 @@ mptable_setup(void) int dev =3D -1; unsigned short pinmask =3D 0; =20 - struct pci_device *pci; foreachpci(pci) { u16 bdf =3D pci->bdf; - if (pci_bdf_to_bus(bdf) !=3D 0) - break; int pin =3D pci_config_readb(bdf, PCI_INTERRUPT_PIN); int irq =3D pci_config_readb(bdf, PCI_INTERRUPT_LINE); if (pin =3D=3D 0) --=20 2.16.1 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios