From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.4655.1687775905809395122 for ; Mon, 26 Jun 2023 03:38:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Hz4XP16k; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687775904; 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; bh=BsudP1IIAK1FNqG9OSqvfqMSja4WUiX6e3IQuT8QQrI=; b=Hz4XP16keVPXvUxqrVsB+pMwMXkI1xDHPtGb9F7LklRXaH9CZYkqXAijNa3xIFpGsNSpto hRQIOr7aWQu8tTTAqzdNQkk01dSzeleqd8cpPhXQQ/l4YFdeSkJjGakzwtVwiHyiZDc9Y8 XX0Em6O7XWt2oqMu4MUZtQl38d1aNBw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-325-mqPD51kUPCeZvfGOKsfVgQ-1; Mon, 26 Jun 2023 06:38:21 -0400 X-MC-Unique: mqPD51kUPCeZvfGOKsfVgQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 21B1980027F; Mon, 26 Jun 2023 10:38:21 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.203]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE320200B677; Mon, 26 Jun 2023 10:38:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 625AC180A400; Mon, 26 Jun 2023 12:38:19 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jordan Justen , Oliver Steffen , Gerd Hoffmann , Ard Biesheuvel , Jiewen Yao Subject: [PATCH v2 1/1] OvmfPkg/PciHotPlugInitDxe: fix io window size Date: Mon, 26 Jun 2023 12:38:19 +0200 Message-ID: <20230626103819.293209-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true Smallest IO window size for PCI bridges is 0x1000. Fix default size accordingly. Avoids broken resource assignments like this: [ ... ] PciBus: Resource Map for Root Bridge PciRoot(0x0) Type = Io16; Base = 0x6000; Length = 0x7000; Alignment = 0xFFF [ ... ] Base = 0xC000; Length = 0x200; Alignment = 0xFFF; Owner = PPB [00|02|00:**] Base = 0xC200; Length = 0x40; Alignment = 0x3F; Owner = PCI [00|1F|03:20] Base = 0xC240; Length = 0x20; Alignment = 0x1F; Owner = PCI [00|1F|02:20] [ ... ] ... which the linux kernel fixes up later: [ 0.644657] pci 0000:00:1f.3: BAR 4: assigned [io 0x1000-0x103f] [ 0.646833] pci 0000:00:1f.2: BAR 4: assigned [io 0x1040-0x105f] With the patch applied: { ... ] PciBus: Resource Map for Root Bridge PciRoot(0x0) Type = Io16; Base = 0x6000; Length = 0x8000; Alignment = 0xFFF [ ... ] Base = 0xC000; Length = 0x1000; Alignment = 0xFFF; Owner = PPB [00|02|00:**] Base = 0xD000; Length = 0x40; Alignment = 0x3F; Owner = PCI [00|1F|03:20] Base = 0xD040; Length = 0x20; Alignment = 0x1F; Owner = PCI [00|1F|02:20] [ ... ] Signed-off-by: Gerd Hoffmann --- OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c b/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c index 69903a600981..bb2389d16c70 100644 --- a/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c +++ b/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c @@ -741,7 +741,7 @@ GetResourcePadding ( // // Request defaults. // - SetIoPadding (--FirstResource, (UINTN)HighBitSetRoundUp64 (512)); + SetIoPadding (--FirstResource, (UINTN)HighBitSetRoundUp64 (0x1000)); } if (DefaultMmio) { -- 2.41.0