From nobody Thu Apr 18 17:51:50 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590397661; cv=none; d=zohomail.com; s=zohoarc; b=UpmwrYqK55u1Bv34m7VUn14i1fRiEI043AuP6MqlllLB03HxRGspYSIB/yt42meZtTL8ER4GEJ0kJXtth7toz+T2IkM4ecf2WLZdgLQ+tlMy81iI3F+pH0H4ZUZJOc61u5TB9NUR900Gj68l/8VtuTSvYRKQJGUQ9SDyOmJRfXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590397661; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Subject:To; bh=V3W9w/9dANe/n+KUKVQjiRPxD+BNxfEqz3mo1YHaql0=; b=hP0fu07c1H+uKxrTlUJGceUrpFKeJA5i4iGzk+paHH8qcki6E3WgkkEOaW4B2r9SxTTHjQje1CEGh1Q1ojqeDY2kWqTYFY/jFc7yqMRVJNp21BTYIzCoxsXF7GI+WPuaWE/tbIpQ+Ik3SyFnBIafD7pvUbOWO/2rR04OBMVwv1A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1590397661838369.10828827990747; Mon, 25 May 2020 02:07:41 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 3DF5310C195B; Mon, 25 May 2020 09:07:38 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 59FFE10C1957 for ; Mon, 25 May 2020 09:07:24 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-404-9_ptvX8uNiuUCc-rJr_Dpw-1; Mon, 25 May 2020 05:07:18 -0400 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE401107ACCA for ; Mon, 25 May 2020 09:07:17 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4096B6EA56; Mon, 25 May 2020 09:07:09 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) id 8F68616E2C; Mon, 25 May 2020 11:07:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590397643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type; bh=+HGO6etg+wbd9XbEEhpvyQ66aMNiZ/g0PisIkto2Crk=; b=dCblfZU+whGu+4Hd3OdwaCy38trRuPJmxLUwGrES16wLFIbr0JLRIZ2U5HEOv4lhHw6yPV Z3n/pTCVRp6+rg69gLDlgL3EKfHIzhq7yi++/v+Le2F7I9gPPtcLE5zXXMi6MzmBLAuHZy vR0RjMfQpdTM7xMtIymHUPxOFVLq134= X-MC-Unique: 9_ptvX8uNiuUCc-rJr_Dpw-1 From: Gerd Hoffmann To: seabios@seabios.org Date: Mon, 25 May 2020 11:06:27 +0200 Message-Id: <20200525090627.6393-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: I7UHJZ3QY6INZPXS23L6525QRPY7PMH4 X-Message-ID-Hash: I7UHJZ3QY6INZPXS23L6525QRPY7PMH4 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; suspicious-header CC: mst@redhat.com, jusual@redhat.com, Gerd Hoffmann X-Mailman-Version: 3.3.1 Precedence: list Subject: [SeaBIOS] [PATCH] pci: fix mmconfig support List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ++++ X-Spam-Level: **** Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The MODESEGMENT condition is backwards, with the effect that mmconfig mode is not used to configure pci bars during POST. Oops. Fix it. The only real mode pci config space access seems to come from the ipxe option rom initialiation. Which happens to work via mmconfig because it runs in big real mode so this went unnoticed ... Fixes: 6a3b59ab9c7d ("pci: add mmconfig support") Signed-off-by: Gerd Hoffmann Reviewed-by: Paul Menzel --- src/hw/pci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hw/pci.c b/src/hw/pci.c index d9dbf313965c..3df1dae41d2b 100644 --- a/src/hw/pci.c +++ b/src/hw/pci.c @@ -28,7 +28,7 @@ static u32 ioconfig_cmd(u16 bdf, u32 addr) =20 void pci_config_writel(u16 bdf, u32 addr, u32 val) { - if (MODESEGMENT && mmconfig) { + if (!MODESEGMENT && mmconfig) { writel(mmconfig_addr(bdf, addr), val); } else { outl(ioconfig_cmd(bdf, addr), PORT_PCI_CMD); @@ -38,7 +38,7 @@ void pci_config_writel(u16 bdf, u32 addr, u32 val) =20 void pci_config_writew(u16 bdf, u32 addr, u16 val) { - if (MODESEGMENT && mmconfig) { + if (!MODESEGMENT && mmconfig) { writew(mmconfig_addr(bdf, addr), val); } else { outl(ioconfig_cmd(bdf, addr), PORT_PCI_CMD); @@ -48,7 +48,7 @@ void pci_config_writew(u16 bdf, u32 addr, u16 val) =20 void pci_config_writeb(u16 bdf, u32 addr, u8 val) { - if (MODESEGMENT && mmconfig) { + if (!MODESEGMENT && mmconfig) { writeb(mmconfig_addr(bdf, addr), val); } else { outl(ioconfig_cmd(bdf, addr), PORT_PCI_CMD); @@ -58,7 +58,7 @@ void pci_config_writeb(u16 bdf, u32 addr, u8 val) =20 u32 pci_config_readl(u16 bdf, u32 addr) { - if (MODESEGMENT && mmconfig) { + if (!MODESEGMENT && mmconfig) { return readl(mmconfig_addr(bdf, addr)); } else { outl(ioconfig_cmd(bdf, addr), PORT_PCI_CMD); @@ -68,7 +68,7 @@ u32 pci_config_readl(u16 bdf, u32 addr) =20 u16 pci_config_readw(u16 bdf, u32 addr) { - if (MODESEGMENT && mmconfig) { + if (!MODESEGMENT && mmconfig) { return readw(mmconfig_addr(bdf, addr)); } else { outl(ioconfig_cmd(bdf, addr), PORT_PCI_CMD); @@ -78,7 +78,7 @@ u16 pci_config_readw(u16 bdf, u32 addr) =20 u8 pci_config_readb(u16 bdf, u32 addr) { - if (MODESEGMENT && mmconfig) { + if (!MODESEGMENT && mmconfig) { return readb(mmconfig_addr(bdf, addr)); } else { outl(ioconfig_cmd(bdf, addr), PORT_PCI_CMD); --=20 2.18.4 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org