From nobody Sun Apr 28 01:21:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+42885+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42885+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1561549066; cv=none; d=zoho.com; s=zohoarc; b=ncFjSxogD5F1BomQ+eyNbk/cTkmFeCsf0vWBSBjxpIEhEKrbyvXyoy3KPAQcuDiuvjcQDG4me9xCXGkEgTlKjmkBafbL1MxJC30RVOr/aFUCVdAO7sqSDw1cXmuz8dS+NJs5v+z5ihYy9UedVDpJuHkqn6V9tVAxd3JSbMfAwM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561549066; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=w0QtcUPRmig+Z+JMZqSA5AZF6RRZ+0C7XOTcvRTKsNk=; b=iRxBzow0vG0IKoeQoMJ8MmAAQQrwoGGBNvM0J0BM4wg0Jnml9K8L1+59iBcuDwz66H80/c0T3L9YZi3OiUmF8g+NMx4JypE5CGaXcKklrIKK8lHFzmyfEzCpm5JiCCfgW/nEzVtMN6IwDBjQ6cCw++iUMDzFEERjtidl9SyWr6M= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42885+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1561549066001570.1645704365725; Wed, 26 Jun 2019 04:37:46 -0700 (PDT) Return-Path: X-Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by groups.io with SMTP; Wed, 26 Jun 2019 04:37:44 -0700 X-Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hg6FD-0007g6-RE; Wed, 26 Jun 2019 11:37:43 +0000 X-Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hg6FC-003RKA-K3; Wed, 26 Jun 2019 12:37:42 +0100 From: "David Woodhouse" To: devel@edk2.groups.io Cc: Laszlo Ersek Subject: [edk2-devel] [PATCH v3 1/4] OvmfPkg/LegacyBios: set NumberBbsEntries to the size of BbsTable Date: Wed, 26 Jun 2019 12:37:39 +0100 Message-Id: <20190626113742.819933-2-dwmw2@infradead.org> In-Reply-To: <20190626113742.819933-1-dwmw2@infradead.org> References: <20190626113742.819933-1-dwmw2@infradead.org> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dwmw2@infradead.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1561549065; bh=r2ufsUO237lVdeTZpMnXGmielLjbXiGPBuw3ZK6JJkY=; h=Cc:Date:From:Reply-To:Subject:To; b=JZtf0pHzlGEioYks73sou6C4/skSJdgNhal89lX3YBBhjmrJz9rQPljaUTz5cgVngBq UR6UPJ7PIwAiy7AeyIhPKGvaRCg5W/60XKlNLlXQNLt+PSusAvm+ycSodpbp+lObkoPc7 78ilWYo+JARdSLOB0fdvE9XPbToO6m55ve8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This is hard-coded in the IntThunk structure, and the additional entries will be needed for other devices like VirtIO and NVMe disks. So admit that they exist. Signed-off-by: David Woodhouse Acked-by: Laszlo Ersek --- OvmfPkg/Csm/LegacyBiosDxe/LegacyBios.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/Csm/LegacyBiosDxe/LegacyBios.c b/OvmfPkg/Csm/LegacyBio= sDxe/LegacyBios.c index 05e3ffd2bbb8..5e795bfe6570 100644 --- a/OvmfPkg/Csm/LegacyBiosDxe/LegacyBios.c +++ b/OvmfPkg/Csm/LegacyBiosDxe/LegacyBios.c @@ -565,12 +565,13 @@ ShadowAndStartLegacy16 ( =20 EfiToLegacy16BootTable->BbsTable =3D (UINT32)(UINTN)BbsTable; Private->BbsTablePtr =3D (VOID *) BbsTable; + // - // Skip Floppy and possible onboard IDE drives + // Populate entire table with BBS_IGNORE_ENTRY // - EfiToLegacy16BootTable->NumberBbsEntries =3D 1 + 2 * MAX_IDE_CONTROLLER; + EfiToLegacy16BootTable->NumberBbsEntries =3D MAX_BBS_ENTRIES; =20 - for (Index =3D 0; Index < (sizeof (Private->IntThunk->BbsTable) / sizeof= (BBS_TABLE)); Index++) { + for (Index =3D 0; Index < MAX_BBS_ENTRIES; Index++) { BbsTable[Index].BootPriority =3D BBS_IGNORE_ENTRY; } // --=20 2.21.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#42885): https://edk2.groups.io/g/devel/message/42885 Mute This Topic: https://groups.io/mt/32213811/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 01:21:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+42887+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42887+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1561549067; cv=none; d=zoho.com; s=zohoarc; b=NdLinq7W6X37I3aeWMA49QIxu5ykTbG23kvz0HAW2NdDNoO2knJSX0NZofTXKHAGt4s58waJUE4zG0WJDbmYByz5UvMIQFCf5TG5hLDOs9NBa3OxyPuoVV6Zm9IYoFnlXpqCxLycoKtwByB/6jijKmePST5JshLIY+jXJIRhaKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561549067; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=TbVXsy3foozuZdtmRQLmGwtlU728/YuV2sXHjQ+CgVg=; b=h9bNmJBViIvLn3+KukXy0XuZC/eOFGiAx8NEsEqklequ8KIrlrBVndV8Ntn8a6DfJ4gzlixiUr2bHZWPa/PlEToX016v+e2pwRJVflTlppbYRg7e5HmllLlg5u/qHSAgz0bMpL0LknW1+O0yQNqJ6o1Ze4TrWUpW2BrUEryJ7bQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42887+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1561549067261896.0037750393301; Wed, 26 Jun 2019 04:37:47 -0700 (PDT) Return-Path: X-Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by groups.io with SMTP; Wed, 26 Jun 2019 04:37:45 -0700 X-Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hg6FD-0006UA-DZ; Wed, 26 Jun 2019 11:37:43 +0000 X-Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hg6FC-003RKF-Kj; Wed, 26 Jun 2019 12:37:42 +0100 From: "David Woodhouse" To: devel@edk2.groups.io Cc: Laszlo Ersek Subject: [edk2-devel] [PATCH v3 2/4] OvmfPkg/LegacyBbs: Add boot entries for VirtIO and NVME devices Date: Wed, 26 Jun 2019 12:37:40 +0100 Message-Id: <20190626113742.819933-3-dwmw2@infradead.org> In-Reply-To: <20190626113742.819933-1-dwmw2@infradead.org> References: <20190626113742.819933-1-dwmw2@infradead.org> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org. See http://www.infradead.org/rpr.html Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dwmw2@infradead.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1561549066; bh=uOfqza2pSlhEaWPEtga4dNtiu4l8Ejt3SAPrdrb4wUg=; h=Cc:Date:From:Reply-To:Subject:To; b=KcmXmQsyi2tH5IyvXZAbevAubM9A6xC53hR/9Mewdn/H14Lq08JKVkNoZftaS3E1lx6 U1tOuoP7DUW+o+VBkBoEPBoti7xRBiDaQoTIcdTq66MtLyRAdhvNZCTK1MnIH/1C3QpEz SYu1gagD3VgKppmuQMoWAC0X96yXatlei5Y= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Iterate over the available block devices in much the same way as BdsLibEnumerateAllBootOption() does, but limiting to those devices which are PCI-backed, which can be represented in the BbsTable. One day we might need to extend the BbsTable to allow us to distinguish between different NVMe namespaces on a device. Signed-off-by: David Woodhouse Acked-by: Laszlo Ersek --- OvmfPkg/Csm/LegacyBiosDxe/LegacyBbs.c | 157 +++++++++++++++++++++++++- 1 file changed, 152 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/Csm/LegacyBiosDxe/LegacyBbs.c b/OvmfPkg/Csm/LegacyBios= Dxe/LegacyBbs.c index 6b1dd344f344..5e4c7a249ef1 100644 --- a/OvmfPkg/Csm/LegacyBiosDxe/LegacyBbs.c +++ b/OvmfPkg/Csm/LegacyBiosDxe/LegacyBbs.c @@ -140,10 +140,14 @@ LegacyBiosBuildBbs ( IN BBS_TABLE *BbsTable ) { - UINTN BbsIndex; - HDD_INFO *HddInfo; - UINTN HddIndex; - UINTN Index; + UINTN BbsIndex; + HDD_INFO *HddInfo; + UINTN HddIndex; + UINTN Index; + EFI_HANDLE *BlockIoHandles; + UINTN NumberBlockIoHandles; + UINTN BlockIndex; + EFI_STATUS Status; =20 // // First entry is floppy. @@ -252,8 +256,151 @@ LegacyBiosBuildBbs ( } } =20 + // + // Add non-IDE block devices + // + BbsIndex =3D HddIndex * 2 + 1; + + Status =3D gBS->LocateHandleBuffer ( + ByProtocol, + &gEfiBlockIoProtocolGuid, + NULL, + &NumberBlockIoHandles, + &BlockIoHandles + ); + + if (!EFI_ERROR (Status)) { + UINTN Removable; + EFI_BLOCK_IO_PROTOCOL *BlkIo; + EFI_PCI_IO_PROTOCOL *PciIo; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + EFI_DEVICE_PATH_PROTOCOL *DevicePathNode; + EFI_HANDLE PciHandle; + UINTN SegNum; + UINTN BusNum; + UINTN DevNum; + UINTN FuncNum; + + for (Removable =3D 0; Removable < 2; Removable++) { + for (BlockIndex =3D 0; BlockIndex < NumberBlockIoHandles; BlockIndex= ++) { + Status =3D gBS->HandleProtocol ( + BlockIoHandles[BlockIndex], + &gEfiBlockIoProtocolGuid, + (VOID **) &BlkIo + ); + + if (EFI_ERROR (Status)) { + continue; + } + + // + // Skip the logical partitions + // + if (BlkIo->Media->LogicalPartition) { + continue; + } + + // + // Skip the fixed block io then the removable block io + // + if (BlkIo->Media->RemovableMedia =3D=3D ((Removable =3D=3D 0) ? FA= LSE : TRUE)) { + continue; + } + + // + // Get Device Path + // + Status =3D gBS->HandleProtocol ( + BlockIoHandles[BlockIndex], + &gEfiDevicePathProtocolGuid, + (VOID **) &DevicePath + ); + if (EFI_ERROR (Status)) { + continue; + } + + // + // Skip ATA devices as they have already been handled + // + DevicePathNode =3D DevicePath; + while (!IsDevicePathEnd (DevicePathNode)) { + if (DevicePathType (DevicePathNode) =3D=3D MESSAGING_DEVICE_PATH= && + DevicePathSubType (DevicePathNode) =3D=3D MSG_ATAPI_DP) { + break; + } + DevicePathNode =3D NextDevicePathNode (DevicePathNode); + } + if (!IsDevicePathEnd (DevicePathNode)) { + continue; + } + + // + // Locate which PCI device + // + Status =3D gBS->LocateDevicePath ( + &gEfiPciIoProtocolGuid, + &DevicePath, + &PciHandle + ); + if (EFI_ERROR (Status)) { + continue; + } + + Status =3D gBS->HandleProtocol ( + PciHandle, + &gEfiPciIoProtocolGuid, + (VOID **) &PciIo + ); + if (EFI_ERROR (Status)) { + continue; + } + + Status =3D PciIo->GetLocation ( + PciIo, + &SegNum, + &BusNum, + &DevNum, + &FuncNum + ); + if (EFI_ERROR (Status)) { + continue; + } + + if (SegNum !=3D 0) { + DEBUG ((DEBUG_WARN, "CSM cannot use PCI devices in segment %Lu\n= ", + (UINT64) SegNum)); + continue; + } + + DEBUG ((DEBUG_INFO, "Add Legacy Bbs entry for PCI %d/%d/%d\n", + BusNum, DevNum, FuncNum)); + + BbsTable[BbsIndex].Bus =3D BusNum; + BbsTable[BbsIndex].Device =3D DevNum; + BbsTable[BbsIndex].Function =3D FuncNum; + BbsTable[BbsIndex].Class =3D 1; + BbsTable[BbsIndex].SubClass =3D 0x80; + BbsTable[BbsIndex].StatusFlags.OldPosition =3D 0; + BbsTable[BbsIndex].StatusFlags.Reserved1 =3D 0; + BbsTable[BbsIndex].StatusFlags.Enabled =3D 0; + BbsTable[BbsIndex].StatusFlags.Failed =3D 0; + BbsTable[BbsIndex].StatusFlags.MediaPresent =3D 0; + BbsTable[BbsIndex].StatusFlags.Reserved2 =3D 0; + BbsTable[BbsIndex].DeviceType =3D BBS_HARDDISK; + BbsTable[BbsIndex].BootPriority =3D BBS_UNPRIORITIZED_= ENTRY; + BbsIndex++; + + if (BbsIndex =3D=3D MAX_BBS_ENTRIES) { + Removable =3D 2; + break; + } + } + } + + FreePool (BlockIoHandles); + } + return EFI_SUCCESS; - } =20 =20 --=20 2.21.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#42887): https://edk2.groups.io/g/devel/message/42887 Mute This Topic: https://groups.io/mt/32213813/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 01:21:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+42889+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42889+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1561549069; cv=none; d=zoho.com; s=zohoarc; b=j7zgHGW8ZZCP6xlf2FL/j708SvzhLYUeTh+J0DrWekOMj3TeKgKFjzVoP09fMT35Oh+xAOUaMv3HOEJhXYAJv6lN4nmsJiCq0Iq/EYoSRrZn2YHfaRGosk57uRBofTuVEJjUIPeWUCU8T+pd5POw5ocqtT4hDL9BmkERoq/S7/U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561549069; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=1ehLXO3iOkHgzjpLBth9hu8HMOxubRqiH/tO9uP4s3E=; b=lvwFOVOVyQYW8rEofPkBypEp21gbbOvbnnSjyj+Bs7K5HwVwT/B3Hhby7fC0HLKBijTob+OkhkwgVBv01f+TTPB8ae7yfUG1pnAmhz3fz9DCR3sFAbnoUyy29BtyqrgqtIIjzwKTApzXwtZPBP8wtHPi6+ObGTjkYg4gQAKMRIc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42889+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1561549069873286.38016654996966; Wed, 26 Jun 2019 04:37:49 -0700 (PDT) Return-Path: X-Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by groups.io with SMTP; Wed, 26 Jun 2019 04:37:48 -0700 X-Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hg6FD-0006UB-EP; Wed, 26 Jun 2019 11:37:43 +0000 X-Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hg6FC-003RKK-LU; Wed, 26 Jun 2019 12:37:42 +0100 From: "David Woodhouse" To: devel@edk2.groups.io Cc: Laszlo Ersek Subject: [edk2-devel] [PATCH v3 3/4] OvmfPkg: Don't build in QemuVideoDxe when we have CSM Date: Wed, 26 Jun 2019 12:37:41 +0100 Message-Id: <20190626113742.819933-4-dwmw2@infradead.org> In-Reply-To: <20190626113742.819933-1-dwmw2@infradead.org> References: <20190626113742.819933-1-dwmw2@infradead.org> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org. See http://www.infradead.org/rpr.html Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dwmw2@infradead.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1561549069; bh=4CVSnWDzrvOiETzNs8Bln4xMlZALJ2K/80GgSzi6jio=; h=Cc:Date:From:Reply-To:Subject:To; b=Ik+5y8tvAFFs3VzdWBKCqOfj2KuzCvHgeWnOIXHL2zQ/lA63C+kSKGWUnDl8t3TSG+/ kOKhyyEULGjpx/XdRHVlxwbcvhlLbPmVpVHCICeHY8j1yrel8vYbZvsFNrAf29n/09kh/ hCK+E+G1992y5U39E2HcqKhLwaqP8ZUkg3g= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" QemuVideoDxe installs its own legacy INT 10h handler for the benefit of systems like Windows 2008r2 which attempt to use INT 10h even when booted via EFI. This interacts extremely badly with a CSM actually attempting to install a real video BIOS. The last thing done before invoking a legacy OpROM is to call INT 10h to set a plain text mode. In the case where it's the video BIOS OpROM being loaded, INT 10h will normally point to an iret stub in the CSM itself. Unless QemuVideoDxe has changed INT10h to point to a location in the 0xC0000 segment that it didn't allocate properly, so the real OpROM has been shadowed over them top of it, and the INT 10h vector now points to some random place in the middle of the newly-shadowed OpROM. Don't Do That Then. QemuVideoDxe doesn't do any acceleration and just sets up a linear framebuffer, so we don't lose much by just unconditionally using BiosVideoDxe instead when CSM is present. Signed-off-by: David Woodhouse Reviewed-by: Laszlo Ersek --- OvmfPkg/OvmfPkgIa32.dsc | 2 ++ OvmfPkg/OvmfPkgIa32.fdf | 5 +++-- OvmfPkg/OvmfPkgIa32X64.dsc | 2 ++ OvmfPkg/OvmfPkgIa32X64.fdf | 5 +++-- OvmfPkg/OvmfPkgX64.dsc | 2 ++ OvmfPkg/OvmfPkgX64.fdf | 5 +++-- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 473eaba24613..87716123997a 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -738,7 +738,9 @@ [Components] MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf =20 +!ifndef $(CSM_ENABLE) OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf OvmfPkg/VirtioGpuDxe/VirtioGpu.inf =20 diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index 14100356b4f6..785affeb90c8 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -305,9 +305,10 @@ [FV.DXEFV] INF OvmfPkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf INF OvmfPkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf INF RuleOverride=3DCSM OvmfPkg/Csm/Csm16/Csm16.inf -!endif - +!else INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif + INF OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf INF OvmfPkg/PlatformDxe/Platform.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 73f33b721832..639e33cb285f 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -747,7 +747,9 @@ [Components.X64] MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf =20 +!ifndef $(CSM_ENABLE) OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf OvmfPkg/VirtioGpuDxe/VirtioGpu.inf =20 diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 5af3cdc93d20..74407072563b 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -311,9 +311,10 @@ [FV.DXEFV] INF OvmfPkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf INF OvmfPkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf INF RuleOverride=3DCSM OvmfPkg/Csm/Csm16/Csm16.inf -!endif - +!else INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif + INF OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf INF OvmfPkg/PlatformDxe/Platform.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 39ac79156529..69a3497c2c9e 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -745,7 +745,9 @@ [Components] MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf =20 +!ifndef $(CSM_ENABLE) OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf OvmfPkg/VirtioGpuDxe/VirtioGpu.inf =20 diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 5af3cdc93d20..74407072563b 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -311,9 +311,10 @@ [FV.DXEFV] INF OvmfPkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf INF OvmfPkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf INF RuleOverride=3DCSM OvmfPkg/Csm/Csm16/Csm16.inf -!endif - +!else INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf +!endif + INF OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf INF OvmfPkg/PlatformDxe/Platform.inf --=20 2.21.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#42889): https://edk2.groups.io/g/devel/message/42889 Mute This Topic: https://groups.io/mt/32213815/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 01:21:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+42886+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42886+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1561549066; cv=none; d=zoho.com; s=zohoarc; b=I+x95c/XAm+7EYe5lnKuFMxQJTOLiQtH0ILPJD7+xWd+8kDacwQhq0iCApbE02ubnBpSjOaqqWGOCGaKk7vAcEiZ80Un2X6zZi1TDtlk9bIYyUFE1yS2TBIcX01qcgEb/fSOcDT1ieMWa0zqWKQ4ids6gS+ojft+6f+ehmiux2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561549066; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=U7NulQcsmN7WbMyzoBdp23fdEo2qJYH3MyRivs7DsNw=; b=AoGGF3o7kODEf7mpELYFCKKBG2sXF1b3OLJys6bwpGrPwacZzczuxJnFH7VaPz6WjqsPGziVdx7bXERd1geFCOl/oXTtFDgrvA/xLzdpX7LkOMQsObWcKQg0npK5jZ25oPpsaFDKzoC58ogPra5gSld2Ux3hYO+HFtLtkzc/fpM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42886+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 156154906618575.53218165298279; Wed, 26 Jun 2019 04:37:46 -0700 (PDT) Return-Path: X-Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by groups.io with SMTP; Wed, 26 Jun 2019 04:37:44 -0700 X-Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hg6FD-0007g7-Tb; Wed, 26 Jun 2019 11:37:43 +0000 X-Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hg6FC-003RKP-M6; Wed, 26 Jun 2019 12:37:42 +0100 From: "David Woodhouse" To: devel@edk2.groups.io Cc: Laszlo Ersek Subject: [edk2-devel] [PATCH v3 4/4] OvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled Date: Wed, 26 Jun 2019 12:37:42 +0100 Message-Id: <20190626113742.819933-5-dwmw2@infradead.org> In-Reply-To: <20190626113742.819933-1-dwmw2@infradead.org> References: <20190626113742.819933-1-dwmw2@infradead.org> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dwmw2@infradead.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1561549065; bh=RyjF4O1OLNKCD94t5uU8Je5GvHthIZGu5VTJ94J2vCA=; h=Cc:Date:From:Reply-To:Subject:To; b=lulBBTQZ3t8sRN7rD/404vPc896y99OY6HD0lifHXNEy+mYa6ipzgYiDVxIq+TeNKVT iwUKkd70qshrd4Yn5dJUMZciSAr6FNkMI7o4I7sj10BucV0JHOvSqDCmiAWty/1BPxUzO L/eP90DRIgauoRbEvFZGjwQoNBUSwsEfEws= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Mostly, this is only necessary for devices that the CSM might have native support for, such as VirtIO and NVMe; PciBusDxe will already degrade devices to 32-bit if they have an OpROM. However, there doesn't seem to be a generic way of requesting PciBusDxe to downgrade specific devices. There's IncompatiblePciDeviceSupportProtocol but that doesn't provide the PCI class information or a handle to the device itself, so there's no simple way to just match on all NVMe devices, for example. Just leave gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size set to zero for CSM builds, until/unless that can be fixed. Signed-off-by: David Woodhouse Reviewed-by: Laszlo Ersek --- OvmfPkg/OvmfPkgIa32X64.dsc | 4 ++++ OvmfPkg/OvmfPkgX64.dsc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 639e33cb285f..ad20531ceb8b 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -543,7 +543,11 @@ [PcdsDynamicDefault] gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base|0x0 +!ifdef $(CSM_ENABLE) + gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x0 +!else gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x800000000 +!endif =20 gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0 =20 diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 69a3497c2c9e..0542ac2235b4 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -542,7 +542,11 @@ [PcdsDynamicDefault] gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base|0x0 +!ifdef $(CSM_ENABLE) + gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x0 +!else gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x800000000 +!endif =20 gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0 =20 --=20 2.21.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#42886): https://edk2.groups.io/g/devel/message/42886 Mute This Topic: https://groups.io/mt/32213812/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-