From nobody Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75670+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75670+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060168; cv=none; d=zohomail.com; s=zohoarc; b=Gz93AJ6p2jHtiUiH8ypEkXZEMTJ7J7zLOahRBcEl9goSUpv+bg+g0IErGWbRtLnd+s3za2rEw0zfQ4HZpjIiis41X/TEKNDL9JG5FrPfIFXYpgvwgbeTqgTtDGil95IjufWeY4L7x0hMNp+qncX8omIniKEEoXRJ+FLJ3y/uJcs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060168; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=D+DIKexxMutTwYTzcXtAlBdHG0yQyu89snXYA+v75yo=; b=Ui1caxaPr49c3n93reSdllKTjQX8dSeNyXwHKqZE6WA86oeX+2wq9kJUohPxWFH6NF4AeTjf9OcR6EstIg6lBB6Dup6Cg10mRFlLEgvDIBisH/1vonCYifUBnx3MX3+0R72LUsepxpU/ULtRZ2zjkZEEdlU9IE+983QC+qBWhUU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75670+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060168433938.7391795140782; Wed, 26 May 2021 13:16:08 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ltv6YY1788612xEQAcr4t2O1; Wed, 26 May 2021 13:16:08 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web12.2809.1622060162413289367 for ; Wed, 26 May 2021 13:16:02 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-187-9JmLo2H9PEyFnTix6sL2HA-1; Wed, 26 May 2021 16:15:59 -0400 X-MC-Unique: 9JmLo2H9PEyFnTix6sL2HA-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A86476D58A; Wed, 26 May 2021 20:15:58 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA03778630; Wed, 26 May 2021 20:15:52 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 01/43] OvmfPkg: remove the Xen drivers from the IA32, IA32X64, and X64 platforms Date: Wed, 26 May 2021 22:14:04 +0200 Message-Id: <20210526201446.12554-2-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: SUlg0OAOMGmtbnAZaanqPAvTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060168; bh=D+DIKexxMutTwYTzcXtAlBdHG0yQyu89snXYA+v75yo=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=DYMvFE27uBnxXDy333HRf2B66so3TYdBdmvLi/qUT9Ookt7/JyH+ztInSCTvAURTj0f bKrZWMrjGTudxrjZP/rsF57NQnwe5hu8nXPAxZn5jjV6gYH304GhLJQUa5ZAwUKeqdGZk cZadqhjr0PSlsF3Z409W4gyorAaks9RTqL8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Remove the three Xen drivers as the first step for removing Xen support from the historical OvmfPkg* platforms. Xen (HVM and PVH) guests are supported by the dedicated OvmfXen platform. No module remains dependent on XenHypercallLib, so remove the XenHypercallLib class resolutions too, from the DSC files. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/OvmfPkgIa32.dsc | 4 ---- OvmfPkg/OvmfPkgIa32X64.dsc | 4 ---- OvmfPkg/OvmfPkgX64.dsc | 4 ---- OvmfPkg/OvmfPkgIa32.fdf | 3 --- OvmfPkg/OvmfPkgIa32X64.fdf | 3 --- OvmfPkg/OvmfPkgX64.fdf | 3 --- 6 files changed, 21 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 33fbd767903e..472cdd4d8a46 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -223,13 +223,12 @@ [LibraryClasses] =20 ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScrip= tLib.inf SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib= /BaseOrderedCollectionRedBlackTreeLib.inf - XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf @@ -791,15 +790,12 @@ [Components] OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf OvmfPkg/Virtio10Dxe/Virtio10.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf OvmfPkg/VirtioScsiDxe/VirtioScsi.inf OvmfPkg/VirtioRngDxe/VirtioRng.inf - OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf - OvmfPkg/XenBusDxe/XenBusDxe.inf - OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf !if $(PVSCSI_ENABLE) =3D=3D TRUE OvmfPkg/PvScsiDxe/PvScsiDxe.inf !endif !if $(MPT_SCSI_ENABLE) =3D=3D TRUE OvmfPkg/MptScsiDxe/MptScsiDxe.inf !endif diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index b13e5cfd9047..af7d66455fb5 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -227,13 +227,12 @@ [LibraryClasses] =20 ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScrip= tLib.inf SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib= /BaseOrderedCollectionRedBlackTreeLib.inf - XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf @@ -805,15 +804,12 @@ [Components.X64] OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf OvmfPkg/Virtio10Dxe/Virtio10.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf OvmfPkg/VirtioScsiDxe/VirtioScsi.inf OvmfPkg/VirtioRngDxe/VirtioRng.inf - OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf - OvmfPkg/XenBusDxe/XenBusDxe.inf - OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf !if $(PVSCSI_ENABLE) =3D=3D TRUE OvmfPkg/PvScsiDxe/PvScsiDxe.inf !endif !if $(MPT_SCSI_ENABLE) =3D=3D TRUE OvmfPkg/MptScsiDxe/MptScsiDxe.inf !endif diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 999738dc39cd..fc236cecfdf0 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -227,13 +227,12 @@ [LibraryClasses] =20 ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScrip= tLib.inf SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib= /BaseOrderedCollectionRedBlackTreeLib.inf - XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf @@ -803,15 +802,12 @@ [Components] OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf OvmfPkg/Virtio10Dxe/Virtio10.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf OvmfPkg/VirtioScsiDxe/VirtioScsi.inf OvmfPkg/VirtioRngDxe/VirtioRng.inf - OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf - OvmfPkg/XenBusDxe/XenBusDxe.inf - OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf !if $(PVSCSI_ENABLE) =3D=3D TRUE OvmfPkg/PvScsiDxe/PvScsiDxe.inf !endif !if $(MPT_SCSI_ENABLE) =3D=3D TRUE OvmfPkg/MptScsiDxe/MptScsiDxe.inf !endif diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index b3c8b56f3b60..eb7f04a28257 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -225,15 +225,12 @@ [FV.DXEFV] =20 INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf INF OvmfPkg/Virtio10Dxe/Virtio10.inf INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf INF OvmfPkg/VirtioRngDxe/VirtioRng.inf -INF OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf -INF OvmfPkg/XenBusDxe/XenBusDxe.inf -INF OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf !if $(PVSCSI_ENABLE) =3D=3D TRUE INF OvmfPkg/PvScsiDxe/PvScsiDxe.inf !endif !if $(MPT_SCSI_ENABLE) =3D=3D TRUE INF OvmfPkg/MptScsiDxe/MptScsiDxe.inf !endif diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 86592c2364a3..f10108d7ee62 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -226,15 +226,12 @@ [FV.DXEFV] =20 INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf INF OvmfPkg/Virtio10Dxe/Virtio10.inf INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf INF OvmfPkg/VirtioRngDxe/VirtioRng.inf -INF OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf -INF OvmfPkg/XenBusDxe/XenBusDxe.inf -INF OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf !if $(PVSCSI_ENABLE) =3D=3D TRUE INF OvmfPkg/PvScsiDxe/PvScsiDxe.inf !endif !if $(MPT_SCSI_ENABLE) =3D=3D TRUE INF OvmfPkg/MptScsiDxe/MptScsiDxe.inf !endif diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index d6be798fcadd..eb19a9e41502 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -238,15 +238,12 @@ [FV.DXEFV] =20 INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf INF OvmfPkg/Virtio10Dxe/Virtio10.inf INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf INF OvmfPkg/VirtioRngDxe/VirtioRng.inf -INF OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf -INF OvmfPkg/XenBusDxe/XenBusDxe.inf -INF OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf !if $(PVSCSI_ENABLE) =3D=3D TRUE INF OvmfPkg/PvScsiDxe/PvScsiDxe.inf !endif !if $(MPT_SCSI_ENABLE) =3D=3D TRUE INF OvmfPkg/MptScsiDxe/MptScsiDxe.inf !endif --=20 2.19.1.3.g30247aa5d201 -=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 (#75670): https://edk2.groups.io/g/devel/message/75670 Mute This Topic: https://groups.io/mt/83110255/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75671+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75671+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060232; cv=none; d=zohomail.com; s=zohoarc; b=RbL7fYF2hMO3EyIkJGgWvnZFuUTFjEhUdl9fIV81gHj/bNd287vjSe0QeZ3bj0uXkWSdVz4chl7Tt/gjWn375gNd1dam0NKvsm9Jaai0VJjRHFrkVQ1ROnsVpXlKRn8U2obHGxZJOGqRIpR/60wLw/b9O3kf5Spp4qO6yaVtrAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060232; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=aMzIODvRaVcE4R7iVQVF6MXQa2mi+7QrDFNlS/qFBOU=; b=mbmECfNhVlgEip7SEI+jUdUv5HTkh8/CtzGHQwDhUldMMPR+HxVW4s8mWEXqWLCX4xlbXmeKSwMpzeCj33LQrWFU9WsUI+uvjZmv0Yr2Wat54kFJV89S0+b+5DsIoX1jW+w+5dY3I8ZF9iqrEq++Heq/9BqYRCvg9AZjP/bUXy4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75671+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060232120787.090383897223; Wed, 26 May 2021 13:17:12 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id DykTYY1788612xTTdi5x3F7p; Wed, 26 May 2021 13:17:11 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.2820.1622060226281661116 for ; Wed, 26 May 2021 13:17:06 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-388-itDS-yzLNLqwdWgqEOmm5Q-1; Wed, 26 May 2021 16:17:03 -0400 X-MC-Unique: itDS-yzLNLqwdWgqEOmm5Q-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3183E107ACFC; Wed, 26 May 2021 20:17:02 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00B705D6D3; Wed, 26 May 2021 20:16:59 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Jordan Justen , Min Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Tom Lendacky Subject: [edk2-devel] [PATCH 02/43] OvmfPkg: remove the Xen drivers from the AmdSev platform Date: Wed, 26 May 2021 22:14:05 +0200 Message-Id: <20210526201446.12554-3-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: GOJRlMNKFYSZTBt5kZCnUdKKx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060231; bh=aMzIODvRaVcE4R7iVQVF6MXQa2mi+7QrDFNlS/qFBOU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=TskyuSiQNBXXZ8CMOPNcl7nwdn4LhRO4+caZwpCJ845I0g10pw9FGG1R3f/I6rlBs57 WLi/YzWrclShawFdZZgr9vid+poOAdtks4RpxLgC10dOvO+usScnN+kxGOqJ16zWmlNhB Q2QJxJv+xCnO3obuUJBijtYSQ3mlaq8I14g= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" For symmetry with the historical OvmfPkg* platforms, remove the three Xen drivers from the remotely attested, QEMU/KVM-only, AmdSev platform. Xen (HVM and PVH) guests are supported by the dedicated OvmfXen platform. No module remains dependent on XenHypercallLib, so remove the XenHypercallLib class resolution too, from the DSC file. Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Jordan Justen Cc: Min Xu Cc: Philippe Mathieu-Daud=C3=A9 Cc: Tom Lendacky Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/AmdSev/AmdSevX64.dsc | 4 ---- OvmfPkg/AmdSev/AmdSevX64.fdf | 3 --- 2 files changed, 7 deletions(-) diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index 66bbbc80cd18..c5400ff6ab6c 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -198,13 +198,12 @@ [LibraryClasses] ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf !endif =20 SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib= /BaseOrderedCollectionRedBlackTreeLib.inf - XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf @@ -698,15 +697,12 @@ [Components] OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf OvmfPkg/Virtio10Dxe/Virtio10.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf OvmfPkg/VirtioScsiDxe/VirtioScsi.inf OvmfPkg/VirtioRngDxe/VirtioRng.inf - OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf - OvmfPkg/XenBusDxe/XenBusDxe.inf - OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf !if $(PVSCSI_ENABLE) =3D=3D TRUE OvmfPkg/PvScsiDxe/PvScsiDxe.inf !endif !if $(MPT_SCSI_ENABLE) =3D=3D TRUE OvmfPkg/MptScsiDxe/MptScsiDxe.inf !endif diff --git a/OvmfPkg/AmdSev/AmdSevX64.fdf b/OvmfPkg/AmdSev/AmdSevX64.fdf index dd0030dbf189..1c4bc076ffc8 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.fdf +++ b/OvmfPkg/AmdSev/AmdSevX64.fdf @@ -209,15 +209,12 @@ [FV.DXEFV] =20 INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf INF OvmfPkg/Virtio10Dxe/Virtio10.inf INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf INF OvmfPkg/VirtioRngDxe/VirtioRng.inf -INF OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf -INF OvmfPkg/XenBusDxe/XenBusDxe.inf -INF OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf !if $(PVSCSI_ENABLE) =3D=3D TRUE INF OvmfPkg/PvScsiDxe/PvScsiDxe.inf !endif !if $(MPT_SCSI_ENABLE) =3D=3D TRUE INF OvmfPkg/MptScsiDxe/MptScsiDxe.inf !endif --=20 2.19.1.3.g30247aa5d201 -=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 (#75671): https://edk2.groups.io/g/devel/message/75671 Mute This Topic: https://groups.io/mt/83110278/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75672+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75672+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060291; cv=none; d=zohomail.com; s=zohoarc; b=IakpZpOOu+dOWgbFBMRdileSLXkqYh7FCbU6X1Q0Dq+oQnk/mxWMGaHXvHgV3F7WLYZRwOfcVFTiSgPSQGSUoxI/BNntXPx41RfPZJtb8dJuDP/kOBMhPV/juUVFGC4X4d4cADtbWgRjBIMKa472Hy0o2yqSCpDBikwgq/Can6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060291; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=t+328uZ3nwCEGg70fydCZ8ONeDO9C4WnHHKehOceSTk=; b=iVMB8KiFL4lfrc56FEHH9zA6b6Zjdn5dKHCam5Jd4EF/3e8zHQ833G6UawcchBYsDisvFkNOflDJO9DQPyd6y0Uf+8hrgg1+2zfZKPf8NLIAXHRLj8MUnJLGMWwPKSHeH2JB9D/kgciRQsLlX6Aua7ZKvyPT+C0ch0fB3VTXx9U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75672+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16220602913277.958158737778376; Wed, 26 May 2021 13:18:11 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id QS5HYY1788612xp56ZgOzQuR; Wed, 26 May 2021 13:18:11 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.2783.1622060290217585473 for ; Wed, 26 May 2021 13:18:10 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-29-njSoVDn2M7Ca8MpoLPHWZQ-1; Wed, 26 May 2021 16:18:05 -0400 X-MC-Unique: njSoVDn2M7Ca8MpoLPHWZQ-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9F4FE107ACF7; Wed, 26 May 2021 20:18:04 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E20E608BA; Wed, 26 May 2021 20:18:03 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 03/43] OvmfPkg: switch IA32, IA32X64, X64 to the fw_cfg-only ACPI platform driver Date: Wed, 26 May 2021 22:14:06 +0200 Message-Id: <20210526201446.12554-4-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: ChdmDF7nmDWRsHKFtWUjKypAx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060291; bh=t+328uZ3nwCEGg70fydCZ8ONeDO9C4WnHHKehOceSTk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=F0FgP0EKSRg5v3HsENs1yFeoyc4BY6zJQfZIJZfPIOu/7VPGK12Z6fHD0UYhWm9VRgP 3+hfoIJUZ4ByvCCMGIcilhHl5OvuFn0yP28uItLJIxKZ4XAAonZ0q+6byoiBKs4Ryyk9W KWLFpscVJYlL1t25ecAlY/0uO4BZc+D32RY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Switch the historical OvmfPkg* platforms from the AcpiPlatformDxe driver to the QemuFwCfgAcpiPlatformDxe driver. (The latter is used by the ArmVirtQemu* platforms as well.) The change effectively replaces the following call tree: InstallAcpiTables [AcpiPlatform.c] XenDetected [XenPlatformLib] * InstallXenTables [Xen.c] * GetXenAcpiRsdp [Xen.c] * InstallQemuFwCfgTables [QemuFwCfgAcpi.c] ... InstallOvmfFvTables [AcpiPlatform.c] * QemuDetected [Qemu.c] * LocateFvInstanceWithTables [AcpiPlatform.c] * QemuInstallAcpiTable [Qemu.c] * QemuInstallAcpiMadtTable [Qemu.c] * CountBits16 [Qemu.c] * QemuInstallAcpiSsdtTable [Qemu.c] * GetSuspendStates [Qemu.c] * PopulateFwData [Qemu.c] * with the one below: InstallAcpiTables [QemuFwCfgAcpiPlatform.c] InstallQemuFwCfgTables [QemuFwCfgAcpi.c] ... eliminating the sub-trees highlighted with "*". There are two consequences: (1) Xen compatibility is removed from the ACPI platform driver of the historical OvmfPkg* platforms. (2) The ACPI tables that are statically built into OVMF (via "OvmfPkg/AcpiTables/AcpiTables.inf") are never installed. In particular, OVMF's own runtime preparation of the MADT and SSDT is eliminated. Because of (2), remove the "OvmfPkg/AcpiTables/AcpiTables.inf" module as well -- and then the ACPITABLE build rule too. Note that (2) only removes effectively dead code; the QEMU ACPI linker-loader has taken priority since QEMU 1.7.1 (2014). References: - https://wiki.qemu.org/Planning/1.7 - https://wiki.qemu.org/Features/ACPITableGeneration - edk2 commit 96bbdbc85693 ("OvmfPkg: AcpiPlatformDxe: download ACPI tables from QEMU", 2014-03-31) - edk2 commit 387536e472aa ("OvmfPkg: AcpiPlatformDxe: implement QEMU's full ACPI table loader interface", 2014-09-22) Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/OvmfPkgIa32.dsc | 3 +-- OvmfPkg/OvmfPkgIa32X64.dsc | 3 +-- OvmfPkg/OvmfPkgX64.dsc | 3 +-- OvmfPkg/OvmfPkgIa32.fdf | 9 +-------- OvmfPkg/OvmfPkgIa32X64.fdf | 9 +-------- OvmfPkg/OvmfPkgX64.fdf | 9 +-------- 6 files changed, 6 insertions(+), 30 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 472cdd4d8a46..4b7e1c731ef5 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -859,14 +859,13 @@ [Components] OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 # # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf - OvmfPkg/AcpiTables/AcpiTables.inf + OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf =20 # # Network Support diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index af7d66455fb5..1d1dea4b19cd 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -873,14 +873,13 @@ [Components.X64] OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 # # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf - OvmfPkg/AcpiTables/AcpiTables.inf + OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf =20 # # Network Support diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index fc236cecfdf0..d71edd6b2272 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -871,14 +871,13 @@ [Components] OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 # # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf - OvmfPkg/AcpiTables/AcpiTables.inf + OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf =20 # # Network Support diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index eb7f04a28257..04b41445ca34 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -277,14 +277,13 @@ [FV.DXEFV] INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf =20 INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf -INF RuleOverride=3DACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf +INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf =20 INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf @@ -484,18 +483,12 @@ [Rule.Common.UEFI_APPLICATION.BINARY] FILE APPLICATION =3D $(NAMED_GUID) { PE32 PE32 |.efi UI STRING=3D"$(MODULE_NAME)" Optional VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) } =20 -[Rule.Common.USER_DEFINED.ACPITABLE] - FILE FREEFORM =3D $(NAMED_GUID) { - RAW ACPI |.acpi - RAW ASL |.aml - } - [Rule.Common.USER_DEFINED.CSM] FILE FREEFORM =3D $(NAMED_GUID) { RAW BIN |.bin } =20 [Rule.Common.SEC.RESET_VECTOR] diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index f10108d7ee62..02fd8f0c413e 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -278,14 +278,13 @@ [FV.DXEFV] INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf =20 INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf -INF RuleOverride=3DACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf +INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf =20 INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf @@ -487,18 +486,12 @@ [Rule.Common.UEFI_APPLICATION.BINARY] FILE APPLICATION =3D $(NAMED_GUID) { PE32 PE32 |.efi UI STRING=3D"$(MODULE_NAME)" Optional VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) } =20 -[Rule.Common.USER_DEFINED.ACPITABLE] - FILE FREEFORM =3D $(NAMED_GUID) { - RAW ACPI |.acpi - RAW ASL |.aml - } - [Rule.Common.USER_DEFINED.CSM] FILE FREEFORM =3D $(NAMED_GUID) { RAW BIN |.bin } =20 [Rule.Common.SEC.RESET_VECTOR] diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index eb19a9e41502..5fa8c0895808 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -290,14 +290,13 @@ [FV.DXEFV] INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf =20 INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf -INF RuleOverride=3DACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf +INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf =20 INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf @@ -499,18 +498,12 @@ [Rule.Common.UEFI_APPLICATION.BINARY] FILE APPLICATION =3D $(NAMED_GUID) { PE32 PE32 |.efi UI STRING=3D"$(MODULE_NAME)" Optional VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) } =20 -[Rule.Common.USER_DEFINED.ACPITABLE] - FILE FREEFORM =3D $(NAMED_GUID) { - RAW ACPI |.acpi - RAW ASL |.aml - } - [Rule.Common.USER_DEFINED.CSM] FILE FREEFORM =3D $(NAMED_GUID) { RAW BIN |.bin } =20 [Rule.Common.SEC.RESET_VECTOR] --=20 2.19.1.3.g30247aa5d201 -=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 (#75672): https://edk2.groups.io/g/devel/message/75672 Mute This Topic: https://groups.io/mt/83110310/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75673+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75673+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060360; cv=none; d=zohomail.com; s=zohoarc; b=V8F8kmPHnXltQRDSDMyr9h1eyxA0adwmQVgpaIy+BiDQfys52LdGbUgUYMSY0OjDgfXvonAompZn0TChLAYaHtc+IGBRXszaghZNDPE2S1luVr7A/fmOMBQd2OpPHflA068fGHqe8xLOJlKykhCw3PPSRiIVR/jlh/rR7j1R4fk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060360; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=sCqGUQuLqxG0sxi/VTdFf1UaC9Nd3WO4DlwCSGqsbSM=; b=cj7Rab8ykTdUiGHwrrENMlksZRdRWEF0EkUzKpfsKMSurvJCHanIzUMSdbXm2SsWpuoQ9pCk1j5fC7ZNe0IedjZOf1f4g+2qqr/JIvpVqgYi+odhpRANcqxzcnjYSohKjmY3vZ5Vc78TRuMzfna70X7T1RO2ekYPJsZQDeseiQ4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75673+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060360511361.40800812125144; Wed, 26 May 2021 13:19:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rLHgYY1788612xQRX2epVYAP; Wed, 26 May 2021 13:19:20 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.2802.1622060354265655326 for ; Wed, 26 May 2021 13:19:14 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-eAzE46OTOAO8nkQrCJYXjg-1; Wed, 26 May 2021 16:19:09 -0400 X-MC-Unique: eAzE46OTOAO8nkQrCJYXjg-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2F5C7195D567; Wed, 26 May 2021 20:19:08 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD9B15C22A; Wed, 26 May 2021 20:19:05 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Jordan Justen , Min Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Tom Lendacky Subject: [edk2-devel] [PATCH 04/43] OvmfPkg: switch the AmdSev platform to the fw_cfg-only ACPI platform driver Date: Wed, 26 May 2021 22:14:07 +0200 Message-Id: <20210526201446.12554-5-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: 3hfOnczygunoUdxZ1OT96GvIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060360; bh=sCqGUQuLqxG0sxi/VTdFf1UaC9Nd3WO4DlwCSGqsbSM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=BHl80E+m3sWyS9r+gd6HafdJazRlK9asYU9DByppTmEl/i2NYyFzGqg4n2IXXNqDVtj +fg5EtgUT/hYzb0RA6s6Dy/abwPe62MNAnYOze9HT6z0mKexMRYfWZLoovAti+ou0d4+f XW1+yZcpKKYGeRblfDRn5JD7eodrVe+Q1zM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" For consistency with the historical OvmfPkg* platforms, switch the remotely attested, QEMU/KVM-only, AmdSev platform from the AcpiPlatformDxe driver to the QemuFwCfgAcpiPlatformDxe driver. No module remains dependent on XenPlatformLib, so remove the XenPlatformLib class resolution too, from the DSC file. Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Jordan Justen Cc: Min Xu Cc: Philippe Mathieu-Daud=C3=A9 Cc: Tom Lendacky Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/AmdSev/AmdSevX64.dsc | 4 +--- OvmfPkg/AmdSev/AmdSevX64.fdf | 9 +-------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index c5400ff6ab6c..9e7c459e9a8b 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -198,13 +198,12 @@ [LibraryClasses] ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf !endif =20 SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib= /BaseOrderedCollectionRedBlackTreeLib.inf - XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibN= ull.inf @@ -763,14 +762,13 @@ [Components] OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 # # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf - OvmfPkg/AcpiTables/AcpiTables.inf + OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf =20 # # Usb Support # MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf diff --git a/OvmfPkg/AmdSev/AmdSevX64.fdf b/OvmfPkg/AmdSev/AmdSevX64.fdf index 1c4bc076ffc8..9977b0f00a18 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.fdf +++ b/OvmfPkg/AmdSev/AmdSevX64.fdf @@ -257,14 +257,13 @@ [FV.DXEFV] INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf =20 INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf -INF RuleOverride=3DACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf +INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf =20 INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf =20 !if $(TOOL_CHAIN_TAG) !=3D "XCODE5" && $(BUILD_SHELL) =3D=3D TRUE @@ -427,18 +426,12 @@ [Rule.Common.UEFI_APPLICATION.BINARY] FILE APPLICATION =3D $(NAMED_GUID) { PE32 PE32 |.efi UI STRING=3D"$(MODULE_NAME)" Optional VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) } =20 -[Rule.Common.USER_DEFINED.ACPITABLE] - FILE FREEFORM =3D $(NAMED_GUID) { - RAW ACPI |.acpi - RAW ASL |.aml - } - [Rule.Common.SEC.RESET_VECTOR] FILE RAW =3D $(NAMED_GUID) { RAW BIN Align =3D 16 |.bin } =20 [Rule.Common.SMM_CORE] --=20 2.19.1.3.g30247aa5d201 -=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 (#75673): https://edk2.groups.io/g/devel/message/75673 Mute This Topic: https://groups.io/mt/83110328/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75674+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75674+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060416; cv=none; d=zohomail.com; s=zohoarc; b=gf8SX0FhXaPAD/DH36wX2iDUlQ3i+LXV/73xtjk4h8kYYbbroF38D9EllywhDdz/U6MSw/1nB8D8kI31hw9HwDsc87p8vIHerCOlbd8Wfud84CEME+eaiG1QkK/a6B0oWVO+mpiA2kO7LyENvUcGYxm3stlX8TIU9XQ1M8dgEj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060416; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=owpHsiazqsR956FN/DVuJgK9MA9gJZKD2/eiXe//THw=; b=LzndxLU4Vw312phNr/KO+UV86vHh8D5X4sEaldRNgzPjOdPRdAIqRcFr6S7iaBrPy75/XC/7nWLWbvTbunvRhwIXRb+JwN/n+wPbQcQd3NLxVzLpRhr5tOj+HIKF7K+MVbzxfw4WTkycXlaJIDnVz64dxR1jBYVCEI90VuHwBNI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75674+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060416834131.70447400174294; Wed, 26 May 2021 13:20:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id u1RHYY1788612xFw4Ig6Exxy; Wed, 26 May 2021 13:20:16 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.2824.1622060415774426376 for ; Wed, 26 May 2021 13:20:15 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-590-ju6bjIspOhKW4EkkBTLYIg-1; Wed, 26 May 2021 16:20:11 -0400 X-MC-Unique: ju6bjIspOhKW4EkkBTLYIg-1 X-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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7FF538030A0; Wed, 26 May 2021 20:20:10 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6803F2AE8B; Wed, 26 May 2021 20:20:09 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 05/43] OvmfPkg/README: bump minimum QEMU version to 1.7.1, machine types to 1.7 Date: Wed, 26 May 2021 22:14:08 +0200 Message-Id: <20210526201446.12554-6-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: IR9F85RqWpppGZ8SADI4Iftjx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060416; bh=owpHsiazqsR956FN/DVuJgK9MA9gJZKD2/eiXe//THw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=rBzh7z9Q2mDK6U3UsV4jDXc4VeIt+t9GzdmC6fkMXLybYPnQv2EHgHkFDdbDZjuL4Na XxNeE4rxnaNwvmB7DmguL16AD/y5G9YKhOh2zpfZjYxymfn6Nu7pmzOB3n97twCBPYOLS HXA0dMc3I3ZhRFZdbKAwc1xU44x7D4qwNcE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Due to switching to the QemuFwCfgAcpiPlatformDxe driver earlier in this series, require QEMU version 1.7.1 in the "OvmfPkg/README" file, and require 1.7 or later machine types too. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/README | 43 ++++---------------- 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/OvmfPkg/README b/OvmfPkg/README index 70f0c4152686..815e66528cb4 100644 --- a/OvmfPkg/README +++ b/OvmfPkg/README @@ -8,16 +8,16 @@ code base. More information can be found at: http://www.tianocore.org/ovmf/ =20 =3D=3D=3D STATUS =3D=3D=3D =20 Current capabilities: * IA32 and X64 architectures -* QEMU (0.10.0 or later) +* QEMU (version 1.7.1 or later, with 1.7 or later machine types) - Video, keyboard, IDE, CD-ROM, serial - Runs UEFI shell - - Optional NIC support. Requires QEMU (0.12.2 or later) + - Optional NIC support. * UEFI Linux boots * UEFI Windows 8 boots * UEFI Windows 7 & Windows 2008 Server boot (see important notes below!) =20 =3D=3D=3D FUTURE PLANS =3D=3D=3D =20 @@ -56,17 +56,16 @@ these binary outputs: More information on building OVMF can be found at: =20 https://github.com/tianocore/tianocore.github.io/wiki/How%20to%20build%20O= VMF =20 =3D=3D=3D RUNNING OVMF on QEMU =3D=3D=3D =20 -* QEMU 0.12.2 or later is required. * Be sure to use qemu-system-x86_64, if you are using and X64 firmware. (qemu-system-x86_64 works for the IA32 firmware as well, of course.) * Use OVMF for QEMU firmware (3 options available) - - Option 1: QEMU 1.6 or newer; Use QEMU -pflash parameter + - Option 1: Use QEMU -pflash parameter * QEMU/OVMF will use emulated flash, and fully support UEFI variables * Run qemu with: -pflash path/to/OVMF.fd * Note that this option is required for running SecureBoot-enabled bui= lds (-D SECURE_BOOT_ENABLE). - Option 2: Use QEMU -bios parameter * Note that UEFI variables will be partially emulated, and non-volatile @@ -181,47 +180,21 @@ when OVMF boots. (If a NIC is configured for the virtual machine, and -- dependent on boot = order -- PXE booting is attempted, but no DHCP server responds to OVMF's DHCP DISCOVER message at startup, the boot process may take approx. 3 seconds longer.) =20 * For each NIC emulated by qemu, a GPLv2 licensed UEFI driver is available= from - the iPXE project. The qemu source distribution, starting with version 1.= 5, - contains prebuilt binaries of these drivers (and of course allows one to - rebuild them from source as well). This is the recommended set of driver= s. + the iPXE project. The qemu source distribution contains prebuilt binarie= s of + these drivers (and of course allows one to rebuild them from source as w= ell). + This is the recommended set of drivers. =20 * Use the qemu -netdev and -device options, or the legacy -net option, to enable NIC support: . =20 -* For a qemu >=3D 1.5 binary running *without* any "-M machine" option whe= re - "machine" would identify a < qemu-1.5 configuration (for example: "-M - pc-i440fx-1.4" or "-M pc-0.13"), the iPXE drivers are automatically avai= lable - to and configured for OVMF in the default qemu installation. - -* For a qemu binary in [0.13, 1.5), or a qemu >=3D 1.5 binary with an "-M - machine" option where "machine" selects a < qemu-1.5 configuration: - - - download a >=3D 1.5.0-rc1 source tarball from , - - - extract the following iPXE driver files from the tarball and install t= hem - in a location that is accessible to qemu processes (this may depend on= your - SELinux configuration, for example): - - qemu-VERSION/pc-bios/efi-e1000.rom - qemu-VERSION/pc-bios/efi-ne2k_pci.rom - qemu-VERSION/pc-bios/efi-pcnet.rom - qemu-VERSION/pc-bios/efi-rtl8139.rom - qemu-VERSION/pc-bios/efi-virtio.rom - - - extend the NIC's -device option on the qemu command line with a matchi= ng - "romfile=3D" optarg: - - -device e1000,...,romfile=3D/full/path/to/efi-e1000.rom - -device ne2k_pci,...,romfile=3D/full/path/to/efi-ne2k_pci.rom - -device pcnet,...,romfile=3D/full/path/to/efi-pcnet.rom - -device rtl8139,...,romfile=3D/full/path/to/efi-rtl8139.rom - -device virtio-net-pci,...,romfile=3D/full/path/to/efi-virtio.rom +* The iPXE drivers are automatically available to and configured for OVMF = in + the default qemu installation. =20 * Independently of the iPXE NIC drivers, the default OVMF build provides a basic virtio-net driver, located in OvmfPkg/VirtioNetDxe. =20 * Also independently of the iPXE NIC drivers, Intel's proprietary E1000 NIC driver (from the BootUtil distribution) can be embedded in the OVMF imag= e at --=20 2.19.1.3.g30247aa5d201 -=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 (#75674): https://edk2.groups.io/g/devel/message/75674 Mute This Topic: https://groups.io/mt/83110349/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75675+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75675+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060478; cv=none; d=zohomail.com; s=zohoarc; b=QEA7g27Tl8sgvZ1TLzNq+scGZ4+OjnxD8otw6L8/7Vc3cb4bitVvaXaISaEolaWgIVXW+ZzPl75pdmALuJUI0d+wLytGDgGcOPvssrOy4q3bEJOyY6z/gBr2t/oIF8SkPXng2eyGIsYGG9JXub09mirzFj2WHOydVqgd0udIOsk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060478; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=8oLHIecdBDW3VBE2kdKVn165+skSpABp7qi8EwCXc+I=; b=mpol5kF2bKpfo3wjmwtf4jLhMEe69G6mwCODBzrXPQdQSc2zfchme/yuxYrqXbIOdl8B1N1NLmyBfs9ArT7H8dCfFAXNprSN8WtK5OOAWoQwon/ys/Uf46/tGAB94Kq2nrXV/B2nIhW/p8Hn+TfOLplqvW3YnO6YbfRIrmE82OA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75675+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060478497160.4980666304432; Wed, 26 May 2021 13:21:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FD5fYY1788612xGCzun9JsWl; Wed, 26 May 2021 13:21:18 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web12.2871.1622060477410175270 for ; Wed, 26 May 2021 13:21:17 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-561-Qg1ULkUrNGqo0X3uthQSeg-1; Wed, 26 May 2021 16:21:13 -0400 X-MC-Unique: Qg1ULkUrNGqo0X3uthQSeg-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B94EA195D560; Wed, 26 May 2021 20:21:12 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id A022810074E0; Wed, 26 May 2021 20:21:11 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 06/43] OvmfPkg/AcpiPlatformDxe: fix header file warts Date: Wed, 26 May 2021 22:14:09 +0200 Message-Id: <20210526201446.12554-7-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: Ss4VHCIWsfeUkCnbsqCnCh40x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060478; bh=8oLHIecdBDW3VBE2kdKVn165+skSpABp7qi8EwCXc+I=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=g6iiLzu3dIQ8AioqtKmdbi5g5J26vjiTNmEIpBYLnIRmc7aRE6s/nRi4me9Hx4Gtzw1 rbeUnUKddhnlXJjZ075GgaHPMoIbnvzj5dwUVQUDn+wPWoL5SgmIxp4fU8WOMHcBYLrJC +mDGRowxvmyIfS4hQ9to1MTskNRvNHDYLxM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" - Remove the leading underscores from the #include guard macro names; clean up the names in general. - Remove the useless "Include/" directory prefix from the public header pathnames. - Fix incorrect file-top comment. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 6 +++--- OvmfPkg/AcpiPlatformDxe/QemuLoader.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.h index 9597e028e4a7..c8dee8ab7a3c 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -1,16 +1,16 @@ /** @file - Sample ACPI Platform Driver + OVMF ACPI Platform Driver =20 Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#ifndef _ACPI_PLATFORM_H_INCLUDED_ -#define _ACPI_PLATFORM_H_INCLUDED_ +#ifndef ACPI_PLATFORM_H_ +#define ACPI_PLATFORM_H_ =20 #include =20 #include #include #include diff --git a/OvmfPkg/AcpiPlatformDxe/QemuLoader.h b/OvmfPkg/AcpiPlatformDxe= /QemuLoader.h index 70e0ebc33beb..bb3978e900ed 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuLoader.h +++ b/OvmfPkg/AcpiPlatformDxe/QemuLoader.h @@ -4,16 +4,16 @@ Copyright (C) 2014, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#ifndef __QEMU_LOADER_H__ -#define __QEMU_LOADER_H__ +#ifndef QEMU_LOADER_H_ +#define QEMU_LOADER_H_ =20 -#include +#include #include =20 // // The types and the documentation reflects the SeaBIOS interface. // #define QEMU_LOADER_FNAME_SIZE QEMU_FW_CFG_FNAME_SIZE --=20 2.19.1.3.g30247aa5d201 -=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 (#75675): https://edk2.groups.io/g/devel/message/75675 Mute This Topic: https://groups.io/mt/83110369/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75676+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75676+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060539; cv=none; d=zohomail.com; s=zohoarc; b=DkkzJ8xfnAeW8fafjeWM9Xl1dSoDCwuoL6DpWRxAMI3QnBcN5YcRhLuqVeurtz+2IPMgEP8qu7ZqMuC6QwUIlyIvMtiBxe4JWbHsuetnsewwOGxD6JmHqSLzl7bZ2XJbJIg4E8zZmzFKwyLfrPwMT2W0HcwX+kVNZ/oe57VqwEw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060539; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=gTI9mtwe+RL8V077XSgjPeL9Q7ZbCkT/Qc/wKXDVHKI=; b=UuEeSYs/I0ljkfWHIa5lT8LDswnHbwRGs7kHu3qCXHRkmcEnDxITwZY5hBzKFoiu7YiSZNpDEIbEmt+l5YcvGAOWYMMqM4JVZwXzt5K8uLiaNnItZgiluWz4mDTfx3Jn7/g1rYUyaKi6/TXsN/FcThAQLXilHLpFiMVISeolF+Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75676+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060539985902.8838421674525; Wed, 26 May 2021 13:22:19 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2P5eYY1788612xz5XsEWFob1; Wed, 26 May 2021 13:22:19 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web09.2972.1622060539002335049 for ; Wed, 26 May 2021 13:22:19 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-175-0f9vqJgVMkiTNTZtfON5XA-1; Wed, 26 May 2021 16:22:16 -0400 X-MC-Unique: 0f9vqJgVMkiTNTZtfON5XA-1 X-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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 063EC802690; Wed, 26 May 2021 20:22:15 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6C5B2AE8B; Wed, 26 May 2021 20:22:13 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 07/43] OvmfPkg/AcpiPlatformDxe: sort #includes and [LibraryClasses] Date: Wed, 26 May 2021 22:14:10 +0200 Message-Id: <20210526201446.12554-8-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: SlIPKiB39VZOBedzfNFEnpR6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060539; bh=gTI9mtwe+RL8V077XSgjPeL9Q7ZbCkT/Qc/wKXDVHKI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=TZmDLscDuqTxp41T74YDqaUrdwwX002QKgcwFATv6ZrISIohtxF7pDc2UXG/p3B/kIy YZIc0cLffv4omGohduB8fmTiKdB8YQSBvCpxCzF/6QuJHl6vmAkrWvcpL6dZAKUoo7GAP HCyH0wcPsNH8itTA6Rc1+HqlgepclXH2AjI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Place all public #includes first, all module-private #includes second. Separate them with a single empty line. Keep each section sorted in itself. Sort all sections in both INF files. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 18 +++++++++-------= -- OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf | 2 +- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 15 ++++++--------- OvmfPkg/AcpiPlatformDxe/EntryPoint.c | 1 + OvmfPkg/AcpiPlatformDxe/Qemu.c | 11 ++++++----- OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 12 ++++++------ OvmfPkg/AcpiPlatformDxe/Xen.c | 3 ++- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf index e486b8afa56d..4522d7f6110c 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -29,30 +29,30 @@ [Sources] Qemu.c QemuFwCfgAcpi.c QemuLoader.h Xen.c =20 [Packages] - MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec UefiCpuPkg/UefiCpuPkg.dec =20 [LibraryClasses] - UefiLib - PcdLib + BaseLib BaseMemoryLib DebugLib - UefiBootServicesTableLib - UefiDriverEntryPoint - QemuFwCfgLib - QemuFwCfgS3Lib - MemoryAllocationLib - BaseLib DxeServicesTableLib + MemoryAllocationLib OrderedCollectionLib + PcdLib + QemuFwCfgLib + QemuFwCfgS3Lib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib XenPlatformLib =20 [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiFirmwareVolume2ProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED gEfiPciIoProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf b/OvmfPkg= /AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf index c9ec4f60bc78..cc24f35bd83a 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf @@ -27,14 +27,14 @@ [Sources] PciDecoding.c QemuFwCfgAcpi.c QemuFwCfgAcpiPlatform.c QemuLoader.h =20 [Packages] - MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] BaseLib DebugLib MemoryAllocationLib diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.h index c8dee8ab7a3c..511a30782f6d 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -6,25 +6,22 @@ =20 **/ =20 #ifndef ACPI_PLATFORM_H_ #define ACPI_PLATFORM_H_ =20 -#include - -#include -#include -#include - +#include #include -#include #include #include +#include #include - -#include +#include +#include +#include +#include =20 typedef struct { EFI_PCI_IO_PROTOCOL *PciIo; UINT64 PciAttributes; } ORIGINAL_ATTRIBUTES; =20 diff --git a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c b/OvmfPkg/AcpiPlatformDxe= /EntryPoint.c index f66f89291157..fb07ed85373d 100644 --- a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c +++ b/OvmfPkg/AcpiPlatformDxe/EntryPoint.c @@ -5,12 +5,13 @@ Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include + #include "AcpiPlatform.h" =20 STATIC EFI_ACPI_TABLE_PROTOCOL * FindAcpiTableProtocol ( VOID diff --git a/OvmfPkg/AcpiPlatformDxe/Qemu.c b/OvmfPkg/AcpiPlatformDxe/Qemu.c index 7fb42270043f..bed3b16159a6 100644 --- a/OvmfPkg/AcpiPlatformDxe/Qemu.c +++ b/OvmfPkg/AcpiPlatformDxe/Qemu.c @@ -6,20 +6,21 @@ Copyright (C) 2012-2014, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#include "AcpiPlatform.h" +#include #include -#include -#include #include -#include +#include #include -#include +#include +#include + +#include "AcpiPlatform.h" =20 BOOLEAN QemuDetected ( VOID ) { diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatform= Dxe/QemuFwCfgAcpi.c index b62027db6e66..c07b84a21385 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c @@ -5,23 +5,23 @@ Copyright (C) 2012-2014, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#include "AcpiPlatform.h" -#include "QemuLoader.h" +#include #include +#include #include +#include +#include #include #include -#include -#include -#include -#include =20 +#include "AcpiPlatform.h" +#include "QemuLoader.h" =20 // // The user structure for the ordered collection that will track the fw_cfg // blobs under processing. // typedef struct { diff --git a/OvmfPkg/AcpiPlatformDxe/Xen.c b/OvmfPkg/AcpiPlatformDxe/Xen.c index 289ef971c4b8..1d69989042c6 100644 --- a/OvmfPkg/AcpiPlatformDxe/Xen.c +++ b/OvmfPkg/AcpiPlatformDxe/Xen.c @@ -5,15 +5,16 @@ Copyright (c) 2012, Bei Guan =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#include "AcpiPlatform.h" #include =20 +#include "AcpiPlatform.h" + #define XEN_ACPI_PHYSICAL_ADDRESS 0x000EA020 #define XEN_BIOS_PHYSICAL_END 0x000FFFFF =20 EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *XenAcpiRsdpStructurePtr =3D= NULL; =20 /** --=20 2.19.1.3.g30247aa5d201 -=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 (#75676): https://edk2.groups.io/g/devel/message/75676 Mute This Topic: https://groups.io/mt/83110397/1787277 Mute #includes:https://edk2.groups.io/g/devel/mutehashtag/includes 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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75677+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75677+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060606; cv=none; d=zohomail.com; s=zohoarc; b=Xu9+xQ0uetxFEMmIzXq//fVu9HhUTCZBlo9nsycBQ9d9noCMTZazpM0iwOutT0I/ktmZqiiOkXbKchj2/Na8aNPKnh72NDD/8sP22TSUEfYsDtOP1zlmNLgVNoPMjBwgPPtcp3mC7U68kOmcZgZMdpZloYEIcWS5H3AsUhWLC+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060606; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=um3UyTbeGHCzgci7koTN+l8YC6kRsCNTElll4Bcn5ww=; b=LvPNswvWZR3u8iMn8ODzk/6NiUH0CVnKIo+bK0H4fJYH/PE2nf9f/9PrP3R38AdzpL5jqs3JbkF33g5xGZqgp+7owrluw6S9zkeB7mihKdlIUgfuc9fvG6c0w755G6eNJHTKsG3zWVMjLwSxTee1Pj674udKF+M5/hEJtfiARtw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75677+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206060664886.27398168669197; Wed, 26 May 2021 13:23:26 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id J2pOYY1788612x2r1VHkQG5D; Wed, 26 May 2021 13:23:26 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.2895.1622060600763920017 for ; Wed, 26 May 2021 13:23:20 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-130-_-HBps1dML-dXt9oXQdvww-1; Wed, 26 May 2021 16:23:18 -0400 X-MC-Unique: _-HBps1dML-dXt9oXQdvww-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 47BBE80ED8B; Wed, 26 May 2021 20:23:17 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35AED60C5A; Wed, 26 May 2021 20:23:16 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 08/43] OvmfPkg/AcpiPlatformDxe/QemuLoader.h: remove QemuFwCfgLib class dependency Date: Wed, 26 May 2021 22:14:11 +0200 Message-Id: <20210526201446.12554-9-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: U9e50SfM2iisVHtXvaYQfKxdx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060606; bh=um3UyTbeGHCzgci7koTN+l8YC6kRsCNTElll4Bcn5ww=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=ujBG8XRuqYkWKzSSOdls3NtiwVH2Wy5Pzt/qIsMz9xpoSJZWquhRXTEDen3cbZxQdMp 9GWxH4XhbSVMCiS7CrFeUkJ2cyojFuz5vYCHcVH6YIAZCyTwBkH4c0pEiRRaxQFMUwbfo MYxpqQTtxUfOA863rziUjXUjvm/U6WsN8o0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" "QemuLoader.h" needs the QEMU_FW_CFG_FNAME_SIZE macro. This macro used to live in the QemuFwCfgLib class header, but we moved it to the more foundational IndustryStandard include file called "QemuFwCfg.h" in commit 5583a8a4ffd0 ("OvmfPkg/QemuFwCfgLib: move types/macros from lib class to IndustryStandard", 2017-02-22). Replace the lib class dependency with the more basic IndustryStandard dependency in "QemuLoader.h". Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/AcpiPlatformDxe/QemuLoader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/AcpiPlatformDxe/QemuLoader.h b/OvmfPkg/AcpiPlatformDxe= /QemuLoader.h index bb3978e900ed..5782a23c4398 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuLoader.h +++ b/OvmfPkg/AcpiPlatformDxe/QemuLoader.h @@ -8,13 +8,13 @@ **/ =20 #ifndef QEMU_LOADER_H_ #define QEMU_LOADER_H_ =20 #include -#include +#include =20 // // The types and the documentation reflects the SeaBIOS interface. // #define QEMU_LOADER_FNAME_SIZE QEMU_FW_CFG_FNAME_SIZE =20 --=20 2.19.1.3.g30247aa5d201 -=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 (#75677): https://edk2.groups.io/g/devel/message/75677 Mute This Topic: https://groups.io/mt/83110422/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75678+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75678+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060665; cv=none; d=zohomail.com; s=zohoarc; b=S535sEJ5DKzyXauV47wU5K9qkXG2cujW746EyFMaPRH7sBTSOoCOWwIWdqfEQdB2zNzRyxknTDt6pwGCKUf8uMI8wRUUNZFu4zA9DhIKevnbFyagqta1a9a96epLXvB6qJpk2yFnkzFvhbCaEawHxwHb8JOD64MsYxaRwYeVv0I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060665; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=oHEvbw6zLOaYTdLPgKLTcv5qHjwud/OfQAZkwM4mxp4=; b=WnNXwMi61EfYsjCWISVz94jmTphse1YX68tabA/L/NOHV1btYSmPMS7Lo4nXJvxWpZaK22eeqvaowG+yHFKhDn+9Imofc/85XtjoOhTfJrsCDYTNPxWLoJv5qllYNPZi0MEkrj5eaN80OgdFfMgN5TnJEriERPJKOKy1XZSsiGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75678+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060665549522.5028648109043; Wed, 26 May 2021 13:24:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id U9v1YY1788612xoUc1c890VS; Wed, 26 May 2021 13:24:25 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.2910.1622060664665166843 for ; Wed, 26 May 2021 13:24:24 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-306-TbyHf2Z5NO-UQC9ON9q_gQ-1; Wed, 26 May 2021 16:24:21 -0400 X-MC-Unique: TbyHf2Z5NO-UQC9ON9q_gQ-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 860C710CE780; Wed, 26 May 2021 20:24:19 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E5085D6D3; Wed, 26 May 2021 20:24:18 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 09/43] OvmfPkg/AcpiPlatformDxe: move "QemuLoader.h" to IndustryStandard Date: Wed, 26 May 2021 22:14:12 +0200 Message-Id: <20210526201446.12554-10-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: FfOD0PrfHDVoInkhItIKSa08x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060665; bh=oHEvbw6zLOaYTdLPgKLTcv5qHjwud/OfQAZkwM4mxp4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=g14/UKGvxaqPLr5WxPOhL3nwdwUay30JXx+F+HY6x4O2uzBdoM1w44GEosebzQfaF9k 85QSxUa/5jMgLABP09XYr+3ycDpalZVwQOegzU16mRzktAMiN/swQmLDEz+j8DTcc0gnK SE8LC1eEHrnCSc156guwEcbBPIiHc913LVc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Turn the "QemuLoader.h" header into a public (IndustryStandard) one. The QEMU ACPI linker-loader interface is stable between QEMU and multiple guest firmwares. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/{AcpiPlatformDxe =3D> Include/IndustryStandard}/QemuLoader.h | 0 OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf | 1 - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 2 +- 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/QemuLoader.h b/OvmfPkg/Include/Industr= yStandard/QemuLoader.h similarity index 100% rename from OvmfPkg/AcpiPlatformDxe/QemuLoader.h rename to OvmfPkg/Include/IndustryStandard/QemuLoader.h diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf index 4522d7f6110c..3daeb2ee42d2 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -25,13 +25,12 @@ [Sources] AcpiPlatform.h BootScript.c EntryPoint.c PciDecoding.c Qemu.c QemuFwCfgAcpi.c - QemuLoader.h Xen.c =20 [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf b/OvmfPkg= /AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf index cc24f35bd83a..48c8269a8b6f 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf @@ -24,13 +24,12 @@ [Sources] AcpiPlatform.h BootScript.c EntryPoint.c PciDecoding.c QemuFwCfgAcpi.c QemuFwCfgAcpiPlatform.c - QemuLoader.h =20 [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatform= Dxe/QemuFwCfgAcpi.c index c07b84a21385..621e69410da9 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c @@ -6,22 +6,22 @@ =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include +#include #include #include #include #include #include #include #include =20 #include "AcpiPlatform.h" -#include "QemuLoader.h" =20 // // The user structure for the ordered collection that will track the fw_cfg // blobs under processing. // typedef struct { --=20 2.19.1.3.g30247aa5d201 -=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 (#75678): https://edk2.groups.io/g/devel/message/75678 Mute This Topic: https://groups.io/mt/83110447/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75679+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75679+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060732; cv=none; d=zohomail.com; s=zohoarc; b=XY6Y4e3KKxI5tWvcLvY80Onif2Rs2z82DDSNNvO8m8F3X8MIdHI1v87j2ueUArx1yKynEtnDtbL3l5DzicnN7qi+0s2UT8EeoSCOw+8sYKbj2bN/wvcx2p0upmrRJIwgsIDME+NlqTlhZ2z3+5LsFnxqMZtocfzzmjim+a3nZpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060732; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ZTE2+mg3uRQMayI6sQ/aIZoxsB7DZuPrXCnusZKuqxQ=; b=hZxvN6G1qpqkzcos1DeFRF0e2r8weR+vkOwr61eM9tVIjyQ7kyuzd0zjNa6sY5xbUwP/y+eBRq/y1OChjyeFmeSIZU7e0DuXQ8wYXLg56P5ZT9/EyhNJZd9uMmW63TUqnSQiRLXndGKC7j/IsllwqRuggj3QY5RI1ZGlNnH4WGk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75679+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206073214820.688212990640636; Wed, 26 May 2021 13:25:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id g0KsYY1788612xrHD16M3E9K; Wed, 26 May 2021 13:25:31 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web11.2888.1622060726029045450 for ; Wed, 26 May 2021 13:25:26 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-473-QJzUSLphOWy7v5tSMTliRQ-1; Wed, 26 May 2021 16:25:22 -0400 X-MC-Unique: QJzUSLphOWy7v5tSMTliRQ-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB0536415F; Wed, 26 May 2021 20:25:21 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BB1810023AF; Wed, 26 May 2021 20:25:20 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 10/43] OvmfPkg/AcpiPlatformDxe: consolidate #includes and [LibraryClasses] Date: Wed, 26 May 2021 22:14:13 +0200 Message-Id: <20210526201446.12554-11-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: dHnkkg6gi1PAznCwB16e9UbGx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060731; bh=ZTE2+mg3uRQMayI6sQ/aIZoxsB7DZuPrXCnusZKuqxQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=ZNsfKOGSmkkcxD2VIAAZ4VSabxpaH2J5lSpkw2zZyPIeQBr03fSy9WaFBuIpUBbpt7k 31K+HPFk1g878NwQpKsxhTDuSjI4lGAOyJKuwwd7MAbe+BKMSiXHV2yay7nrJSQSPr2g3 ux9TRiZuDvgOy8rSxVf9V4M3RX5k/VgctiE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" - #include only such public headers in "AcpiPlatform.h" that are required by the function declarations and type definitions introduced in "AcpiPlatform.h". Don't use "AcpiPlatform.h" as a convenience #include file. - In every file, list every necessary public #include individually, with an example identifier that's actually consumed. - Remove unnecessary lib classes, add unlisted lib classes. - Remove unnecessary #include directives, add unlisted #include directives. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf | 2 ++ OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 12 ++---------- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c | 5 +++++ OvmfPkg/AcpiPlatformDxe/BootScript.c | 7 ++++--- OvmfPkg/AcpiPlatformDxe/EntryPoint.c | 6 +++++- OvmfPkg/AcpiPlatformDxe/PciDecoding.c | 4 +++- OvmfPkg/AcpiPlatformDxe/Qemu.c | 14 +++++++------- OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 19 ++++++++++------= --- OvmfPkg/AcpiPlatformDxe/Xen.c | 4 +++- 10 files changed, 41 insertions(+), 33 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf index 3daeb2ee42d2..77607298cbea 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -45,13 +45,12 @@ [LibraryClasses] OrderedCollectionLib PcdLib QemuFwCfgLib QemuFwCfgS3Lib UefiBootServicesTableLib UefiDriverEntryPoint - UefiLib XenPlatformLib =20 [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiFirmwareVolume2ProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED gEfiPciIoProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf b/OvmfPkg= /AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf index 48c8269a8b6f..dac25d1505be 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf @@ -32,15 +32,17 @@ [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] BaseLib + BaseMemoryLib DebugLib MemoryAllocationLib OrderedCollectionLib + PcdLib QemuFwCfgLib QemuFwCfgS3Lib UefiBootServicesTableLib UefiDriverEntryPoint =20 [Protocols] diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.h index 511a30782f6d..d98b79baab40 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -6,22 +6,14 @@ =20 **/ =20 #ifndef ACPI_PLATFORM_H_ #define ACPI_PLATFORM_H_ =20 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // EFI_ACPI_TABLE_PROTOCOL +#include // EFI_PCI_IO_PROTOCOL =20 typedef struct { EFI_PCI_IO_PROTOCOL *PciIo; UINT64 PciAttributes; } ORIGINAL_ATTRIBUTES; =20 diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.c index f872d91aea72..efbbfab89d2b 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c @@ -3,12 +3,17 @@ =20 Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 +#include // ASSERT_EFI_ERROR() +#include // gBS +#include // XenDetected() +#include // gEfiFirmwareVolume2Protoc= ol... + #include "AcpiPlatform.h" =20 EFI_STATUS EFIAPI InstallAcpiTable ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, diff --git a/OvmfPkg/AcpiPlatformDxe/BootScript.c b/OvmfPkg/AcpiPlatformDxe= /BootScript.c index 7b1b9586da41..f2d1089e91ce 100644 --- a/OvmfPkg/AcpiPlatformDxe/BootScript.c +++ b/OvmfPkg/AcpiPlatformDxe/BootScript.c @@ -4,15 +4,16 @@ =20 Copyright (C) 2017, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 -#include -#include -#include +#include // CpuDeadLoop() +#include // DEBUG() +#include // AllocatePool() +#include // QemuFwCfgS3ScriptSkipBytes() =20 #include "AcpiPlatform.h" =20 =20 // // Condensed structure for capturing the fw_cfg operations -- select, skip, diff --git a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c b/OvmfPkg/AcpiPlatformDxe= /EntryPoint.c index fb07ed85373d..bb5fe82c18d4 100644 --- a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c +++ b/OvmfPkg/AcpiPlatformDxe/EntryPoint.c @@ -4,13 +4,17 @@ Copyright (C) 2015, Red Hat, Inc. Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 -#include +#include // gRootBridgesConnectedE= ve... +#include // DEBUG() +#include // PcdGetBool() +#include // gBS +#include // EFI_ACPI_TABLE_PROTOCOL =20 #include "AcpiPlatform.h" =20 STATIC EFI_ACPI_TABLE_PROTOCOL * FindAcpiTableProtocol ( diff --git a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c b/OvmfPkg/AcpiPlatformDx= e/PciDecoding.c index 73894106c9ec..6ba4c936ad8e 100644 --- a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c +++ b/OvmfPkg/AcpiPlatformDxe/PciDecoding.c @@ -4,13 +4,15 @@ =20 Copyright (C) 2016, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 -#include +#include // DEBUG() +#include // AllocatePool() +#include // gBS =20 #include "AcpiPlatform.h" =20 =20 /** Collect all PciIo protocol instances in the system. Save their original diff --git a/OvmfPkg/AcpiPlatformDxe/Qemu.c b/OvmfPkg/AcpiPlatformDxe/Qemu.c index bed3b16159a6..bdcc46b7186a 100644 --- a/OvmfPkg/AcpiPlatformDxe/Qemu.c +++ b/OvmfPkg/AcpiPlatformDxe/Qemu.c @@ -6,19 +6,19 @@ Copyright (C) 2012-2014, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#include -#include -#include -#include -#include -#include -#include +#include // EFI_ACPI_1_0_IO_APIC_STRUCTURE +#include // CopyMem() +#include // DEBUG() +#include // gDS +#include // AllocatePool() +#include // PcdGet16() +#include // QemuFwCfgIsAvailable() =20 #include "AcpiPlatform.h" =20 BOOLEAN QemuDetected ( VOID diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatform= Dxe/QemuFwCfgAcpi.c index 621e69410da9..df800b149275 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c @@ -5,21 +5,22 @@ Copyright (C) 2012-2014, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // EFI_ACPI_DESCRIPTION_HEAD= ER +#include // QEMU_LOADER_FNAME_SIZE +#include // AsciiStrCmp() +#include // CopyMem() +#include // DEBUG() +#include // AllocatePool() +#include // OrderedCollectionMin() +#include // QemuFwCfgFindFile() +#include // QemuFwCfgS3Enabled() +#include // gBS =20 #include "AcpiPlatform.h" =20 // // The user structure for the ordered collection that will track the fw_cfg // blobs under processing. diff --git a/OvmfPkg/AcpiPlatformDxe/Xen.c b/OvmfPkg/AcpiPlatformDxe/Xen.c index 1d69989042c6..be2c5d695846 100644 --- a/OvmfPkg/AcpiPlatformDxe/Xen.c +++ b/OvmfPkg/AcpiPlatformDxe/Xen.c @@ -5,13 +5,15 @@ Copyright (c) 2012, Bei Guan =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#include +#include // CpuDeadLoop() +#include // DEBUG() +#include // XenGetInfoHOB() =20 #include "AcpiPlatform.h" =20 #define XEN_ACPI_PHYSICAL_ADDRESS 0x000EA020 #define XEN_BIOS_PHYSICAL_END 0x000FFFFF =20 --=20 2.19.1.3.g30247aa5d201 -=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 (#75679): https://edk2.groups.io/g/devel/message/75679 Mute This Topic: https://groups.io/mt/83110470/1787277 Mute #includes:https://edk2.groups.io/g/devel/mutehashtag/includes 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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75680+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75680+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060795; cv=none; d=zohomail.com; s=zohoarc; b=kq9RwGrEWzFn+1HRT7TztG/pLkvG8/MtiibhPTPqPK+0PeukBP0TSX3ihv6gwTSBeRFSJ+k+u80oLvBwZDl+3WV/z0tI6C/GxyU93gRNatTGqE+PDvcErUZLBdEd3Dnr9JjTNB1WU3TvOiEhqg3131o8zQHzBSfNiI5bfJGRDXY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060795; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=mFsMjStanVhdMrfd+jLlucy6MMt1MkFvg+inynMC1us=; b=cO71f0moEQbsKMuMQ95eLpDt+WzqhQpBubZxJCxDM8Ljx0wgiTXuvb/wF39KvMCemKcwBiBRuQhhSlpqPYqeZqCFvsj0MYWE4vitQXWVJmE2GjvWYhIpNbSGWrXhmuCqBkpi2XeeXXJUmYxPZ7WqyotzoeRz0WcmcgWl/9VFIXA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75680+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060795147786.5546899324956; Wed, 26 May 2021 13:26:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jDiwYY1788612xNp6idgnZBu; Wed, 26 May 2021 13:26:34 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web08.2986.1622060788911209241 for ; Wed, 26 May 2021 13:26:29 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-588-LXGphXpsMIyj4yN_vDamQg-1; Wed, 26 May 2021 16:26:26 -0400 X-MC-Unique: LXGphXpsMIyj4yN_vDamQg-1 X-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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B9156415B; Wed, 26 May 2021 20:26:25 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05F9D70BAB; Wed, 26 May 2021 20:26:22 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Andrew Fish , Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , Leif Lindholm , Michael D Kinney , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 11/43] OvmfPkg/XenAcpiPlatformDxe: create from AcpiPlatformDxe Date: Wed, 26 May 2021 22:14:14 +0200 Message-Id: <20210526201446.12554-12-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: VYsmKzOtCjG4iuPw0eeOksY1x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060794; bh=mFsMjStanVhdMrfd+jLlucy6MMt1MkFvg+inynMC1us=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=u2qhI8U8meUj+NO3KxnITGWGaHF4vNVgVatJo9+3X06Ibba/opT44fjOpL+m77Ugr32 QQ/3QJ0Z/vViyttP72t5Cj06L3DBRn/i+RRm2ylpD6o3wmEMzAa5EJAI4oHotbe3WOalD Wb61w33NXGutWAtPs1YdimWyZJFqgR8lLUc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Create an almost verbatim copy of the "OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf" driver for the OvmfXen platform. We're going to trim the driver in subsequent patches. Ultimately, the XenAcpiPlatformDxe driver will duplicate a negligible amount of code that is currently present in the QemuFwCfgAcpiPlatformDxe driver. List the new driver in "Maintainers.txt", in the "OvmfPkg: Xen-related modules" section. Switch the OvmfXen platform to the new driver at once. This patch should be reviewed with "git show --find-copies-harder". Cc: Andrew Fish Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Leif Lindholm Cc: Michael D Kinney Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/OvmfXen.dsc = | 2 +- OvmfPkg/OvmfXen.fdf = | 2 +- OvmfPkg/{AcpiPlatformDxe/AcpiPlatformDxe.inf =3D> XenAcpiPlatformDxe/XenAc= piPlatformDxe.inf} | 7 ++++--- Maintainers.txt = | 1 + OvmfPkg/{AcpiPlatformDxe =3D> XenAcpiPlatformDxe}/AcpiPlatform.h = | 3 ++- OvmfPkg/{AcpiPlatformDxe =3D> XenAcpiPlatformDxe}/AcpiPlatform.c = | 3 ++- OvmfPkg/{AcpiPlatformDxe =3D> XenAcpiPlatformDxe}/BootScript.c = | 2 +- OvmfPkg/{AcpiPlatformDxe =3D> XenAcpiPlatformDxe}/EntryPoint.c = | 4 ++-- OvmfPkg/{AcpiPlatformDxe =3D> XenAcpiPlatformDxe}/PciDecoding.c = | 2 +- OvmfPkg/{AcpiPlatformDxe =3D> XenAcpiPlatformDxe}/Qemu.c = | 3 +-- OvmfPkg/{AcpiPlatformDxe =3D> XenAcpiPlatformDxe}/QemuFwCfgAcpi.c = | 2 +- OvmfPkg/{AcpiPlatformDxe =3D> XenAcpiPlatformDxe}/Xen.c = | 1 + 12 files changed, 18 insertions(+), 14 deletions(-) diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index e535503e385d..4d5171cd43c1 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -649,13 +649,13 @@ [Components] OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 # # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf + OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf OvmfPkg/AcpiTables/AcpiTables.inf MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf =20 # diff --git a/OvmfPkg/OvmfXen.fdf b/OvmfPkg/OvmfXen.fdf index c7d4d1853027..85306245b50f 100644 --- a/OvmfPkg/OvmfXen.fdf +++ b/OvmfPkg/OvmfXen.fdf @@ -349,13 +349,13 @@ [FV.DXEFV] INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf =20 INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +INF OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf INF RuleOverride=3DACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf =20 INF FatPkg/EnhancedFatDxe/Fat.inf diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/XenAcpiP= latformDxe/XenAcpiPlatformDxe.inf similarity index 85% copy from OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf copy to OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf index 77607298cbea..379b5d56d565 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf @@ -1,18 +1,19 @@ ## @file -# OVMF ACPI Platform Driver +# OVMF ACPI Platform Driver for Xen guests # +# Copyright (C) 2021, Red Hat, Inc. # Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D AcpiPlatform - FILE_GUID =3D 49970331-E3FA-4637-9ABC-3B7868676970 + BASE_NAME =3D XenAcpiPlatform + FILE_GUID =3D fa0a48ac-767d-4c88-b70c-ec54c8b900c4 MODULE_TYPE =3D DXE_DRIVER VERSION_STRING =3D 1.0 ENTRY_POINT =3D AcpiPlatformEntryPoint =20 # # The following information is for reference only and not required by the = build tools. diff --git a/Maintainers.txt b/Maintainers.txt index cafe6b1ab85d..50c87d1ac29a 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -503,12 +503,13 @@ F: OvmfPkg/Library/XenRealTimeClockLib/ F: OvmfPkg/OvmfXen.* F: OvmfPkg/OvmfXenElfHeaderGenerator.c F: OvmfPkg/PlatformPei/MemDetect.c F: OvmfPkg/PlatformPei/Platform.* F: OvmfPkg/PlatformPei/Xen.* F: OvmfPkg/SmbiosPlatformDxe/*Xen.c +F: OvmfPkg/XenAcpiPlatformDxe/ F: OvmfPkg/XenBusDxe/ F: OvmfPkg/XenIoPciDxe/ F: OvmfPkg/XenIoPvhDxe/ F: OvmfPkg/XenPlatformPei/ F: OvmfPkg/XenPvBlkDxe/ F: OvmfPkg/XenResetVector/ diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/XenAcpiPlatfo= rmDxe/AcpiPlatform.h similarity index 91% copy from OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h copy to OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h index d98b79baab40..6259697c4b2d 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h @@ -1,9 +1,10 @@ /** @file - OVMF ACPI Platform Driver + OVMF ACPI Platform Driver for Xen guests =20 + Copyright (C) 2021, Red Hat, Inc. Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #ifndef ACPI_PLATFORM_H_ diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/XenAcpiPlatfo= rmDxe/AcpiPlatform.c similarity index 95% copy from OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c copy to OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c index efbbfab89d2b..2b2dc576754b 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c @@ -1,9 +1,10 @@ /** @file - OVMF ACPI Platform Driver + OVMF ACPI Platform Driver for Xen guests =20 + Copyright (C) 2021, Red Hat, Inc. Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include // ASSERT_EFI_ERROR() diff --git a/OvmfPkg/AcpiPlatformDxe/BootScript.c b/OvmfPkg/XenAcpiPlatform= Dxe/BootScript.c similarity index 96% copy from OvmfPkg/AcpiPlatformDxe/BootScript.c copy to OvmfPkg/XenAcpiPlatformDxe/BootScript.c index f2d1089e91ce..14d1e68694cb 100644 --- a/OvmfPkg/AcpiPlatformDxe/BootScript.c +++ b/OvmfPkg/XenAcpiPlatformDxe/BootScript.c @@ -1,11 +1,11 @@ /** @file Append an ACPI S3 Boot Script fragment from the QEMU_LOADER_WRITE_POINTER commands of QEMU's fully processed table linker/loader script. =20 - Copyright (C) 2017, Red Hat, Inc. + Copyright (C) 2017-2021, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include // CpuDeadLoop() #include // DEBUG() diff --git a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c b/OvmfPkg/XenAcpiPlatform= Dxe/EntryPoint.c similarity index 93% copy from OvmfPkg/AcpiPlatformDxe/EntryPoint.c copy to OvmfPkg/XenAcpiPlatformDxe/EntryPoint.c index bb5fe82c18d4..b6d0835fe3d4 100644 --- a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c +++ b/OvmfPkg/XenAcpiPlatformDxe/EntryPoint.c @@ -1,10 +1,10 @@ /** @file - Entry point of OVMF ACPI Platform Driver + Entry point of OVMF ACPI Platform Driver for Xen guests =20 - Copyright (C) 2015, Red Hat, Inc. + Copyright (C) 2015-2021, Red Hat, Inc. Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include // gRootBridgesConnectedE= ve... diff --git a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c b/OvmfPkg/XenAcpiPlatfor= mDxe/PciDecoding.c similarity index 96% copy from OvmfPkg/AcpiPlatformDxe/PciDecoding.c copy to OvmfPkg/XenAcpiPlatformDxe/PciDecoding.c index 6ba4c936ad8e..00fc57eb13eb 100644 --- a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c +++ b/OvmfPkg/XenAcpiPlatformDxe/PciDecoding.c @@ -1,11 +1,11 @@ /** @file Temporarily enable IO and MMIO decoding for all PCI devices while QEMU regenerates the ACPI tables. =20 - Copyright (C) 2016, Red Hat, Inc. + Copyright (C) 2016-2021, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include // DEBUG() #include // AllocatePool() diff --git a/OvmfPkg/AcpiPlatformDxe/Qemu.c b/OvmfPkg/XenAcpiPlatformDxe/Qe= mu.c similarity index 96% copy from OvmfPkg/AcpiPlatformDxe/Qemu.c copy to OvmfPkg/XenAcpiPlatformDxe/Qemu.c index bdcc46b7186a..b4a407c41b71 100644 --- a/OvmfPkg/AcpiPlatformDxe/Qemu.c +++ b/OvmfPkg/XenAcpiPlatformDxe/Qemu.c @@ -1,13 +1,12 @@ /** @file OVMF ACPI QEMU support =20 + Copyright (C) 2012-2021, Red Hat, Inc. Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
=20 - Copyright (C) 2012-2014, Red Hat, Inc. - SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include // EFI_ACPI_1_0_IO_APIC_STRUCTURE #include // CopyMem() diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/XenAcpiPlatf= ormDxe/QemuFwCfgAcpi.c similarity index 97% copy from OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c copy to OvmfPkg/XenAcpiPlatformDxe/QemuFwCfgAcpi.c index df800b149275..521c06cf546f 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/XenAcpiPlatformDxe/QemuFwCfgAcpi.c @@ -1,11 +1,11 @@ /** @file OVMF ACPI support using QEMU's fw-cfg interface =20 + Copyright (C) 2012-2021, Red Hat, Inc. Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
- Copyright (C) 2012-2014, Red Hat, Inc. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include // EFI_ACPI_DESCRIPTION_HEAD= ER diff --git a/OvmfPkg/AcpiPlatformDxe/Xen.c b/OvmfPkg/XenAcpiPlatformDxe/Xen= .c similarity index 96% copy from OvmfPkg/AcpiPlatformDxe/Xen.c copy to OvmfPkg/XenAcpiPlatformDxe/Xen.c index be2c5d695846..e8395db548d9 100644 --- a/OvmfPkg/AcpiPlatformDxe/Xen.c +++ b/OvmfPkg/XenAcpiPlatformDxe/Xen.c @@ -1,9 +1,10 @@ /** @file OVMF ACPI Xen support =20 + Copyright (C) 2021, Red Hat, Inc. Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
Copyright (c) 2012, Bei Guan =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ --=20 2.19.1.3.g30247aa5d201 -=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 (#75680): https://edk2.groups.io/g/devel/message/75680 Mute This Topic: https://groups.io/mt/83110483/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75681+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75681+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060860; cv=none; d=zohomail.com; s=zohoarc; b=A2snThamorLMASnNnCk0QBvsNiRHHHCsgRZzlPiSQGNo8s/rRjCn2jUPmCnziXWrJEC2UNufSig5rsHOnuTbWo88D4hk55XCB8pYdi8HJcmQ9/leo0RyR7JLSKCKvDpp+gCCXd2W2KcQDAKZgtbcWZBVopvW8eh/B+fHXQEl9gk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060860; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Onm/k+QYSBVoTyoUszF8WORB14fYI3MltgOcguVoXcI=; b=KbSTQfZ11p9I9gEQmYtb2D6lq5buZXhw38h7jNMqWUr5K9ViWRaYhFDmEN3YyzJYulg62/DrhthjIrE0PL8SDmDmH9H49k4HJFzkSwDyDXoTJYbgKuqcXIijttjxSdZIG7G6Ff37WYYLyd8hyI3h1GoNEf0ybzunsMhMzIuZIUo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75681+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060860924341.0240578000023; Wed, 26 May 2021 13:27:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7OkWYY1788612x6cPyr9dHUK; Wed, 26 May 2021 13:27:40 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.2923.1622060854859718477 for ; Wed, 26 May 2021 13:27:35 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-535-pXUIMjkzMRKTXv1fyEw7DQ-1; Wed, 26 May 2021 16:27:30 -0400 X-MC-Unique: pXUIMjkzMRKTXv1fyEw7DQ-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A6EA46D254; Wed, 26 May 2021 20:27:28 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 599B569FB5; Wed, 26 May 2021 20:27:26 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Andrew Fish , Ard Biesheuvel , Jordan Justen , Leif Lindholm , Michael D Kinney , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 12/43] OvmfPkg/AcpiPlatformDxe: remove the "AcpiPlatformDxe.inf" driver Date: Wed, 26 May 2021 22:14:15 +0200 Message-Id: <20210526201446.12554-13-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: pJ99XfCzV8jOJnLCL9HSTAY4x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060860; bh=Onm/k+QYSBVoTyoUszF8WORB14fYI3MltgOcguVoXcI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=MLn+wXLAyMP6KkfY08stgNo9DV/y0nKx3F+aArE0T4LaLn+xEfJM4YubIPb3bRESOGg AG4zuLnQkf51p8tp1L21EpIry2TJzFBj1cwJd5pYcN+8fGLzKlef3wy9cYJG/BB3mYHlR fGCuyirNnM478z74pIhSfJloOh5/iUN5VtI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The "OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf" module is no longer referenced in any platform DSC file; remove it. That orphans the "AcpiPlatform.c", "Qemu.c" and "Xen.c" files in the "OvmfPkg/AcpiPlatformDxe/" directory; remove them. That in turn removes the only definitions of the InstallAcpiTable(), QemuDetected(), QemuInstallAcpiTable(), InstallXenTables() functions in the "OvmfPkg/AcpiPlatformDxe/" directory, so remove their declarations from "AcpiPlatform.h". Remove "OvmfPkg/AcpiPlatformDxe/Xen.c" from the "OvmfPkg: Xen-related modules" section of "Maintainers.txt", as well. Cc: Andrew Fish Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Leif Lindholm Cc: Michael D Kinney Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 69 --- Maintainers.txt | 1 - OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 29 -- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c | 267 ---------- OvmfPkg/AcpiPlatformDxe/Qemu.c | 512 -------------------- OvmfPkg/AcpiPlatformDxe/Xen.c | 315 ------------ 6 files changed, 1193 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf deleted file mode 100644 index 77607298cbea..000000000000 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ /dev/null @@ -1,69 +0,0 @@ -## @file -# OVMF ACPI Platform Driver -# -# Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D AcpiPlatform - FILE_GUID =3D 49970331-E3FA-4637-9ABC-3B7868676970 - MODULE_TYPE =3D DXE_DRIVER - VERSION_STRING =3D 1.0 - ENTRY_POINT =3D AcpiPlatformEntryPoint - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 EBC -# - -[Sources] - AcpiPlatform.c - AcpiPlatform.h - BootScript.c - EntryPoint.c - PciDecoding.c - Qemu.c - QemuFwCfgAcpi.c - Xen.c - -[Packages] - MdeModulePkg/MdeModulePkg.dec - MdePkg/MdePkg.dec - OvmfPkg/OvmfPkg.dec - UefiCpuPkg/UefiCpuPkg.dec - -[LibraryClasses] - BaseLib - BaseMemoryLib - DebugLib - DxeServicesTableLib - MemoryAllocationLib - OrderedCollectionLib - PcdLib - QemuFwCfgLib - QemuFwCfgS3Lib - UefiBootServicesTableLib - UefiDriverEntryPoint - XenPlatformLib - -[Protocols] - gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED - gEfiFirmwareVolume2ProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED - gEfiPciIoProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED - -[Guids] - gRootBridgesConnectedEventGroupGuid - -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration - gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress - gUefiOvmfPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel - gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress - -[Depex] - gEfiAcpiTableProtocolGuid diff --git a/Maintainers.txt b/Maintainers.txt index 50c87d1ac29a..82008a0046c6 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -481,13 +481,12 @@ F: OvmfPkg/Library/Tcg2PhysicalPresenceLib*/ F: OvmfPkg/PlatformPei/ClearCache.c F: OvmfPkg/Tcg/ R: Marc-Andr=C3=A9 Lureau R: Stefan Berger =20 OvmfPkg: Xen-related modules -F: OvmfPkg/AcpiPlatformDxe/Xen.c F: OvmfPkg/Include/Guid/XenBusRootDevice.h F: OvmfPkg/Include/Guid/XenInfo.h F: OvmfPkg/Include/IndustryStandard/Xen/ F: OvmfPkg/Include/Library/XenHypercallLib.h F: OvmfPkg/Include/Library/XenIoMmioLib.h F: OvmfPkg/Include/Library/XenPlatformLib.h diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.h index d98b79baab40..bd4c26f07fcd 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -16,41 +16,12 @@ typedef struct { EFI_PCI_IO_PROTOCOL *PciIo; UINT64 PciAttributes; } ORIGINAL_ATTRIBUTES; =20 typedef struct S3_CONTEXT S3_CONTEXT; =20 -EFI_STATUS -EFIAPI -InstallAcpiTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ); - -BOOLEAN -QemuDetected ( - VOID - ); - -EFI_STATUS -EFIAPI -QemuInstallAcpiTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ); - -EFI_STATUS -EFIAPI -InstallXenTables ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol - ); - EFI_STATUS EFIAPI InstallQemuFwCfgTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol ); =20 diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.c deleted file mode 100644 index efbbfab89d2b..000000000000 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c +++ /dev/null @@ -1,267 +0,0 @@ -/** @file - OVMF ACPI Platform Driver - - Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include // ASSERT_EFI_ERROR() -#include // gBS -#include // XenDetected() -#include // gEfiFirmwareVolume2Protoc= ol... - -#include "AcpiPlatform.h" - -EFI_STATUS -EFIAPI -InstallAcpiTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ) -{ - return AcpiProtocol->InstallAcpiTable ( - AcpiProtocol, - AcpiTableBuffer, - AcpiTableBufferSize, - TableKey - ); -} - - -/** - Locate the first instance of a protocol. If the protocol requested is an - FV protocol, then it will return the first FV that contains the ACPI tab= le - storage file. - - @param Instance Return pointer to the first instance of the protoc= ol - - @return EFI_SUCCESS The function completed successfully. - @return EFI_NOT_FOUND The protocol could not be located. - @return EFI_OUT_OF_RESOURCES There are not enough resources to find the= protocol. - -**/ -EFI_STATUS -LocateFvInstanceWithTables ( - OUT EFI_FIRMWARE_VOLUME2_PROTOCOL **Instance - ) -{ - EFI_STATUS Status; - EFI_HANDLE *HandleBuffer; - UINTN NumberOfHandles; - EFI_FV_FILETYPE FileType; - UINT32 FvStatus; - EFI_FV_FILE_ATTRIBUTES Attributes; - UINTN Size; - UINTN Index; - EFI_FIRMWARE_VOLUME2_PROTOCOL *FvInstance; - - FvStatus =3D 0; - - // - // Locate protocol. - // - Status =3D gBS->LocateHandleBuffer ( - ByProtocol, - &gEfiFirmwareVolume2ProtocolGuid, - NULL, - &NumberOfHandles, - &HandleBuffer - ); - if (EFI_ERROR (Status)) { - // - // Defined errors at this time are not found and out of resources. - // - return Status; - } - - // - // Looking for FV with ACPI storage file - // - for (Index =3D 0; Index < NumberOfHandles; Index++) { - // - // Get the protocol on this handle - // This should not fail because of LocateHandleBuffer - // - Status =3D gBS->HandleProtocol ( - HandleBuffer[Index], - &gEfiFirmwareVolume2ProtocolGuid, - (VOID**) &FvInstance - ); - ASSERT_EFI_ERROR (Status); - - // - // See if it has the ACPI storage file - // - Status =3D FvInstance->ReadFile ( - FvInstance, - (EFI_GUID*)PcdGetPtr (PcdAcpiTableStorageFile), - NULL, - &Size, - &FileType, - &Attributes, - &FvStatus - ); - - // - // If we found it, then we are done - // - if (Status =3D=3D EFI_SUCCESS) { - *Instance =3D FvInstance; - break; - } - } - - // - // Our exit status is determined by the success of the previous operatio= ns - // If the protocol was found, Instance already points to it. - // - - // - // Free any allocated buffers - // - gBS->FreePool (HandleBuffer); - - return Status; -} - - -/** - Find ACPI tables in an FV and install them. - - This is now a fall-back path. Normally, we will search for tables provid= ed - by the VMM first. - - If that fails, we use this function to load the ACPI tables from an FV. = The - sources for the FV based tables is located under OvmfPkg/AcpiTables. - - @param AcpiTable Protocol instance pointer - -**/ -EFI_STATUS -EFIAPI -InstallOvmfFvTables ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable - ) -{ - EFI_STATUS Status; - EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol; - INTN Instance; - EFI_ACPI_COMMON_HEADER *CurrentTable; - UINTN TableHandle; - UINT32 FvStatus; - UINTN TableSize; - UINTN Size; - EFI_ACPI_TABLE_INSTALL_ACPI_TABLE TableInstallFunction; - - Instance =3D 0; - CurrentTable =3D NULL; - TableHandle =3D 0; - - if (QemuDetected ()) { - TableInstallFunction =3D QemuInstallAcpiTable; - } else { - TableInstallFunction =3D InstallAcpiTable; - } - - // - // set FwVol (and use an ASSERT() below) to suppress incorrect - // compiler/analyzer warnings - // - FwVol =3D NULL; - // - // Locate the firmware volume protocol - // - Status =3D LocateFvInstanceWithTables (&FwVol); - if (EFI_ERROR (Status)) { - return EFI_ABORTED; - } - ASSERT (FwVol !=3D NULL); - - // - // Read tables from the storage file. - // - while (Status =3D=3D EFI_SUCCESS) { - - Status =3D FwVol->ReadSection ( - FwVol, - (EFI_GUID*)PcdGetPtr (PcdAcpiTableStorageFile), - EFI_SECTION_RAW, - Instance, - (VOID**) &CurrentTable, - &Size, - &FvStatus - ); - if (!EFI_ERROR (Status)) { - // - // Add the table - // - TableHandle =3D 0; - - TableSize =3D ((EFI_ACPI_DESCRIPTION_HEADER *) CurrentTable)->Length; - ASSERT (Size >=3D TableSize); - - // - // Install ACPI table - // - Status =3D TableInstallFunction ( - AcpiTable, - CurrentTable, - TableSize, - &TableHandle - ); - - // - // Free memory allocated by ReadSection - // - gBS->FreePool (CurrentTable); - - if (EFI_ERROR (Status)) { - return EFI_ABORTED; - } - - // - // Increment the instance - // - Instance++; - CurrentTable =3D NULL; - } - } - - return EFI_SUCCESS; -} - -/** - Effective entrypoint of Acpi Platform driver. - - @param ImageHandle - @param SystemTable - - @return EFI_SUCCESS - @return EFI_LOAD_ERROR - @return EFI_OUT_OF_RESOURCES - -**/ -EFI_STATUS -EFIAPI -InstallAcpiTables ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable - ) -{ - EFI_STATUS Status; - - if (XenDetected ()) { - Status =3D InstallXenTables (AcpiTable); - } else { - Status =3D InstallQemuFwCfgTables (AcpiTable); - } - - if (EFI_ERROR (Status)) { - Status =3D InstallOvmfFvTables (AcpiTable); - } - - return Status; -} - diff --git a/OvmfPkg/AcpiPlatformDxe/Qemu.c b/OvmfPkg/AcpiPlatformDxe/Qemu.c deleted file mode 100644 index bdcc46b7186a..000000000000 --- a/OvmfPkg/AcpiPlatformDxe/Qemu.c +++ /dev/null @@ -1,512 +0,0 @@ -/** @file - OVMF ACPI QEMU support - - Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
- - Copyright (C) 2012-2014, Red Hat, Inc. - - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include // EFI_ACPI_1_0_IO_APIC_STRUCTURE -#include // CopyMem() -#include // DEBUG() -#include // gDS -#include // AllocatePool() -#include // PcdGet16() -#include // QemuFwCfgIsAvailable() - -#include "AcpiPlatform.h" - -BOOLEAN -QemuDetected ( - VOID - ) -{ - if (!QemuFwCfgIsAvailable ()) { - return FALSE; - } - - return TRUE; -} - - -STATIC -UINTN -CountBits16 ( - UINT16 Mask - ) -{ - // - // For all N >=3D 1, N bits are enough to represent the number of bits s= et - // among N bits. It's true for N =3D=3D 1. When adding a new bit (N :=3D= N+1), - // the maximum number of possibly set bits increases by one, while the - // representable maximum doubles. - // - Mask =3D ((Mask & 0xAAAA) >> 1) + (Mask & 0x5555); - Mask =3D ((Mask & 0xCCCC) >> 2) + (Mask & 0x3333); - Mask =3D ((Mask & 0xF0F0) >> 4) + (Mask & 0x0F0F); - Mask =3D ((Mask & 0xFF00) >> 8) + (Mask & 0x00FF); - - return Mask; -} - - -STATIC -EFI_STATUS -EFIAPI -QemuInstallAcpiMadtTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ) -{ - UINTN CpuCount; - UINTN PciLinkIsoCount; - UINTN NewBufferSize; - EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt; - EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE *LocalApic; - EFI_ACPI_1_0_IO_APIC_STRUCTURE *IoApic; - EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE *Iso; - EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE *LocalApicNmi; - VOID *Ptr; - UINTN Loop; - EFI_STATUS Status; - - ASSERT (AcpiTableBufferSize >=3D sizeof (EFI_ACPI_DESCRIPTION_HEADER)); - - QemuFwCfgSelectItem (QemuFwCfgItemSmpCpuCount); - CpuCount =3D QemuFwCfgRead16 (); - ASSERT (CpuCount >=3D 1); - - // - // Set Level-tiggered, Active High for these identity mapped IRQs. The b= itset - // corresponds to the union of all possible interrupt assignments for th= e LNKA, - // LNKB, LNKC, LNKD PCI interrupt lines. See the DSDT. - // - PciLinkIsoCount =3D CountBits16 (PcdGet16 (Pcd8259LegacyModeEdgeLevel)); - - NewBufferSize =3D 1 * sizeof (*Madt) + - CpuCount * sizeof (*LocalApic) + - 1 * sizeof (*IoApic) + - (1 + PciLinkIsoCount) * sizeof (*Iso) + - 1 * sizeof (*LocalApicNmi); - - Madt =3D AllocatePool (NewBufferSize); - if (Madt =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } - - CopyMem (&(Madt->Header), AcpiTableBuffer, sizeof (EFI_ACPI_DESCRIPTION_= HEADER)); - Madt->Header.Length =3D (UINT32) NewBufferSize; - Madt->LocalApicAddress =3D PcdGet32 (PcdCpuLocalApicBaseAddress); - Madt->Flags =3D EFI_ACPI_1_0_PCAT_COMPAT; - Ptr =3D Madt + 1; - - LocalApic =3D Ptr; - for (Loop =3D 0; Loop < CpuCount; ++Loop) { - LocalApic->Type =3D EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC; - LocalApic->Length =3D sizeof (*LocalApic); - LocalApic->AcpiProcessorId =3D (UINT8) Loop; - LocalApic->ApicId =3D (UINT8) Loop; - LocalApic->Flags =3D 1; // enabled - ++LocalApic; - } - Ptr =3D LocalApic; - - IoApic =3D Ptr; - IoApic->Type =3D EFI_ACPI_1_0_IO_APIC; - IoApic->Length =3D sizeof (*IoApic); - IoApic->IoApicId =3D (UINT8) CpuCount; - IoApic->Reserved =3D EFI_ACPI_RESERVED_BYTE; - IoApic->IoApicAddress =3D 0xFEC00000; - IoApic->SystemVectorBase =3D 0x00000000; - Ptr =3D IoApic + 1; - - // - // IRQ0 (8254 Timer) =3D> IRQ2 (PIC) Interrupt Source Override Structure - // - Iso =3D Ptr; - Iso->Type =3D EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERR= IDE; - Iso->Length =3D sizeof (*Iso); - Iso->Bus =3D 0x00; // ISA - Iso->Source =3D 0x00; // IRQ0 - Iso->GlobalSystemInterruptVector =3D 0x00000002; - Iso->Flags =3D 0x0000; // Conforms to specs of the= bus - ++Iso; - - // - // Set Level-triggered, Active High for all possible PCI link targets. - // - for (Loop =3D 0; Loop < 16; ++Loop) { - if ((PcdGet16 (Pcd8259LegacyModeEdgeLevel) & (1 << Loop)) =3D=3D 0) { - continue; - } - Iso->Type =3D EFI_ACPI_1_0_INTERRUPT_SOURCE_OVE= RRIDE; - Iso->Length =3D sizeof (*Iso); - Iso->Bus =3D 0x00; // ISA - Iso->Source =3D (UINT8) Loop; - Iso->GlobalSystemInterruptVector =3D (UINT32) Loop; - Iso->Flags =3D 0x000D; // Level-triggered, Activ= e High - ++Iso; - } - ASSERT ( - (UINTN) (Iso - (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE *)Ptr= ) =3D=3D - 1 + PciLinkIsoCount - ); - Ptr =3D Iso; - - LocalApicNmi =3D Ptr; - LocalApicNmi->Type =3D EFI_ACPI_1_0_LOCAL_APIC_NMI; - LocalApicNmi->Length =3D sizeof (*LocalApicNmi); - LocalApicNmi->AcpiProcessorId =3D 0xFF; // applies to all processors - // - // polarity and trigger mode of the APIC I/O input signals conform to the - // specifications of the bus - // - LocalApicNmi->Flags =3D 0x0000; - // - // Local APIC interrupt input LINTn to which NMI is connected. - // - LocalApicNmi->LocalApicInti =3D 0x01; - Ptr =3D LocalApicNmi + 1; - - ASSERT ((UINTN) ((UINT8 *)Ptr - (UINT8 *)Madt) =3D=3D NewBufferSize); - Status =3D InstallAcpiTable (AcpiProtocol, Madt, NewBufferSize, TableKey= ); - - FreePool (Madt); - - return Status; -} - - -#pragma pack(1) - -typedef struct { - UINT64 Base; - UINT64 End; - UINT64 Length; -} PCI_WINDOW; - -typedef struct { - PCI_WINDOW PciWindow32; - PCI_WINDOW PciWindow64; -} FIRMWARE_DATA; - -typedef struct { - UINT8 BytePrefix; - UINT8 ByteValue; -} AML_BYTE; - -typedef struct { - UINT8 NameOp; - UINT8 RootChar; - UINT8 NameChar[4]; - UINT8 PackageOp; - UINT8 PkgLength; - UINT8 NumElements; - AML_BYTE Pm1aCntSlpTyp; - AML_BYTE Pm1bCntSlpTyp; - AML_BYTE Reserved[2]; -} SYSTEM_STATE_PACKAGE; - -#pragma pack() - - -STATIC -EFI_STATUS -EFIAPI -PopulateFwData( - OUT FIRMWARE_DATA *FwData - ) -{ - EFI_STATUS Status; - UINTN NumDesc; - EFI_GCD_MEMORY_SPACE_DESCRIPTOR *AllDesc; - - Status =3D gDS->GetMemorySpaceMap (&NumDesc, &AllDesc); - if (Status =3D=3D EFI_SUCCESS) { - UINT64 NonMmio32MaxExclTop; - UINT64 Mmio32MinBase; - UINT64 Mmio32MaxExclTop; - UINTN CurDesc; - - Status =3D EFI_UNSUPPORTED; - - NonMmio32MaxExclTop =3D 0; - Mmio32MinBase =3D BASE_4GB; - Mmio32MaxExclTop =3D 0; - - for (CurDesc =3D 0; CurDesc < NumDesc; ++CurDesc) { - CONST EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Desc; - UINT64 ExclTop; - - Desc =3D &AllDesc[CurDesc]; - ExclTop =3D Desc->BaseAddress + Desc->Length; - - if (ExclTop <=3D (UINT64) PcdGet32 (PcdOvmfFdBaseAddress)) { - switch (Desc->GcdMemoryType) { - case EfiGcdMemoryTypeNonExistent: - break; - - case EfiGcdMemoryTypeReserved: - case EfiGcdMemoryTypeSystemMemory: - if (NonMmio32MaxExclTop < ExclTop) { - NonMmio32MaxExclTop =3D ExclTop; - } - break; - - case EfiGcdMemoryTypeMemoryMappedIo: - if (Mmio32MinBase > Desc->BaseAddress) { - Mmio32MinBase =3D Desc->BaseAddress; - } - if (Mmio32MaxExclTop < ExclTop) { - Mmio32MaxExclTop =3D ExclTop; - } - break; - - default: - ASSERT(0); - } - } - } - - if (Mmio32MinBase < NonMmio32MaxExclTop) { - Mmio32MinBase =3D NonMmio32MaxExclTop; - } - - if (Mmio32MinBase < Mmio32MaxExclTop) { - FwData->PciWindow32.Base =3D Mmio32MinBase; - FwData->PciWindow32.End =3D Mmio32MaxExclTop - 1; - FwData->PciWindow32.Length =3D Mmio32MaxExclTop - Mmio32MinBase; - - FwData->PciWindow64.Base =3D 0; - FwData->PciWindow64.End =3D 0; - FwData->PciWindow64.Length =3D 0; - - Status =3D EFI_SUCCESS; - } - - FreePool (AllDesc); - } - - DEBUG (( - DEBUG_INFO, - "ACPI PciWindow32: Base=3D0x%08lx End=3D0x%08lx Length=3D0x%08lx\n", - FwData->PciWindow32.Base, - FwData->PciWindow32.End, - FwData->PciWindow32.Length - )); - DEBUG (( - DEBUG_INFO, - "ACPI PciWindow64: Base=3D0x%08lx End=3D0x%08lx Length=3D0x%08lx\n", - FwData->PciWindow64.Base, - FwData->PciWindow64.End, - FwData->PciWindow64.Length - )); - - return Status; -} - - -STATIC -VOID -EFIAPI -GetSuspendStates ( - UINTN *SuspendToRamSize, - SYSTEM_STATE_PACKAGE *SuspendToRam, - UINTN *SuspendToDiskSize, - SYSTEM_STATE_PACKAGE *SuspendToDisk - ) -{ - STATIC CONST SYSTEM_STATE_PACKAGE Template =3D { - 0x08, // NameOp - '\\', // RootChar - { '_', 'S', 'x', '_' }, // NameChar[4] - 0x12, // PackageOp - 0x0A, // PkgLength - 0x04, // NumElements - { 0x0A, 0x00 }, // Pm1aCntSlpTyp - { 0x0A, 0x00 }, // Pm1bCntSlpTyp -- we don't support it - { // Reserved[2] - { 0x0A, 0x00 }, - { 0x0A, 0x00 } - } - }; - RETURN_STATUS Status; - FIRMWARE_CONFIG_ITEM FwCfgItem; - UINTN FwCfgSize; - UINT8 SystemStates[6]; - - // - // configure defaults - // - *SuspendToRamSize =3D sizeof Template; - CopyMem (SuspendToRam, &Template, sizeof Template); - SuspendToRam->NameChar[2] =3D '3'; // S3 - SuspendToRam->Pm1aCntSlpTyp.ByteValue =3D 1; // PIIX4: STR - - *SuspendToDiskSize =3D sizeof Template; - CopyMem (SuspendToDisk, &Template, sizeof Template); - SuspendToDisk->NameChar[2] =3D '4'; // S4 - SuspendToDisk->Pm1aCntSlpTyp.ByteValue =3D 2; // PIIX4: POSCL - - // - // check for overrides - // - Status =3D QemuFwCfgFindFile ("etc/system-states", &FwCfgItem, &FwCfgSiz= e); - if (Status !=3D RETURN_SUCCESS || FwCfgSize !=3D sizeof SystemStates) { - DEBUG ((DEBUG_INFO, "ACPI using S3/S4 defaults\n")); - return; - } - QemuFwCfgSelectItem (FwCfgItem); - QemuFwCfgReadBytes (sizeof SystemStates, SystemStates); - - // - // Each byte corresponds to a system state. In each byte, the MSB tells = us - // whether the given state is enabled. If so, the three LSBs specify the - // value to be written to the PM control register's SUS_TYP bits. - // - if (SystemStates[3] & BIT7) { - SuspendToRam->Pm1aCntSlpTyp.ByteValue =3D - SystemStates[3] & (BIT2 | BIT1 | BIT0); - DEBUG ((DEBUG_INFO, "ACPI S3 value: %d\n", - SuspendToRam->Pm1aCntSlpTyp.ByteValue)); - } else { - *SuspendToRamSize =3D 0; - DEBUG ((DEBUG_INFO, "ACPI S3 disabled\n")); - } - - if (SystemStates[4] & BIT7) { - SuspendToDisk->Pm1aCntSlpTyp.ByteValue =3D - SystemStates[4] & (BIT2 | BIT1 | BIT0); - DEBUG ((DEBUG_INFO, "ACPI S4 value: %d\n", - SuspendToDisk->Pm1aCntSlpTyp.ByteValue)); - } else { - *SuspendToDiskSize =3D 0; - DEBUG ((DEBUG_INFO, "ACPI S4 disabled\n")); - } -} - - -STATIC -EFI_STATUS -EFIAPI -QemuInstallAcpiSsdtTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ) -{ - EFI_STATUS Status; - FIRMWARE_DATA *FwData; - - Status =3D EFI_OUT_OF_RESOURCES; - - FwData =3D AllocateReservedPool (sizeof (*FwData)); - if (FwData !=3D NULL) { - UINTN SuspendToRamSize; - SYSTEM_STATE_PACKAGE SuspendToRam; - UINTN SuspendToDiskSize; - SYSTEM_STATE_PACKAGE SuspendToDisk; - UINTN SsdtSize; - UINT8 *Ssdt; - - GetSuspendStates (&SuspendToRamSize, &SuspendToRam, - &SuspendToDiskSize, &SuspendToDisk); - SsdtSize =3D AcpiTableBufferSize + 17 + SuspendToRamSize + SuspendToDi= skSize; - Ssdt =3D AllocatePool (SsdtSize); - - if (Ssdt !=3D NULL) { - Status =3D PopulateFwData (FwData); - - if (Status =3D=3D EFI_SUCCESS) { - UINT8 *SsdtPtr; - - SsdtPtr =3D Ssdt; - - CopyMem (SsdtPtr, AcpiTableBuffer, AcpiTableBufferSize); - SsdtPtr +=3D AcpiTableBufferSize; - - // - // build "OperationRegion(FWDT, SystemMemory, 0x12345678, 0x876543= 21)" - // - *(SsdtPtr++) =3D 0x5B; // ExtOpPrefix - *(SsdtPtr++) =3D 0x80; // OpRegionOp - *(SsdtPtr++) =3D 'F'; - *(SsdtPtr++) =3D 'W'; - *(SsdtPtr++) =3D 'D'; - *(SsdtPtr++) =3D 'T'; - *(SsdtPtr++) =3D 0x00; // SystemMemory - *(SsdtPtr++) =3D 0x0C; // DWordPrefix - - // - // no virtual addressing yet, take the four least significant bytes - // - CopyMem(SsdtPtr, &FwData, 4); - SsdtPtr +=3D 4; - - *(SsdtPtr++) =3D 0x0C; // DWordPrefix - - *(UINT32*) SsdtPtr =3D sizeof (*FwData); - SsdtPtr +=3D 4; - - // - // add suspend system states - // - CopyMem (SsdtPtr, &SuspendToRam, SuspendToRamSize); - SsdtPtr +=3D SuspendToRamSize; - CopyMem (SsdtPtr, &SuspendToDisk, SuspendToDiskSize); - SsdtPtr +=3D SuspendToDiskSize; - - ASSERT((UINTN) (SsdtPtr - Ssdt) =3D=3D SsdtSize); - ((EFI_ACPI_DESCRIPTION_HEADER *) Ssdt)->Length =3D (UINT32) SsdtSi= ze; - Status =3D InstallAcpiTable (AcpiProtocol, Ssdt, SsdtSize, TableKe= y); - } - - FreePool(Ssdt); - } - - if (Status !=3D EFI_SUCCESS) { - FreePool(FwData); - } - } - - return Status; -} - - -EFI_STATUS -EFIAPI -QemuInstallAcpiTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ) -{ - EFI_ACPI_DESCRIPTION_HEADER *Hdr; - EFI_ACPI_TABLE_INSTALL_ACPI_TABLE TableInstallFunction; - - Hdr =3D (EFI_ACPI_DESCRIPTION_HEADER*) AcpiTableBuffer; - switch (Hdr->Signature) { - case EFI_ACPI_1_0_APIC_SIGNATURE: - TableInstallFunction =3D QemuInstallAcpiMadtTable; - break; - case EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE: - TableInstallFunction =3D QemuInstallAcpiSsdtTable; - break; - default: - TableInstallFunction =3D InstallAcpiTable; - } - - return TableInstallFunction ( - AcpiProtocol, - AcpiTableBuffer, - AcpiTableBufferSize, - TableKey - ); -} diff --git a/OvmfPkg/AcpiPlatformDxe/Xen.c b/OvmfPkg/AcpiPlatformDxe/Xen.c deleted file mode 100644 index be2c5d695846..000000000000 --- a/OvmfPkg/AcpiPlatformDxe/Xen.c +++ /dev/null @@ -1,315 +0,0 @@ -/** @file - OVMF ACPI Xen support - - Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
- Copyright (c) 2012, Bei Guan - - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include // CpuDeadLoop() -#include // DEBUG() -#include // XenGetInfoHOB() - -#include "AcpiPlatform.h" - -#define XEN_ACPI_PHYSICAL_ADDRESS 0x000EA020 -#define XEN_BIOS_PHYSICAL_END 0x000FFFFF - -EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *XenAcpiRsdpStructurePtr =3D= NULL; - -/** - Get the address of Xen ACPI Root System Description Pointer (RSDP) - structure. - - @param RsdpStructurePtr Return pointer to RSDP structure - - @return EFI_SUCCESS Find Xen RSDP structure successfully. - @return EFI_NOT_FOUND Don't find Xen RSDP structure. - @return EFI_ABORTED Find Xen RSDP structure, but it's not integra= ted. - -**/ -EFI_STATUS -EFIAPI -GetXenAcpiRsdp ( - OUT EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER **RsdpPtr - ) -{ - EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *RsdpStructurePtr; - UINT8 *XenAcpiPtr; - UINT8 Sum; - EFI_XEN_INFO *XenInfo; - - // - // Detect the RSDP structure - // - - // - // First look for PVH one - // - XenInfo =3D XenGetInfoHOB (); - ASSERT (XenInfo !=3D NULL); - if (XenInfo->RsdpPvh !=3D NULL) { - DEBUG ((DEBUG_INFO, "%a: Use ACPI RSDP table at 0x%p\n", - gEfiCallerBaseName, XenInfo->RsdpPvh)); - *RsdpPtr =3D XenInfo->RsdpPvh; - return EFI_SUCCESS; - } - - // - // Otherwise, look for the HVM one - // - for (XenAcpiPtr =3D (UINT8*)(UINTN) XEN_ACPI_PHYSICAL_ADDRESS; - XenAcpiPtr < (UINT8*)(UINTN) XEN_BIOS_PHYSICAL_END; - XenAcpiPtr +=3D 0x10) { - - RsdpStructurePtr =3D (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) - (UINTN) XenAcpiPtr; - - if (!AsciiStrnCmp ((CHAR8 *) &RsdpStructurePtr->Signature, "RSD PTR ",= 8)) { - // - // RSDP ACPI 1.0 checksum for 1.0/2.0/3.0 table. - // This is only the first 20 bytes of the structure - // - Sum =3D CalculateSum8 ( - (CONST UINT8 *)RsdpStructurePtr, - sizeof (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER) - ); - if (Sum !=3D 0) { - return EFI_ABORTED; - } - - if (RsdpStructurePtr->Revision >=3D 2) { - // - // RSDP ACPI 2.0/3.0 checksum, this is the entire table - // - Sum =3D CalculateSum8 ( - (CONST UINT8 *)RsdpStructurePtr, - sizeof (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER) - ); - if (Sum !=3D 0) { - return EFI_ABORTED; - } - } - *RsdpPtr =3D RsdpStructurePtr; - return EFI_SUCCESS; - } - } - - return EFI_NOT_FOUND; -} - -/** - Get Xen Acpi tables from the RSDP structure. And installs Xen ACPI tables - into the RSDT/XSDT using InstallAcpiTable. Some signature of the install= ed - ACPI tables are: FACP, APIC, HPET, WAET, SSDT, FACS, DSDT. - - @param AcpiProtocol Protocol instance pointer. - - @return EFI_SUCCESS The table was successfully inserted. - @return EFI_INVALID_PARAMETER Either AcpiTableBuffer is NULL, TableHand= le is - NULL, or AcpiTableBufferSize and the size - field embedded in the ACPI table pointed = to - by AcpiTableBuffer are not in sync. - @return EFI_OUT_OF_RESOURCES Insufficient resources exist to complete = the request. - -**/ -EFI_STATUS -EFIAPI -InstallXenTables ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol - ) -{ - EFI_STATUS Status; - UINTN TableHandle; - - EFI_ACPI_DESCRIPTION_HEADER *Rsdt; - EFI_ACPI_DESCRIPTION_HEADER *Xsdt; - VOID *CurrentTableEntry; - UINTN CurrentTablePointer; - EFI_ACPI_DESCRIPTION_HEADER *CurrentTable; - UINTN Index; - UINTN NumberOfTableEntries; - EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt2Table; - EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt1Table; - EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs2Table; - EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs1Table; - EFI_ACPI_DESCRIPTION_HEADER *DsdtTable; - - Fadt2Table =3D NULL; - Fadt1Table =3D NULL; - Facs2Table =3D NULL; - Facs1Table =3D NULL; - DsdtTable =3D NULL; - TableHandle =3D 0; - NumberOfTableEntries =3D 0; - - // - // Try to find Xen ACPI tables - // - Status =3D GetXenAcpiRsdp (&XenAcpiRsdpStructurePtr); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // If XSDT table is find, just install its tables. - // Otherwise, try to find and install the RSDT tables. - // - if (XenAcpiRsdpStructurePtr->XsdtAddress) { - // - // Retrieve the addresses of XSDT and - // calculate the number of its table entries. - // - Xsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) - XenAcpiRsdpStructurePtr->XsdtAddress; - NumberOfTableEntries =3D (Xsdt->Length - - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / - sizeof (UINT64); - - // - // Install ACPI tables found in XSDT. - // - for (Index =3D 0; Index < NumberOfTableEntries; Index++) { - // - // Get the table entry from XSDT - // - CurrentTableEntry =3D (VOID *) ((UINT8 *) Xsdt + - sizeof (EFI_ACPI_DESCRIPTION_HEADER) + - Index * sizeof (UINT64)); - CurrentTablePointer =3D (UINTN) *(UINT64 *)CurrentTableEntry; - CurrentTable =3D (EFI_ACPI_DESCRIPTION_HEADER *) CurrentTablePointer; - - // - // Install the XSDT tables - // - Status =3D InstallAcpiTable ( - AcpiProtocol, - CurrentTable, - CurrentTable->Length, - &TableHandle - ); - - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Get the FACS and DSDT table address from the table FADT - // - if (!AsciiStrnCmp ((CHAR8 *) &CurrentTable->Signature, "FACP", 4)) { - Fadt2Table =3D (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *) - (UINTN) CurrentTablePointer; - Facs2Table =3D (EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) - (UINTN) Fadt2Table->FirmwareCtrl; - DsdtTable =3D (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Fadt2Table-= >Dsdt; - } - } - } - else if (XenAcpiRsdpStructurePtr->RsdtAddress) { - // - // Retrieve the addresses of RSDT and - // calculate the number of its table entries. - // - Rsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) - XenAcpiRsdpStructurePtr->RsdtAddress; - NumberOfTableEntries =3D (Rsdt->Length - - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / - sizeof (UINT32); - - // - // Install ACPI tables found in XSDT. - // - for (Index =3D 0; Index < NumberOfTableEntries; Index++) { - // - // Get the table entry from RSDT - // - CurrentTableEntry =3D (UINT32 *) ((UINT8 *) Rsdt + - sizeof (EFI_ACPI_DESCRIPTION_HEADER) + - Index * sizeof (UINT32)); - CurrentTablePointer =3D *(UINT32 *)CurrentTableEntry; - CurrentTable =3D (EFI_ACPI_DESCRIPTION_HEADER *) CurrentTablePointer; - - // - // Install the RSDT tables - // - Status =3D InstallAcpiTable ( - AcpiProtocol, - CurrentTable, - CurrentTable->Length, - &TableHandle - ); - - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Get the FACS and DSDT table address from the table FADT - // - if (!AsciiStrnCmp ((CHAR8 *) &CurrentTable->Signature, "FACP", 4)) { - Fadt1Table =3D (EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE *) - (UINTN) CurrentTablePointer; - Facs1Table =3D (EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) - (UINTN) Fadt1Table->FirmwareCtrl; - DsdtTable =3D (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Fadt1Table-= >Dsdt; - } - } - } - - // - // Install the FACS table. - // - if (Fadt2Table) { - // - // FACS 2.0 - // - Status =3D InstallAcpiTable ( - AcpiProtocol, - Facs2Table, - Facs2Table->Length, - &TableHandle - ); - if (EFI_ERROR (Status)) { - return Status; - } - } - else if (Fadt1Table) { - // - // FACS 1.0 - // - Status =3D InstallAcpiTable ( - AcpiProtocol, - Facs1Table, - Facs1Table->Length, - &TableHandle - ); - if (EFI_ERROR (Status)) { - return Status; - } - } - - // - // Install DSDT table. If we reached this point without finding the DSDT, - // then we're out of sync with the hypervisor, and cannot continue. - // - if (DsdtTable =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __FUNCTION__)); - ASSERT (FALSE); - CpuDeadLoop (); - } - - Status =3D InstallAcpiTable ( - AcpiProtocol, - DsdtTable, - DsdtTable->Length, - &TableHandle - ); - if (EFI_ERROR (Status)) { - return Status; - } - - return EFI_SUCCESS; -} - --=20 2.19.1.3.g30247aa5d201 -=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 (#75681): https://edk2.groups.io/g/devel/message/75681 Mute This Topic: https://groups.io/mt/83110518/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75682+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75682+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060924; cv=none; d=zohomail.com; s=zohoarc; b=mtqEyA8sn/wB3qWx1IvACkMJpGjhjRiBmDo7C9oXUCDNTBG6PY5SbsbnFzYgSEVO/QavhZtNpg/a36k3WQ5gXtY9awe6RtQ8TvC5fMEeFQnHlq6KdfrnZLkW8FODXyM26zYwCnTABMzQLbwpxwcxsO04ZqOp9M49Ch3ux061mrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060924; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=MKlrGvey2smXbo3yov2sr5jJ6hEcWMkaPglLQsEhO4o=; b=DupFummRbmPGyAVGwKJqlWAqA46ugfRt5F154htBlhNn6Com2LYbyeE2AryFRhQP+wmnKC1O8Bs4fejUKuvp4/k65Pk+/1yAVbT8vMkrd/HuqPI6VGUdGjiwXt4Lt0rDmj6wPPO6jQXbba7wr0ubkI6sKOxC1dmwCNxY4AOs98k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75682+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060924260749.1414690071125; Wed, 26 May 2021 13:28:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id RL2YYY1788612xEE4wsLN8g6; Wed, 26 May 2021 13:28:43 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.2921.1622060917760361928 for ; Wed, 26 May 2021 13:28:38 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-208-TrWGICKiMXiAdQnsvNpXWg-1; Wed, 26 May 2021 16:28:33 -0400 X-MC-Unique: TrWGICKiMXiAdQnsvNpXWg-1 X-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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 01CF2101371E; Wed, 26 May 2021 20:28:32 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id D573016935; Wed, 26 May 2021 20:28:29 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 13/43] OvmfPkg/XenAcpiPlatformDxe: remove the QEMU ACPI linker/loader client Date: Wed, 26 May 2021 22:14:16 +0200 Message-Id: <20210526201446.12554-14-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: 3XdsvVpU2kJt390C678XFDqqx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060923; bh=MKlrGvey2smXbo3yov2sr5jJ6hEcWMkaPglLQsEhO4o=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=bhserO72eNO1CheeQ8mnirqgsGInPhPvn4G7HEQleZsjmBn6LGVt0yYvUZ+N+IqfWqT fPMGhbeZKVy8QVZhq9kQ3H/qLdVP2af4sT4lvgp1T6VM+b2OBlxwnpczRNXYnVnLJFK/2 A2eZPiUCbu22Z8MohsP4HN3AoSzfEwv3jg8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The root of the QEMU ACPI linker/loader client in XenAcpiPlatformDxe is the InstallQemuFwCfgTables() function. This function always fails on Xen, due to its top-most QemuFwCfgFindFile() call. Remove the InstallQemuFwCfgTables() function call from XenAcpiPlatformDxe, along with all dependencies that now become unused. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf | 6 - OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h | 51 - OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c | 2 +- OvmfPkg/XenAcpiPlatformDxe/BootScript.c | 269 ----- OvmfPkg/XenAcpiPlatformDxe/PciDecoding.c | 194 ---- OvmfPkg/XenAcpiPlatformDxe/QemuFwCfgAcpi.c | 1196 -----------------= --- 6 files changed, 1 insertion(+), 1717 deletions(-) diff --git a/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf b/OvmfPkg/Xe= nAcpiPlatformDxe/XenAcpiPlatformDxe.inf index 379b5d56d565..72132e397dc1 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf +++ b/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf @@ -21,17 +21,14 @@ [Defines] # VALID_ARCHITECTURES =3D IA32 X64 EBC # =20 [Sources] AcpiPlatform.c AcpiPlatform.h - BootScript.c EntryPoint.c - PciDecoding.c Qemu.c - QemuFwCfgAcpi.c Xen.c =20 [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec @@ -40,24 +37,21 @@ [Packages] [LibraryClasses] BaseLib BaseMemoryLib DebugLib DxeServicesTableLib MemoryAllocationLib - OrderedCollectionLib PcdLib QemuFwCfgLib - QemuFwCfgS3Lib UefiBootServicesTableLib UefiDriverEntryPoint XenPlatformLib =20 [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiFirmwareVolume2ProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED - gEfiPciIoProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED =20 [Guids] gRootBridgesConnectedEventGroupGuid =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile diff --git a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/XenAcpiPla= tformDxe/AcpiPlatform.h index 6259697c4b2d..d35143a00d01 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h @@ -8,20 +8,12 @@ **/ =20 #ifndef ACPI_PLATFORM_H_ #define ACPI_PLATFORM_H_ =20 #include // EFI_ACPI_TABLE_PROTOCOL -#include // EFI_PCI_IO_PROTOCOL - -typedef struct { - EFI_PCI_IO_PROTOCOL *PciIo; - UINT64 PciAttributes; -} ORIGINAL_ATTRIBUTES; - -typedef struct S3_CONTEXT S3_CONTEXT; =20 EFI_STATUS EFIAPI InstallAcpiTable ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, IN VOID *AcpiTableBuffer, @@ -46,57 +38,14 @@ QemuInstallAcpiTable ( EFI_STATUS EFIAPI InstallXenTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol ); =20 -EFI_STATUS -EFIAPI -InstallQemuFwCfgTables ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol - ); - EFI_STATUS EFIAPI InstallAcpiTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable ); =20 -VOID -EnablePciDecoding ( - OUT ORIGINAL_ATTRIBUTES **OriginalAttributes, - OUT UINTN *Count - ); - -VOID -RestorePciDecoding ( - IN ORIGINAL_ATTRIBUTES *OriginalAttributes, - IN UINTN Count - ); - -EFI_STATUS -AllocateS3Context ( - OUT S3_CONTEXT **S3Context, - IN UINTN WritePointerCount - ); - -VOID -ReleaseS3Context ( - IN S3_CONTEXT *S3Context - ); - -EFI_STATUS -SaveCondensedWritePointerToS3Context ( - IN OUT S3_CONTEXT *S3Context, - IN UINT16 PointerItem, - IN UINT8 PointerSize, - IN UINT32 PointerOffset, - IN UINT64 PointerValue - ); - -EFI_STATUS -TransferS3ContextToBootScript ( - IN S3_CONTEXT *S3Context - ); - #endif =20 diff --git a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/XenAcpiPla= tformDxe/AcpiPlatform.c index 2b2dc576754b..9c8b1e0fcffa 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c @@ -253,13 +253,13 @@ InstallAcpiTables ( { EFI_STATUS Status; =20 if (XenDetected ()) { Status =3D InstallXenTables (AcpiTable); } else { - Status =3D InstallQemuFwCfgTables (AcpiTable); + Status =3D EFI_UNSUPPORTED; } =20 if (EFI_ERROR (Status)) { Status =3D InstallOvmfFvTables (AcpiTable); } =20 diff --git a/OvmfPkg/XenAcpiPlatformDxe/BootScript.c b/OvmfPkg/XenAcpiPlatf= ormDxe/BootScript.c deleted file mode 100644 index 14d1e68694cb..000000000000 --- a/OvmfPkg/XenAcpiPlatformDxe/BootScript.c +++ /dev/null @@ -1,269 +0,0 @@ -/** @file - Append an ACPI S3 Boot Script fragment from the QEMU_LOADER_WRITE_POINTER - commands of QEMU's fully processed table linker/loader script. - - Copyright (C) 2017-2021, Red Hat, Inc. - - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include // CpuDeadLoop() -#include // DEBUG() -#include // AllocatePool() -#include // QemuFwCfgS3ScriptSkipBytes() - -#include "AcpiPlatform.h" - - -// -// Condensed structure for capturing the fw_cfg operations -- select, skip, -// write -- inherent in executing a QEMU_LOADER_WRITE_POINTER command. -// -typedef struct { - UINT16 PointerItem; // resolved from QEMU_LOADER_WRITE_POINTER.Pointer= File - UINT8 PointerSize; // copied as-is from QEMU_LOADER_WRITE_POINTER - UINT32 PointerOffset; // copied as-is from QEMU_LOADER_WRITE_POINTER - UINT64 PointerValue; // resolved from QEMU_LOADER_WRITE_POINTER.Pointee= File - // and QEMU_LOADER_WRITE_POINTER.PointeeOffset -} CONDENSED_WRITE_POINTER; - - -// -// Context structure to accumulate CONDENSED_WRITE_POINTER objects from -// QEMU_LOADER_WRITE_POINTER commands. -// -// Any pointers in this structure own the pointed-to objects; that is, whe= n the -// context structure is released, all pointed-to objects must be released = too. -// -struct S3_CONTEXT { - CONDENSED_WRITE_POINTER *WritePointers; // one array element per process= ed - // QEMU_LOADER_WRITE_POINTER - // command - UINTN Allocated; // number of elements allocated = for - // WritePointers - UINTN Used; // number of elements populated = in - // WritePointers -}; - - -// -// Scratch buffer, allocated in EfiReservedMemoryType type memory, for the= ACPI -// S3 Boot Script opcodes to work on. -// -#pragma pack (1) -typedef union { - UINT64 PointerValue; // filled in from CONDENSED_WRITE_POINTER.PointerVa= lue -} SCRATCH_BUFFER; -#pragma pack () - - -/** - Allocate an S3_CONTEXT object. - - @param[out] S3Context The allocated S3_CONTEXT object is returned - through this parameter. - - @param[in] WritePointerCount Number of CONDENSED_WRITE_POINTER elements= to - allocate room for. WritePointerCount must = be - positive. - - @retval EFI_SUCCESS Allocation successful. - - @retval EFI_OUT_OF_RESOURCES Out of memory. - - @retval EFI_INVALID_PARAMETER WritePointerCount is zero. -**/ -EFI_STATUS -AllocateS3Context ( - OUT S3_CONTEXT **S3Context, - IN UINTN WritePointerCount - ) -{ - EFI_STATUS Status; - S3_CONTEXT *Context; - - if (WritePointerCount =3D=3D 0) { - return EFI_INVALID_PARAMETER; - } - - Context =3D AllocateZeroPool (sizeof *Context); - if (Context =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } - - Context->WritePointers =3D AllocatePool (WritePointerCount * - sizeof *Context->WritePointers); - if (Context->WritePointers =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto FreeContext; - } - - Context->Allocated =3D WritePointerCount; - *S3Context =3D Context; - return EFI_SUCCESS; - -FreeContext: - FreePool (Context); - - return Status; -} - - -/** - Release an S3_CONTEXT object. - - @param[in] S3Context The object to release. -**/ -VOID -ReleaseS3Context ( - IN S3_CONTEXT *S3Context - ) -{ - FreePool (S3Context->WritePointers); - FreePool (S3Context); -} - - -/** - Save the information necessary to replicate a QEMU_LOADER_WRITE_POINTER - command during S3 resume, in condensed format. - - This function is to be called from ProcessCmdWritePointer(), after all t= he - sanity checks have passed, and before the fw_cfg operations are performe= d. - - @param[in,out] S3Context The S3_CONTEXT object into which the caller wa= nts - to save the information that was derived from - QEMU_LOADER_WRITE_POINTER. - - @param[in] PointerItem The FIRMWARE_CONFIG_ITEM that - QEMU_LOADER_WRITE_POINTER.PointerFile was reso= lved - to, expressed as a UINT16 value. - - @param[in] PointerSize Copied directly from - QEMU_LOADER_WRITE_POINTER.PointerSize. - - @param[in] PointerOffset Copied directly from - QEMU_LOADER_WRITE_POINTER.PointerOffset. - - @param[in] PointerValue The base address of the allocated / downloaded - fw_cfg blob that is identified by - QEMU_LOADER_WRITE_POINTER.PointeeFile, plus - QEMU_LOADER_WRITE_POINTER.PointeeOffset. - - @retval EFI_SUCCESS The information derived from - QEMU_LOADER_WRITE_POINTER has been success= fully - absorbed into S3Context. - - @retval EFI_OUT_OF_RESOURCES No room available in S3Context. -**/ -EFI_STATUS -SaveCondensedWritePointerToS3Context ( - IN OUT S3_CONTEXT *S3Context, - IN UINT16 PointerItem, - IN UINT8 PointerSize, - IN UINT32 PointerOffset, - IN UINT64 PointerValue - ) -{ - CONDENSED_WRITE_POINTER *Condensed; - - if (S3Context->Used =3D=3D S3Context->Allocated) { - return EFI_OUT_OF_RESOURCES; - } - Condensed =3D S3Context->WritePointers + S3Context->Used; - Condensed->PointerItem =3D PointerItem; - Condensed->PointerSize =3D PointerSize; - Condensed->PointerOffset =3D PointerOffset; - Condensed->PointerValue =3D PointerValue; - DEBUG ((DEBUG_VERBOSE, "%a: 0x%04x/[0x%08x+%d] :=3D 0x%Lx (%Lu)\n", - __FUNCTION__, PointerItem, PointerOffset, PointerSize, PointerValue, - (UINT64)S3Context->Used)); - ++S3Context->Used; - return EFI_SUCCESS; -} - - -/** - FW_CFG_BOOT_SCRIPT_CALLBACK_FUNCTION provided to QemuFwCfgS3Lib. -**/ -STATIC -VOID -EFIAPI -AppendFwCfgBootScript ( - IN OUT VOID *Context, OPTIONAL - IN OUT VOID *ExternalScratchBuffer - ) -{ - S3_CONTEXT *S3Context; - SCRATCH_BUFFER *ScratchBuffer; - UINTN Index; - - S3Context =3D Context; - ScratchBuffer =3D ExternalScratchBuffer; - - for (Index =3D 0; Index < S3Context->Used; ++Index) { - CONST CONDENSED_WRITE_POINTER *Condensed; - RETURN_STATUS Status; - - Condensed =3D &S3Context->WritePointers[Index]; - - Status =3D QemuFwCfgS3ScriptSkipBytes (Condensed->PointerItem, - Condensed->PointerOffset); - if (RETURN_ERROR (Status)) { - goto FatalError; - } - - ScratchBuffer->PointerValue =3D Condensed->PointerValue; - Status =3D QemuFwCfgS3ScriptWriteBytes (-1, Condensed->PointerSize); - if (RETURN_ERROR (Status)) { - goto FatalError; - } - } - - DEBUG ((DEBUG_VERBOSE, "%a: boot script fragment saved\n", __FUNCTION__)= ); - - ReleaseS3Context (S3Context); - return; - -FatalError: - ASSERT (FALSE); - CpuDeadLoop (); -} - - -/** - Translate and append the information from an S3_CONTEXT object to the AC= PI S3 - Boot Script. - - The effects of a successful call to this function cannot be undone. - - @param[in] S3Context The S3_CONTEXT object to translate to ACPI S3 Boot - Script opcodes. If the function returns successful= ly, - the caller must set the S3Context pointer -- origi= nally - returned by AllocateS3Context() -- immediately to = NULL, - because the ownership of S3Context has been transf= erred. - - @retval EFI_SUCCESS The translation of S3Context to ACPI S3 Boot Script - opcodes has been successfully executed or queued. (T= his - includes the case when S3Context was empty on input = and - no ACPI S3 Boot Script opcodes have been necessary to - produce.) - - @return Error codes from underlying functions. -**/ -EFI_STATUS -TransferS3ContextToBootScript ( - IN S3_CONTEXT *S3Context - ) -{ - RETURN_STATUS Status; - - if (S3Context->Used =3D=3D 0) { - ReleaseS3Context (S3Context); - return EFI_SUCCESS; - } - - Status =3D QemuFwCfgS3CallWhenBootScriptReady (AppendFwCfgBootScript, - S3Context, sizeof (SCRATCH_BUFFER)); - return (EFI_STATUS)Status; -} diff --git a/OvmfPkg/XenAcpiPlatformDxe/PciDecoding.c b/OvmfPkg/XenAcpiPlat= formDxe/PciDecoding.c deleted file mode 100644 index 00fc57eb13eb..000000000000 --- a/OvmfPkg/XenAcpiPlatformDxe/PciDecoding.c +++ /dev/null @@ -1,194 +0,0 @@ -/** @file - Temporarily enable IO and MMIO decoding for all PCI devices while QEMU - regenerates the ACPI tables. - - Copyright (C) 2016-2021, Red Hat, Inc. - - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include // DEBUG() -#include // AllocatePool() -#include // gBS - -#include "AcpiPlatform.h" - - -/** - Collect all PciIo protocol instances in the system. Save their original - attributes, and enable IO and MMIO decoding for each. - - This is a best effort function; it doesn't return status codes. Its - caller is supposed to proceed even if this function fails. - - @param[out] OriginalAttributes On output, a dynamically allocated array= of - ORIGINAL_ATTRIBUTES elements. The array = lists - the PciIo protocol instances found in the - system at the time of the call, plus the - original PCI attributes for each. - - Before returning, the function enables I= O and - MMIO decoding for each PciIo instance it - finds. - - On error, or when no such instances are - found, OriginalAttributes is set to NULL. - - @param[out] Count On output, the number of elements in - OriginalAttributes. On error it is set to - zero. -**/ -VOID -EnablePciDecoding ( - OUT ORIGINAL_ATTRIBUTES **OriginalAttributes, - OUT UINTN *Count - ) -{ - EFI_STATUS Status; - UINTN NoHandles; - EFI_HANDLE *Handles; - ORIGINAL_ATTRIBUTES *OrigAttrs; - UINTN Idx; - - *OriginalAttributes =3D NULL; - *Count =3D 0; - - if (PcdGetBool (PcdPciDisableBusEnumeration)) { - // - // The platform downloads ACPI tables from QEMU in general, but there = are - // no root bridges in this execution. We're done. - // - return; - } - - Status =3D gBS->LocateHandleBuffer (ByProtocol, &gEfiPciIoProtocolGuid, - NULL /* SearchKey */, &NoHandles, &Handles); - if (Status =3D=3D EFI_NOT_FOUND) { - // - // No PCI devices were found on either of the root bridges. We're done. - // - return; - } - - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_WARN, "%a: LocateHandleBuffer(): %r\n", __FUNCTION__, - Status)); - return; - } - - OrigAttrs =3D AllocatePool (NoHandles * sizeof *OrigAttrs); - if (OrigAttrs =3D=3D NULL) { - DEBUG ((DEBUG_WARN, "%a: AllocatePool(): out of resources\n", - __FUNCTION__)); - goto FreeHandles; - } - - for (Idx =3D 0; Idx < NoHandles; ++Idx) { - EFI_PCI_IO_PROTOCOL *PciIo; - UINT64 Attributes; - - // - // Look up PciIo on the handle and stash it - // - Status =3D gBS->HandleProtocol (Handles[Idx], &gEfiPciIoProtocolGuid, - (VOID**)&PciIo); - ASSERT_EFI_ERROR (Status); - OrigAttrs[Idx].PciIo =3D PciIo; - - // - // Stash the current attributes - // - Status =3D PciIo->Attributes (PciIo, EfiPciIoAttributeOperationGet, 0, - &OrigAttrs[Idx].PciAttributes); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_WARN, "%a: EfiPciIoAttributeOperationGet: %r\n", - __FUNCTION__, Status)); - goto RestoreAttributes; - } - - // - // Retrieve supported attributes - // - Status =3D PciIo->Attributes (PciIo, EfiPciIoAttributeOperationSupport= ed, 0, - &Attributes); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_WARN, "%a: EfiPciIoAttributeOperationSupported: %r\n", - __FUNCTION__, Status)); - goto RestoreAttributes; - } - - // - // Enable IO and MMIO decoding - // - Attributes &=3D EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY; - Status =3D PciIo->Attributes (PciIo, EfiPciIoAttributeOperationEnable, - Attributes, NULL); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_WARN, "%a: EfiPciIoAttributeOperationEnable: %r\n", - __FUNCTION__, Status)); - goto RestoreAttributes; - } - } - - // - // Success - // - FreePool (Handles); - *OriginalAttributes =3D OrigAttrs; - *Count =3D NoHandles; - return; - -RestoreAttributes: - while (Idx > 0) { - --Idx; - OrigAttrs[Idx].PciIo->Attributes (OrigAttrs[Idx].PciIo, - EfiPciIoAttributeOperationSet, - OrigAttrs[Idx].PciAttributes, - NULL - ); - } - FreePool (OrigAttrs); - -FreeHandles: - FreePool (Handles); -} - - -/** - Restore the original PCI attributes saved with EnablePciDecoding(). - - @param[in] OriginalAttributes The array allocated and populated by - EnablePciDecoding(). This parameter may be - NULL. If OriginalAttributes is NULL, then= the - function is a no-op; otherwise the PciIo - attributes will be restored, and the - OriginalAttributes array will be freed. - - @param[in] Count The Count value stored by EnablePciDecodi= ng(), - the number of elements in OriginalAttribu= tes. - Count may be zero if and only if - OriginalAttributes is NULL. -**/ -VOID -RestorePciDecoding ( - IN ORIGINAL_ATTRIBUTES *OriginalAttributes, - IN UINTN Count - ) -{ - UINTN Idx; - - ASSERT ((OriginalAttributes =3D=3D NULL) =3D=3D (Count =3D=3D 0)); - if (OriginalAttributes =3D=3D NULL) { - return; - } - - for (Idx =3D 0; Idx < Count; ++Idx) { - OriginalAttributes[Idx].PciIo->Attributes ( - OriginalAttributes[Idx].PciIo, - EfiPciIoAttributeOperationSet, - OriginalAttributes[Idx].PciAttributes, - NULL - ); - } - FreePool (OriginalAttributes); -} diff --git a/OvmfPkg/XenAcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/XenAcpiPl= atformDxe/QemuFwCfgAcpi.c deleted file mode 100644 index 521c06cf546f..000000000000 --- a/OvmfPkg/XenAcpiPlatformDxe/QemuFwCfgAcpi.c +++ /dev/null @@ -1,1196 +0,0 @@ -/** @file - OVMF ACPI support using QEMU's fw-cfg interface - - Copyright (C) 2012-2021, Red Hat, Inc. - Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include // EFI_ACPI_DESCRIPTION_HEAD= ER -#include // QEMU_LOADER_FNAME_SIZE -#include // AsciiStrCmp() -#include // CopyMem() -#include // DEBUG() -#include // AllocatePool() -#include // OrderedCollectionMin() -#include // QemuFwCfgFindFile() -#include // QemuFwCfgS3Enabled() -#include // gBS - -#include "AcpiPlatform.h" - -// -// The user structure for the ordered collection that will track the fw_cfg -// blobs under processing. -// -typedef struct { - UINT8 File[QEMU_LOADER_FNAME_SIZE]; // NUL-terminated name of the fw_c= fg - // blob. This is the ordering / se= arch - // key. - UINTN Size; // The number of bytes in this blo= b. - UINT8 *Base; // Pointer to the blob data. - BOOLEAN HostsOnlyTableData; // TRUE iff the blob has been foun= d to - // only contain data that is direc= tly - // part of ACPI tables. -} BLOB; - - -/** - Compare a standalone key against a user structure containing an embedded= key. - - @param[in] StandaloneKey Pointer to the bare key. - - @param[in] UserStruct Pointer to the user structure with the embedded - key. - - @retval <0 If StandaloneKey compares less than UserStruct's key. - - @retval 0 If StandaloneKey compares equal to UserStruct's key. - - @retval >0 If StandaloneKey compares greater than UserStruct's key. -**/ -STATIC -INTN -EFIAPI -BlobKeyCompare ( - IN CONST VOID *StandaloneKey, - IN CONST VOID *UserStruct - ) -{ - CONST BLOB *Blob; - - Blob =3D UserStruct; - return AsciiStrCmp (StandaloneKey, (CONST CHAR8 *)Blob->File); -} - - -/** - Comparator function for two user structures. - - @param[in] UserStruct1 Pointer to the first user structure. - - @param[in] UserStruct2 Pointer to the second user structure. - - @retval <0 If UserStruct1 compares less than UserStruct2. - - @retval 0 If UserStruct1 compares equal to UserStruct2. - - @retval >0 If UserStruct1 compares greater than UserStruct2. -**/ -STATIC -INTN -EFIAPI -BlobCompare ( - IN CONST VOID *UserStruct1, - IN CONST VOID *UserStruct2 - ) -{ - CONST BLOB *Blob1; - - Blob1 =3D UserStruct1; - return BlobKeyCompare (Blob1->File, UserStruct2); -} - - -/** - Comparator function for two opaque pointers, ordering on (unsigned) poin= ter - value itself. - Can be used as both Key and UserStruct comparator. - - @param[in] Pointer1 First pointer. - - @param[in] Pointer2 Second pointer. - - @retval <0 If Pointer1 compares less than Pointer2. - - @retval 0 If Pointer1 compares equal to Pointer2. - - @retval >0 If Pointer1 compares greater than Pointer2. -**/ -STATIC -INTN -EFIAPI -PointerCompare ( - IN CONST VOID *Pointer1, - IN CONST VOID *Pointer2 - ) -{ - if (Pointer1 =3D=3D Pointer2) { - return 0; - } - if ((UINTN)Pointer1 < (UINTN)Pointer2) { - return -1; - } - return 1; -} - - -/** - Comparator function for two ASCII strings. Can be used as both Key and - UserStruct comparator. - - This function exists solely so we can avoid casting &AsciiStrCmp to - ORDERED_COLLECTION_USER_COMPARE and ORDERED_COLLECTION_KEY_COMPARE. - - @param[in] AsciiString1 Pointer to the first ASCII string. - - @param[in] AsciiString2 Pointer to the second ASCII string. - - @return The return value of AsciiStrCmp (AsciiString1, AsciiString2). -**/ -STATIC -INTN -EFIAPI -AsciiStringCompare ( - IN CONST VOID *AsciiString1, - IN CONST VOID *AsciiString2 - ) -{ - return AsciiStrCmp (AsciiString1, AsciiString2); -} - - -/** - Release the ORDERED_COLLECTION structure populated by - CollectAllocationsRestrictedTo32Bit() (below). - - This function may be called by CollectAllocationsRestrictedTo32Bit() its= elf, - on the error path. - - @param[in] AllocationsRestrictedTo32Bit The ORDERED_COLLECTION structur= e to - release. -**/ -STATIC -VOID -ReleaseAllocationsRestrictedTo32Bit ( - IN ORDERED_COLLECTION *AllocationsRestrictedTo32Bit -) -{ - ORDERED_COLLECTION_ENTRY *Entry, *Entry2; - - for (Entry =3D OrderedCollectionMin (AllocationsRestrictedTo32Bit); - Entry !=3D NULL; - Entry =3D Entry2) { - Entry2 =3D OrderedCollectionNext (Entry); - OrderedCollectionDelete (AllocationsRestrictedTo32Bit, Entry, NULL); - } - OrderedCollectionUninit (AllocationsRestrictedTo32Bit); -} - - -/** - Iterate over the linker/loader script, and collect the names of the fw_c= fg - blobs that are referenced by QEMU_LOADER_ADD_POINTER.PointeeFile fields,= such - that QEMU_LOADER_ADD_POINTER.PointerSize is less than 8. This means that= the - pointee blob's address will have to be patched into a narrower-than-8 by= te - pointer field, hence the pointee blob must not be allocated from 64-bit - address space. - - @param[out] AllocationsRestrictedTo32Bit The ORDERED_COLLECTION structu= re - linking (not copying / owning)= such - QEMU_LOADER_ADD_POINTER.Pointe= eFile - fields that name the blobs - restricted from 64-bit allocat= ion. - - @param[in] LoaderStart Points to the first entry in t= he - linker/loader script. - - @param[in] LoaderEnd Points one past the last entry= in - the linker/loader script. - - @retval EFI_SUCCESS AllocationsRestrictedTo32Bit has been - populated. - - @retval EFI_OUT_OF_RESOURCES Memory allocation failed. - - @retval EFI_PROTOCOL_ERROR Invalid linker/loader script contents. -**/ -STATIC -EFI_STATUS -CollectAllocationsRestrictedTo32Bit ( - OUT ORDERED_COLLECTION **AllocationsRestrictedTo32Bit, - IN CONST QEMU_LOADER_ENTRY *LoaderStart, - IN CONST QEMU_LOADER_ENTRY *LoaderEnd -) -{ - ORDERED_COLLECTION *Collection; - CONST QEMU_LOADER_ENTRY *LoaderEntry; - EFI_STATUS Status; - - Collection =3D OrderedCollectionInit (AsciiStringCompare, AsciiStringCom= pare); - if (Collection =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } - - for (LoaderEntry =3D LoaderStart; LoaderEntry < LoaderEnd; ++LoaderEntry= ) { - CONST QEMU_LOADER_ADD_POINTER *AddPointer; - - if (LoaderEntry->Type !=3D QemuLoaderCmdAddPointer) { - continue; - } - AddPointer =3D &LoaderEntry->Command.AddPointer; - - if (AddPointer->PointerSize >=3D 8) { - continue; - } - - if (AddPointer->PointeeFile[QEMU_LOADER_FNAME_SIZE - 1] !=3D '\0') { - DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __FUNCTION__)); - Status =3D EFI_PROTOCOL_ERROR; - goto RollBack; - } - - Status =3D OrderedCollectionInsert ( - Collection, - NULL, // Entry - (VOID *)AddPointer->PointeeFile - ); - switch (Status) { - case EFI_SUCCESS: - DEBUG (( - DEBUG_VERBOSE, - "%a: restricting blob \"%a\" from 64-bit allocation\n", - __FUNCTION__, - AddPointer->PointeeFile - )); - break; - case EFI_ALREADY_STARTED: - // - // The restriction has been recorded already. - // - break; - case EFI_OUT_OF_RESOURCES: - goto RollBack; - default: - ASSERT (FALSE); - } - } - - *AllocationsRestrictedTo32Bit =3D Collection; - return EFI_SUCCESS; - -RollBack: - ReleaseAllocationsRestrictedTo32Bit (Collection); - return Status; -} - - -/** - Process a QEMU_LOADER_ALLOCATE command. - - @param[in] Allocate The QEMU_LOADER_ALLOCATE comman= d to - process. - - @param[in,out] Tracker The ORDERED_COLLECTION tracking= the - BLOB user structures created th= us - far. - - @param[in] AllocationsRestrictedTo32Bit The ORDERED_COLLECTION populate= d by - the function - CollectAllocationsRestrictedTo3= 2Bit, - naming the fw_cfg blobs that mu= st - not be allocated from 64-bit ad= dress - space. - - @retval EFI_SUCCESS An area of whole AcpiNVS pages has been - allocated for the blob contents, and the - contents have been saved. A BLOB object (u= ser - structure) has been allocated from pool me= mory, - referencing the blob contents. The BLOB us= er - structure has been linked into Tracker. - - @retval EFI_PROTOCOL_ERROR Malformed fw_cfg file name has been found = in - Allocate, or the Allocate command referenc= es a - file that is already known by Tracker. - - @retval EFI_UNSUPPORTED Unsupported alignment request has been fou= nd in - Allocate. - - @retval EFI_OUT_OF_RESOURCES Pool allocation failed. - - @return Error codes from QemuFwCfgFindFile() and - gBS->AllocatePages(). -**/ -STATIC -EFI_STATUS -EFIAPI -ProcessCmdAllocate ( - IN CONST QEMU_LOADER_ALLOCATE *Allocate, - IN OUT ORDERED_COLLECTION *Tracker, - IN ORDERED_COLLECTION *AllocationsRestrictedTo32Bit - ) -{ - FIRMWARE_CONFIG_ITEM FwCfgItem; - UINTN FwCfgSize; - EFI_STATUS Status; - UINTN NumPages; - EFI_PHYSICAL_ADDRESS Address; - BLOB *Blob; - - if (Allocate->File[QEMU_LOADER_FNAME_SIZE - 1] !=3D '\0') { - DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __FUNCTION__)); - return EFI_PROTOCOL_ERROR; - } - - if (Allocate->Alignment > EFI_PAGE_SIZE) { - DEBUG ((DEBUG_ERROR, "%a: unsupported alignment 0x%x\n", __FUNCTION__, - Allocate->Alignment)); - return EFI_UNSUPPORTED; - } - - Status =3D QemuFwCfgFindFile ((CHAR8 *)Allocate->File, &FwCfgItem, &FwCf= gSize); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: QemuFwCfgFindFile(\"%a\"): %r\n", __FUNCTION= __, - Allocate->File, Status)); - return Status; - } - - NumPages =3D EFI_SIZE_TO_PAGES (FwCfgSize); - Address =3D MAX_UINT64; - if (OrderedCollectionFind ( - AllocationsRestrictedTo32Bit, - Allocate->File - ) !=3D NULL) { - Address =3D MAX_UINT32; - } - Status =3D gBS->AllocatePages (AllocateMaxAddress, EfiACPIMemoryNVS, Num= Pages, - &Address); - if (EFI_ERROR (Status)) { - return Status; - } - - Blob =3D AllocatePool (sizeof *Blob); - if (Blob =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto FreePages; - } - CopyMem (Blob->File, Allocate->File, QEMU_LOADER_FNAME_SIZE); - Blob->Size =3D FwCfgSize; - Blob->Base =3D (VOID *)(UINTN)Address; - Blob->HostsOnlyTableData =3D TRUE; - - Status =3D OrderedCollectionInsert (Tracker, NULL, Blob); - if (Status =3D=3D RETURN_ALREADY_STARTED) { - DEBUG ((DEBUG_ERROR, "%a: duplicated file \"%a\"\n", __FUNCTION__, - Allocate->File)); - Status =3D EFI_PROTOCOL_ERROR; - } - if (EFI_ERROR (Status)) { - goto FreeBlob; - } - - QemuFwCfgSelectItem (FwCfgItem); - QemuFwCfgReadBytes (FwCfgSize, Blob->Base); - ZeroMem (Blob->Base + Blob->Size, EFI_PAGES_TO_SIZE (NumPages) - Blob->S= ize); - - DEBUG ((DEBUG_VERBOSE, "%a: File=3D\"%a\" Alignment=3D0x%x Zone=3D%d Siz= e=3D0x%Lx " - "Address=3D0x%Lx\n", __FUNCTION__, Allocate->File, Allocate->Alignment, - Allocate->Zone, (UINT64)Blob->Size, (UINT64)(UINTN)Blob->Base)); - return EFI_SUCCESS; - -FreeBlob: - FreePool (Blob); - -FreePages: - gBS->FreePages (Address, NumPages); - - return Status; -} - - -/** - Process a QEMU_LOADER_ADD_POINTER command. - - @param[in] AddPointer The QEMU_LOADER_ADD_POINTER command to process. - - @param[in] Tracker The ORDERED_COLLECTION tracking the BLOB user - structures created thus far. - - @retval EFI_PROTOCOL_ERROR Malformed fw_cfg file name(s) have been foun= d in - AddPointer, or the AddPointer command refere= nces - a file unknown to Tracker, or the pointer to - relocate has invalid location, size, or valu= e, or - the relocated pointer value is not represent= able - in the given pointer size. - - @retval EFI_SUCCESS The pointer field inside the pointer blob has - been relocated. -**/ -STATIC -EFI_STATUS -EFIAPI -ProcessCmdAddPointer ( - IN CONST QEMU_LOADER_ADD_POINTER *AddPointer, - IN CONST ORDERED_COLLECTION *Tracker - ) -{ - ORDERED_COLLECTION_ENTRY *TrackerEntry, *TrackerEntry2; - BLOB *Blob, *Blob2; - UINT8 *PointerField; - UINT64 PointerValue; - - if (AddPointer->PointerFile[QEMU_LOADER_FNAME_SIZE - 1] !=3D '\0' || - AddPointer->PointeeFile[QEMU_LOADER_FNAME_SIZE - 1] !=3D '\0') { - DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __FUNCTION__)); - return EFI_PROTOCOL_ERROR; - } - - TrackerEntry =3D OrderedCollectionFind (Tracker, AddPointer->PointerFile= ); - TrackerEntry2 =3D OrderedCollectionFind (Tracker, AddPointer->PointeeFil= e); - if (TrackerEntry =3D=3D NULL || TrackerEntry2 =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "%a: invalid blob reference(s) \"%a\" / \"%a\"\n", - __FUNCTION__, AddPointer->PointerFile, AddPointer->PointeeFile)); - return EFI_PROTOCOL_ERROR; - } - - Blob =3D OrderedCollectionUserStruct (TrackerEntry); - Blob2 =3D OrderedCollectionUserStruct (TrackerEntry2); - if ((AddPointer->PointerSize !=3D 1 && AddPointer->PointerSize !=3D 2 && - AddPointer->PointerSize !=3D 4 && AddPointer->PointerSize !=3D 8) || - Blob->Size < AddPointer->PointerSize || - Blob->Size - AddPointer->PointerSize < AddPointer->PointerOffset) { - DEBUG ((DEBUG_ERROR, "%a: invalid pointer location or size in \"%a\"\n= ", - __FUNCTION__, AddPointer->PointerFile)); - return EFI_PROTOCOL_ERROR; - } - - PointerField =3D Blob->Base + AddPointer->PointerOffset; - PointerValue =3D 0; - CopyMem (&PointerValue, PointerField, AddPointer->PointerSize); - if (PointerValue >=3D Blob2->Size) { - DEBUG ((DEBUG_ERROR, "%a: invalid pointer value in \"%a\"\n", __FUNCTI= ON__, - AddPointer->PointerFile)); - return EFI_PROTOCOL_ERROR; - } - - // - // The memory allocation system ensures that the address of the byte pas= t the - // last byte of any allocated object is expressible (no wraparound). - // - ASSERT ((UINTN)Blob2->Base <=3D MAX_ADDRESS - Blob2->Size); - - PointerValue +=3D (UINT64)(UINTN)Blob2->Base; - if (AddPointer->PointerSize < 8 && - RShiftU64 (PointerValue, AddPointer->PointerSize * 8) !=3D 0) { - DEBUG ((DEBUG_ERROR, "%a: relocated pointer value unrepresentable in " - "\"%a\"\n", __FUNCTION__, AddPointer->PointerFile)); - return EFI_PROTOCOL_ERROR; - } - - CopyMem (PointerField, &PointerValue, AddPointer->PointerSize); - - DEBUG ((DEBUG_VERBOSE, "%a: PointerFile=3D\"%a\" PointeeFile=3D\"%a\" " - "PointerOffset=3D0x%x PointerSize=3D%d\n", __FUNCTION__, - AddPointer->PointerFile, AddPointer->PointeeFile, - AddPointer->PointerOffset, AddPointer->PointerSize)); - return EFI_SUCCESS; -} - - -/** - Process a QEMU_LOADER_ADD_CHECKSUM command. - - @param[in] AddChecksum The QEMU_LOADER_ADD_CHECKSUM command to process. - - @param[in] Tracker The ORDERED_COLLECTION tracking the BLOB user - structures created thus far. - - @retval EFI_PROTOCOL_ERROR Malformed fw_cfg file name has been found in - AddChecksum, or the AddChecksum command - references a file unknown to Tracker, or the - range to checksum is invalid. - - @retval EFI_SUCCESS The requested range has been checksummed. -**/ -STATIC -EFI_STATUS -EFIAPI -ProcessCmdAddChecksum ( - IN CONST QEMU_LOADER_ADD_CHECKSUM *AddChecksum, - IN CONST ORDERED_COLLECTION *Tracker - ) -{ - ORDERED_COLLECTION_ENTRY *TrackerEntry; - BLOB *Blob; - - if (AddChecksum->File[QEMU_LOADER_FNAME_SIZE - 1] !=3D '\0') { - DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __FUNCTION__)); - return EFI_PROTOCOL_ERROR; - } - - TrackerEntry =3D OrderedCollectionFind (Tracker, AddChecksum->File); - if (TrackerEntry =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "%a: invalid blob reference \"%a\"\n", __FUNCTION= __, - AddChecksum->File)); - return EFI_PROTOCOL_ERROR; - } - - Blob =3D OrderedCollectionUserStruct (TrackerEntry); - if (Blob->Size <=3D AddChecksum->ResultOffset || - Blob->Size < AddChecksum->Length || - Blob->Size - AddChecksum->Length < AddChecksum->Start) { - DEBUG ((DEBUG_ERROR, "%a: invalid checksum range in \"%a\"\n", - __FUNCTION__, AddChecksum->File)); - return EFI_PROTOCOL_ERROR; - } - - Blob->Base[AddChecksum->ResultOffset] =3D CalculateCheckSum8 ( - Blob->Base + AddChecksum->Start, - AddChecksum->Length - ); - DEBUG ((DEBUG_VERBOSE, "%a: File=3D\"%a\" ResultOffset=3D0x%x Start=3D0x= %x " - "Length=3D0x%x\n", __FUNCTION__, AddChecksum->File, - AddChecksum->ResultOffset, AddChecksum->Start, AddChecksum->Length)); - return EFI_SUCCESS; -} - - -/** - Process a QEMU_LOADER_WRITE_POINTER command. - - @param[in] WritePointer The QEMU_LOADER_WRITE_POINTER command to proce= ss. - - @param[in] Tracker The ORDERED_COLLECTION tracking the BLOB user - structures created thus far. - - @param[in,out] S3Context The S3_CONTEXT object capturing the fw_cfg act= ions - of successfully processed QEMU_LOADER_WRITE_PO= INTER - commands, to be replayed at S3 resume. S3Conte= xt - may be NULL if S3 is disabled. - - @retval EFI_PROTOCOL_ERROR Malformed fw_cfg file name(s) have been foun= d in - WritePointer. Or, the WritePointer command - references a file unknown to Tracker or the - fw_cfg directory. Or, the pointer object to - rewrite has invalid location, size, or initi= al - relative value. Or, the pointer value to sto= re - does not fit in the given pointer size. - - @retval EFI_SUCCESS The pointer object inside the writeable fw_c= fg - file has been written. If S3Context is not N= ULL, - then WritePointer has been condensed into - S3Context. - - @return Error codes propagated from - SaveCondensedWritePointerToS3Context(). The - pointer object inside the writeable fw_cfg f= ile - has not been written. -**/ -STATIC -EFI_STATUS -ProcessCmdWritePointer ( - IN CONST QEMU_LOADER_WRITE_POINTER *WritePointer, - IN CONST ORDERED_COLLECTION *Tracker, - IN OUT S3_CONTEXT *S3Context OPTIONAL - ) -{ - RETURN_STATUS Status; - FIRMWARE_CONFIG_ITEM PointerItem; - UINTN PointerItemSize; - ORDERED_COLLECTION_ENTRY *PointeeEntry; - BLOB *PointeeBlob; - UINT64 PointerValue; - - if (WritePointer->PointerFile[QEMU_LOADER_FNAME_SIZE - 1] !=3D '\0' || - WritePointer->PointeeFile[QEMU_LOADER_FNAME_SIZE - 1] !=3D '\0') { - DEBUG ((DEBUG_ERROR, "%a: malformed file name\n", __FUNCTION__)); - return EFI_PROTOCOL_ERROR; - } - - Status =3D QemuFwCfgFindFile ((CONST CHAR8 *)WritePointer->PointerFile, - &PointerItem, &PointerItemSize); - PointeeEntry =3D OrderedCollectionFind (Tracker, WritePointer->PointeeFi= le); - if (RETURN_ERROR (Status) || PointeeEntry =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, - "%a: invalid fw_cfg file or blob reference \"%a\" / \"%a\"\n", - __FUNCTION__, WritePointer->PointerFile, WritePointer->PointeeFile)); - return EFI_PROTOCOL_ERROR; - } - - if ((WritePointer->PointerSize !=3D 1 && WritePointer->PointerSize !=3D = 2 && - WritePointer->PointerSize !=3D 4 && WritePointer->PointerSize !=3D = 8) || - (PointerItemSize < WritePointer->PointerSize) || - (PointerItemSize - WritePointer->PointerSize < - WritePointer->PointerOffset)) { - DEBUG ((DEBUG_ERROR, "%a: invalid pointer location or size in \"%a\"\n= ", - __FUNCTION__, WritePointer->PointerFile)); - return EFI_PROTOCOL_ERROR; - } - - PointeeBlob =3D OrderedCollectionUserStruct (PointeeEntry); - PointerValue =3D WritePointer->PointeeOffset; - if (PointerValue >=3D PointeeBlob->Size) { - DEBUG ((DEBUG_ERROR, "%a: invalid PointeeOffset\n", __FUNCTION__)); - return EFI_PROTOCOL_ERROR; - } - - // - // The memory allocation system ensures that the address of the byte pas= t the - // last byte of any allocated object is expressible (no wraparound). - // - ASSERT ((UINTN)PointeeBlob->Base <=3D MAX_ADDRESS - PointeeBlob->Size); - - PointerValue +=3D (UINT64)(UINTN)PointeeBlob->Base; - if (WritePointer->PointerSize < 8 && - RShiftU64 (PointerValue, WritePointer->PointerSize * 8) !=3D 0) { - DEBUG ((DEBUG_ERROR, "%a: pointer value unrepresentable in \"%a\"\n", - __FUNCTION__, WritePointer->PointerFile)); - return EFI_PROTOCOL_ERROR; - } - - // - // If S3 is enabled, we have to capture the below fw_cfg actions in cond= ensed - // form, to be replayed during S3 resume. - // - if (S3Context !=3D NULL) { - EFI_STATUS SaveStatus; - - SaveStatus =3D SaveCondensedWritePointerToS3Context ( - S3Context, - (UINT16)PointerItem, - WritePointer->PointerSize, - WritePointer->PointerOffset, - PointerValue - ); - if (EFI_ERROR (SaveStatus)) { - return SaveStatus; - } - } - - QemuFwCfgSelectItem (PointerItem); - QemuFwCfgSkipBytes (WritePointer->PointerOffset); - QemuFwCfgWriteBytes (WritePointer->PointerSize, &PointerValue); - - // - // Because QEMU has now learned PointeeBlob->Base, we must mark PointeeB= lob - // as unreleasable, for the case when the whole linker/loader script is - // handled successfully. - // - PointeeBlob->HostsOnlyTableData =3D FALSE; - - DEBUG ((DEBUG_VERBOSE, "%a: PointerFile=3D\"%a\" PointeeFile=3D\"%a\" " - "PointerOffset=3D0x%x PointeeOffset=3D0x%x PointerSize=3D%d\n", __FUNC= TION__, - WritePointer->PointerFile, WritePointer->PointeeFile, - WritePointer->PointerOffset, WritePointer->PointeeOffset, - WritePointer->PointerSize)); - return EFI_SUCCESS; -} - - -/** - Undo a QEMU_LOADER_WRITE_POINTER command. - - This function revokes (zeroes out) a guest memory reference communicated= to - QEMU earlier. The caller is responsible for invoking this function only = on - such QEMU_LOADER_WRITE_POINTER commands that have been successfully proc= essed - by ProcessCmdWritePointer(). - - @param[in] WritePointer The QEMU_LOADER_WRITE_POINTER command to undo. -**/ -STATIC -VOID -UndoCmdWritePointer ( - IN CONST QEMU_LOADER_WRITE_POINTER *WritePointer - ) -{ - RETURN_STATUS Status; - FIRMWARE_CONFIG_ITEM PointerItem; - UINTN PointerItemSize; - UINT64 PointerValue; - - Status =3D QemuFwCfgFindFile ((CONST CHAR8 *)WritePointer->PointerFile, - &PointerItem, &PointerItemSize); - ASSERT_RETURN_ERROR (Status); - - PointerValue =3D 0; - QemuFwCfgSelectItem (PointerItem); - QemuFwCfgSkipBytes (WritePointer->PointerOffset); - QemuFwCfgWriteBytes (WritePointer->PointerSize, &PointerValue); - - DEBUG ((DEBUG_VERBOSE, - "%a: PointerFile=3D\"%a\" PointerOffset=3D0x%x PointerSize=3D%d\n", __= FUNCTION__, - WritePointer->PointerFile, WritePointer->PointerOffset, - WritePointer->PointerSize)); -} - - -// -// We'll be saving the keys of installed tables so that we can roll them b= ack -// in case of failure. 128 tables should be enough for anyone (TM). -// -#define INSTALLED_TABLES_MAX 128 - -/** - Process a QEMU_LOADER_ADD_POINTER command in order to see if its target = byte - array is an ACPI table, and if so, install it. - - This function assumes that the entire QEMU linker/loader command file has - been processed successfully in a prior first pass. - - @param[in] AddPointer The QEMU_LOADER_ADD_POINTER command to proc= ess. - - @param[in] Tracker The ORDERED_COLLECTION tracking the BLOB us= er - structures. - - @param[in] AcpiProtocol The ACPI table protocol used to install tab= les. - - @param[in,out] InstalledKey On input, an array of INSTALLED_TABLES_MAX = UINTN - elements, allocated by the caller. On outpu= t, - the function will have stored (appended) the - AcpiProtocol-internal key of the ACPI table= that - the function has installed, if the AddPoint= er - command identified an ACPI table that is - different from RSDT and XSDT. - - @param[in,out] NumInstalled On input, the number of entries already use= d in - InstalledKey; it must be in [0, - INSTALLED_TABLES_MAX] inclusive. On output,= the - parameter is incremented if the AddPointer - command identified an ACPI table that is - different from RSDT and XSDT. - - @param[in,out] SeenPointers The ORDERED_COLLECTION tracking the absolute - target addresses that have been pointed-to = by - QEMU_LOADER_ADD_POINTER commands thus far. = If a - target address is encountered for the first - time, and it identifies an ACPI table that = is - different from RDST and XSDT, the table is - installed. If a target address is seen for = the - second or later times, it is skipped without - taking any action. - - @retval EFI_INVALID_PARAMETER NumInstalled was outside the allowed rang= e on - input. - - @retval EFI_OUT_OF_RESOURCES The AddPointer command identified an ACPI - table different from RSDT and XSDT, but t= here - was no more room in InstalledKey. - - @retval EFI_SUCCESS AddPointer has been processed. Either its - absolute target address has been encounte= red - before, or an ACPI table different from R= SDT - and XSDT has been installed (reflected by - InstalledKey and NumInstalled), or RSDT or - XSDT has been identified but not installe= d, or - the fw_cfg blob pointed-into by AddPointe= r has - been marked as hosting something else than - just direct ACPI table contents. - - @return Error codes returned by - AcpiProtocol->InstallAcpiTable(). -**/ -STATIC -EFI_STATUS -EFIAPI -Process2ndPassCmdAddPointer ( - IN CONST QEMU_LOADER_ADD_POINTER *AddPointer, - IN CONST ORDERED_COLLECTION *Tracker, - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN OUT UINTN InstalledKey[INSTALLED_TABLES_MAX], - IN OUT INT32 *NumInstalled, - IN OUT ORDERED_COLLECTION *SeenPointers - ) -{ - CONST ORDERED_COLLECTION_ENTRY *TrackerEntry; - CONST ORDERED_COLLECTION_ENTRY *TrackerEntry2; - ORDERED_COLLECTION_ENTRY *SeenPointerEntry; - CONST BLOB *Blob; - BLOB *Blob2; - CONST UINT8 *PointerField; - UINT64 PointerValue; - UINTN Blob2Remaining; - UINTN TableSize; - CONST EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs; - CONST EFI_ACPI_DESCRIPTION_HEADER *Header; - EFI_STATUS Status; - - if (*NumInstalled < 0 || *NumInstalled > INSTALLED_TABLES_MAX) { - return EFI_INVALID_PARAMETER; - } - - TrackerEntry =3D OrderedCollectionFind (Tracker, AddPointer->PointerFile= ); - TrackerEntry2 =3D OrderedCollectionFind (Tracker, AddPointer->PointeeFil= e); - Blob =3D OrderedCollectionUserStruct (TrackerEntry); - Blob2 =3D OrderedCollectionUserStruct (TrackerEntry2); - PointerField =3D Blob->Base + AddPointer->PointerOffset; - PointerValue =3D 0; - CopyMem (&PointerValue, PointerField, AddPointer->PointerSize); - - // - // We assert that PointerValue falls inside Blob2's contents. This is en= sured - // by the Blob2->Size check and later checks in ProcessCmdAddPointer(). - // - Blob2Remaining =3D (UINTN)Blob2->Base; - ASSERT(PointerValue >=3D Blob2Remaining); - Blob2Remaining +=3D Blob2->Size; - ASSERT (PointerValue < Blob2Remaining); - - Status =3D OrderedCollectionInsert ( - SeenPointers, - &SeenPointerEntry, // for reverting insertion in error case - (VOID *)(UINTN)PointerValue - ); - if (EFI_ERROR (Status)) { - if (Status =3D=3D RETURN_ALREADY_STARTED) { - // - // Already seen this pointer, don't try to process it again. - // - DEBUG (( - DEBUG_VERBOSE, - "%a: PointerValue=3D0x%Lx already processed, skipping.\n", - __FUNCTION__, - PointerValue - )); - Status =3D EFI_SUCCESS; - } - return Status; - } - - Blob2Remaining -=3D (UINTN) PointerValue; - DEBUG ((DEBUG_VERBOSE, "%a: checking for ACPI header in \"%a\" at 0x%Lx " - "(remaining: 0x%Lx): ", __FUNCTION__, AddPointer->PointeeFile, - PointerValue, (UINT64)Blob2Remaining)); - - TableSize =3D 0; - - // - // To make our job simple, the FACS has a custom header. Sigh. - // - if (sizeof *Facs <=3D Blob2Remaining) { - Facs =3D (EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Pointe= rValue; - - if (Facs->Length >=3D sizeof *Facs && - Facs->Length <=3D Blob2Remaining && - Facs->Signature =3D=3D - EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) { - DEBUG ((DEBUG_VERBOSE, "found \"%-4.4a\" size 0x%x\n", - (CONST CHAR8 *)&Facs->Signature, Facs->Length)); - TableSize =3D Facs->Length; - } - } - - // - // check for the uniform tables - // - if (TableSize =3D=3D 0 && sizeof *Header <=3D Blob2Remaining) { - Header =3D (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)PointerValue; - - if (Header->Length >=3D sizeof *Header && - Header->Length <=3D Blob2Remaining && - CalculateSum8 ((CONST UINT8 *)Header, Header->Length) =3D=3D 0) { - // - // This looks very much like an ACPI table from QEMU: - // - Length field consistent with both ACPI and containing blob size - // - checksum is correct - // - DEBUG ((DEBUG_VERBOSE, "found \"%-4.4a\" size 0x%x\n", - (CONST CHAR8 *)&Header->Signature, Header->Length)); - TableSize =3D Header->Length; - - // - // Skip RSDT and XSDT because those are handled by - // EFI_ACPI_TABLE_PROTOCOL automatically. - if (Header->Signature =3D=3D - EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE || - Header->Signature =3D=3D - EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATU= RE) { - return EFI_SUCCESS; - } - } - } - - if (TableSize =3D=3D 0) { - DEBUG ((DEBUG_VERBOSE, "not found; marking fw_cfg blob as opaque\n")); - Blob2->HostsOnlyTableData =3D FALSE; - return EFI_SUCCESS; - } - - if (*NumInstalled =3D=3D INSTALLED_TABLES_MAX) { - DEBUG ((DEBUG_ERROR, "%a: can't install more than %d tables\n", - __FUNCTION__, INSTALLED_TABLES_MAX)); - Status =3D EFI_OUT_OF_RESOURCES; - goto RollbackSeenPointer; - } - - Status =3D AcpiProtocol->InstallAcpiTable (AcpiProtocol, - (VOID *)(UINTN)PointerValue, TableSize, - &InstalledKey[*NumInstalled]); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: InstallAcpiTable(): %r\n", __FUNCTION__, - Status)); - goto RollbackSeenPointer; - } - ++*NumInstalled; - return EFI_SUCCESS; - -RollbackSeenPointer: - OrderedCollectionDelete (SeenPointers, SeenPointerEntry, NULL); - return Status; -} - - -/** - Download, process, and install ACPI table data from the QEMU loader - interface. - - @param[in] AcpiProtocol The ACPI table protocol used to install tables. - - @retval EFI_UNSUPPORTED Firmware configuration is unavailable, or= QEMU - loader command with unsupported parameters - has been found. - - @retval EFI_NOT_FOUND The host doesn't export the required fw_c= fg - files. - - @retval EFI_OUT_OF_RESOURCES Memory allocation failed, or more than - INSTALLED_TABLES_MAX tables found. - - @retval EFI_PROTOCOL_ERROR Found invalid fw_cfg contents. - - @return Status codes returned by - AcpiProtocol->InstallAcpiTable(). - -**/ -EFI_STATUS -EFIAPI -InstallQemuFwCfgTables ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol - ) -{ - EFI_STATUS Status; - FIRMWARE_CONFIG_ITEM FwCfgItem; - UINTN FwCfgSize; - QEMU_LOADER_ENTRY *LoaderStart; - CONST QEMU_LOADER_ENTRY *LoaderEntry, *LoaderEnd; - CONST QEMU_LOADER_ENTRY *WritePointerSubsetEnd; - ORIGINAL_ATTRIBUTES *OriginalPciAttributes; - UINTN OriginalPciAttributesCount; - ORDERED_COLLECTION *AllocationsRestrictedTo32Bit; - S3_CONTEXT *S3Context; - ORDERED_COLLECTION *Tracker; - UINTN *InstalledKey; - INT32 Installed; - ORDERED_COLLECTION_ENTRY *TrackerEntry, *TrackerEntry2; - ORDERED_COLLECTION *SeenPointers; - ORDERED_COLLECTION_ENTRY *SeenPointerEntry, *SeenPointerEntry2; - - Status =3D QemuFwCfgFindFile ("etc/table-loader", &FwCfgItem, &FwCfgSize= ); - if (EFI_ERROR (Status)) { - return Status; - } - if (FwCfgSize % sizeof *LoaderEntry !=3D 0) { - DEBUG ((DEBUG_ERROR, "%a: \"etc/table-loader\" has invalid size 0x%Lx\= n", - __FUNCTION__, (UINT64)FwCfgSize)); - return EFI_PROTOCOL_ERROR; - } - - LoaderStart =3D AllocatePool (FwCfgSize); - if (LoaderStart =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } - EnablePciDecoding (&OriginalPciAttributes, &OriginalPciAttributesCount); - QemuFwCfgSelectItem (FwCfgItem); - QemuFwCfgReadBytes (FwCfgSize, LoaderStart); - RestorePciDecoding (OriginalPciAttributes, OriginalPciAttributesCount); - LoaderEnd =3D LoaderStart + FwCfgSize / sizeof *LoaderEntry; - - AllocationsRestrictedTo32Bit =3D NULL; - Status =3D CollectAllocationsRestrictedTo32Bit ( - &AllocationsRestrictedTo32Bit, - LoaderStart, - LoaderEnd - ); - if (EFI_ERROR (Status)) { - goto FreeLoader; - } - - S3Context =3D NULL; - if (QemuFwCfgS3Enabled ()) { - // - // Size the allocation pessimistically, assuming that all commands in = the - // script are QEMU_LOADER_WRITE_POINTER commands. - // - Status =3D AllocateS3Context (&S3Context, LoaderEnd - LoaderStart); - if (EFI_ERROR (Status)) { - goto FreeAllocationsRestrictedTo32Bit; - } - } - - Tracker =3D OrderedCollectionInit (BlobCompare, BlobKeyCompare); - if (Tracker =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto FreeS3Context; - } - - // - // first pass: process the commands - // - // "WritePointerSubsetEnd" points one past the last successful - // QEMU_LOADER_WRITE_POINTER command. Now when we're about to start the = first - // pass, no such command has been encountered yet. - // - WritePointerSubsetEnd =3D LoaderStart; - for (LoaderEntry =3D LoaderStart; LoaderEntry < LoaderEnd; ++LoaderEntry= ) { - switch (LoaderEntry->Type) { - case QemuLoaderCmdAllocate: - Status =3D ProcessCmdAllocate ( - &LoaderEntry->Command.Allocate, - Tracker, - AllocationsRestrictedTo32Bit - ); - break; - - case QemuLoaderCmdAddPointer: - Status =3D ProcessCmdAddPointer (&LoaderEntry->Command.AddPointer, - Tracker); - break; - - case QemuLoaderCmdAddChecksum: - Status =3D ProcessCmdAddChecksum (&LoaderEntry->Command.AddChecksum, - Tracker); - break; - - case QemuLoaderCmdWritePointer: - Status =3D ProcessCmdWritePointer (&LoaderEntry->Command.WritePoin= ter, - Tracker, S3Context); - if (!EFI_ERROR (Status)) { - WritePointerSubsetEnd =3D LoaderEntry + 1; - } - break; - - default: - DEBUG ((DEBUG_VERBOSE, "%a: unknown loader command: 0x%x\n", - __FUNCTION__, LoaderEntry->Type)); - break; - } - - if (EFI_ERROR (Status)) { - goto RollbackWritePointersAndFreeTracker; - } - } - - InstalledKey =3D AllocatePool (INSTALLED_TABLES_MAX * sizeof *InstalledK= ey); - if (InstalledKey =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto RollbackWritePointersAndFreeTracker; - } - - SeenPointers =3D OrderedCollectionInit (PointerCompare, PointerCompare); - if (SeenPointers =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto FreeKeys; - } - - // - // second pass: identify and install ACPI tables - // - Installed =3D 0; - for (LoaderEntry =3D LoaderStart; LoaderEntry < LoaderEnd; ++LoaderEntry= ) { - if (LoaderEntry->Type =3D=3D QemuLoaderCmdAddPointer) { - Status =3D Process2ndPassCmdAddPointer ( - &LoaderEntry->Command.AddPointer, - Tracker, - AcpiProtocol, - InstalledKey, - &Installed, - SeenPointers - ); - if (EFI_ERROR (Status)) { - goto UninstallAcpiTables; - } - } - } - - // - // Translating the condensed QEMU_LOADER_WRITE_POINTER commands to ACPI = S3 - // Boot Script opcodes has to be the last operation in this function, be= cause - // if it succeeds, it cannot be undone. - // - if (S3Context !=3D NULL) { - Status =3D TransferS3ContextToBootScript (S3Context); - if (EFI_ERROR (Status)) { - goto UninstallAcpiTables; - } - // - // Ownership of S3Context has been transferred. - // - S3Context =3D NULL; - } - -UninstallAcpiTables: - if (EFI_ERROR (Status)) { - // - // roll back partial installation - // - while (Installed > 0) { - --Installed; - AcpiProtocol->UninstallAcpiTable (AcpiProtocol, InstalledKey[Install= ed]); - } - } else { - DEBUG ((DEBUG_INFO, "%a: installed %d tables\n", __FUNCTION__, Install= ed)); - } - - for (SeenPointerEntry =3D OrderedCollectionMin (SeenPointers); - SeenPointerEntry !=3D NULL; - SeenPointerEntry =3D SeenPointerEntry2) { - SeenPointerEntry2 =3D OrderedCollectionNext (SeenPointerEntry); - OrderedCollectionDelete (SeenPointers, SeenPointerEntry, NULL); - } - OrderedCollectionUninit (SeenPointers); - -FreeKeys: - FreePool (InstalledKey); - -RollbackWritePointersAndFreeTracker: - // - // In case of failure, revoke any allocation addresses that were communi= cated - // to QEMU previously, before we release all the blobs. - // - if (EFI_ERROR (Status)) { - LoaderEntry =3D WritePointerSubsetEnd; - while (LoaderEntry > LoaderStart) { - --LoaderEntry; - if (LoaderEntry->Type =3D=3D QemuLoaderCmdWritePointer) { - UndoCmdWritePointer (&LoaderEntry->Command.WritePointer); - } - } - } - - // - // Tear down the tracker infrastructure. Each fw_cfg blob will be left in - // place only if we're exiting with success and the blob hosts data that= is - // not directly part of some ACPI table. - // - for (TrackerEntry =3D OrderedCollectionMin (Tracker); TrackerEntry !=3D = NULL; - TrackerEntry =3D TrackerEntry2) { - VOID *UserStruct; - BLOB *Blob; - - TrackerEntry2 =3D OrderedCollectionNext (TrackerEntry); - OrderedCollectionDelete (Tracker, TrackerEntry, &UserStruct); - Blob =3D UserStruct; - - if (EFI_ERROR (Status) || Blob->HostsOnlyTableData) { - DEBUG ((DEBUG_VERBOSE, "%a: freeing \"%a\"\n", __FUNCTION__, - Blob->File)); - gBS->FreePages ((UINTN)Blob->Base, EFI_SIZE_TO_PAGES (Blob->Size)); - } - FreePool (Blob); - } - OrderedCollectionUninit (Tracker); - -FreeS3Context: - if (S3Context !=3D NULL) { - ReleaseS3Context (S3Context); - } - -FreeAllocationsRestrictedTo32Bit: - ReleaseAllocationsRestrictedTo32Bit (AllocationsRestrictedTo32Bit); - -FreeLoader: - FreePool (LoaderStart); - - return Status; -} --=20 2.19.1.3.g30247aa5d201 -=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 (#75682): https://edk2.groups.io/g/devel/message/75682 Mute This Topic: https://groups.io/mt/83110541/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75683+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75683+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622060980; cv=none; d=zohomail.com; s=zohoarc; b=OloE+2+7P7b9xi18iwidC6MVGA8yOmjjWXkElXsLjFdKjt3P9lWChBQaPAnb8QNLknR/8vQ1w621wpJ8Hl0NilPfYJv+JbaRFwc2eE4ki1euJoZ/12GgjgjUvvLofON9IVanZW54BcmhJGYoe1EfcPbUEQvksRWHxYa06mzZukU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622060980; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=xqkr2Nly9T4lcOe55p9qCh0O/PxhbNBRyPTty+6stdQ=; b=SrsRru222ea8tqnpEeqtc8Q0NB7GJYKB2dw9fmIgtGVPVezlah38nRqnBcNfdDdbyDEQjkxThO3KUw76oiVSBPek/vT23B4+F734ea002ZeynaUfNRLTdHo4FgZMi0BKb3QzdJfada0ylwyoOhlLEHAQxcu+o5TFTVlooa4OXs8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75683+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622060980697464.3382708135889; Wed, 26 May 2021 13:29:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id L6NQYY1788612xFnE8xjGvuz; Wed, 26 May 2021 13:29:40 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.2948.1622060979401390142 for ; Wed, 26 May 2021 13:29:39 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-557-5EvHoYS4PC6wyLd811Dobg-1; Wed, 26 May 2021 16:29:36 -0400 X-MC-Unique: 5EvHoYS4PC6wyLd811Dobg-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 23E1F107ACE3; Wed, 26 May 2021 20:29:35 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C0DB60CCD; Wed, 26 May 2021 20:29:32 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 14/43] OvmfPkg/XenAcpiPlatformDxe: remove QEMU fw_cfg dependency Date: Wed, 26 May 2021 22:14:17 +0200 Message-Id: <20210526201446.12554-15-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: cCAvQrQl2jWsNgpwEfMkZ3SCx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622060980; bh=xqkr2Nly9T4lcOe55p9qCh0O/PxhbNBRyPTty+6stdQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=kbD68SwZyjU1WQA6ne9dzMdDVuDcIKuCrc4GDrmyUEMN1pOMTKksLit3TNsHJKyZQG6 tNczEaPyuowagGStbfaq9iZ8+hubxp+dtfm2D0+idV6+bmc9yJKJnR4JczTkSRP1y7Lrs 8IaSqKxjJHr0RrmJPOmYBo0XhM4Ba5m+raQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The QemuDetected() function wraps QemuFwCfgIsAvailable(); it always fails on Xen. Because of that, we can eliminate the QemuDetected() call itself from the Xen ACPI platform driver, and then the rest of "Qemu.c" becomes useless -- the workhorse function of that source file is QemuInstallAcpiTable(), which we no longer call. Remove any dependencies that are no longer needed by the XenAcpiPlatformDxe driver. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf | 9 - OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h | 14 - OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c | 9 +- OvmfPkg/XenAcpiPlatformDxe/Qemu.c | 511 ------------------= -- 4 files changed, 1 insertion(+), 542 deletions(-) diff --git a/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf b/OvmfPkg/Xe= nAcpiPlatformDxe/XenAcpiPlatformDxe.inf index 72132e397dc1..ca8e7e55f788 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf +++ b/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf @@ -22,29 +22,23 @@ [Defines] # =20 [Sources] AcpiPlatform.c AcpiPlatform.h EntryPoint.c - Qemu.c Xen.c =20 [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec - UefiCpuPkg/UefiCpuPkg.dec =20 [LibraryClasses] BaseLib - BaseMemoryLib DebugLib - DxeServicesTableLib - MemoryAllocationLib PcdLib - QemuFwCfgLib UefiBootServicesTableLib UefiDriverEntryPoint XenPlatformLib =20 [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED @@ -53,12 +47,9 @@ [Protocols] [Guids] gRootBridgesConnectedEventGroupGuid =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration - gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress - gUefiOvmfPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel - gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress =20 [Depex] gEfiAcpiTableProtocolGuid diff --git a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/XenAcpiPla= tformDxe/AcpiPlatform.h index d35143a00d01..2959ff0be6cf 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h @@ -18,26 +18,12 @@ InstallAcpiTable ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, IN VOID *AcpiTableBuffer, IN UINTN AcpiTableBufferSize, OUT UINTN *TableKey ); =20 -BOOLEAN -QemuDetected ( - VOID - ); - -EFI_STATUS -EFIAPI -QemuInstallAcpiTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ); - EFI_STATUS EFIAPI InstallXenTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol ); =20 diff --git a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/XenAcpiPla= tformDxe/AcpiPlatform.c index 9c8b1e0fcffa..66dcf885859e 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c @@ -152,24 +152,17 @@ InstallOvmfFvTables ( INTN Instance; EFI_ACPI_COMMON_HEADER *CurrentTable; UINTN TableHandle; UINT32 FvStatus; UINTN TableSize; UINTN Size; - EFI_ACPI_TABLE_INSTALL_ACPI_TABLE TableInstallFunction; =20 Instance =3D 0; CurrentTable =3D NULL; TableHandle =3D 0; =20 - if (QemuDetected ()) { - TableInstallFunction =3D QemuInstallAcpiTable; - } else { - TableInstallFunction =3D InstallAcpiTable; - } - // // set FwVol (and use an ASSERT() below) to suppress incorrect // compiler/analyzer warnings // FwVol =3D NULL; // @@ -204,13 +197,13 @@ InstallOvmfFvTables ( TableSize =3D ((EFI_ACPI_DESCRIPTION_HEADER *) CurrentTable)->Length; ASSERT (Size >=3D TableSize); =20 // // Install ACPI table // - Status =3D TableInstallFunction ( + Status =3D InstallAcpiTable ( AcpiTable, CurrentTable, TableSize, &TableHandle ); =20 diff --git a/OvmfPkg/XenAcpiPlatformDxe/Qemu.c b/OvmfPkg/XenAcpiPlatformDxe= /Qemu.c deleted file mode 100644 index b4a407c41b71..000000000000 --- a/OvmfPkg/XenAcpiPlatformDxe/Qemu.c +++ /dev/null @@ -1,511 +0,0 @@ -/** @file - OVMF ACPI QEMU support - - Copyright (C) 2012-2021, Red Hat, Inc. - Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include // EFI_ACPI_1_0_IO_APIC_STRUCTURE -#include // CopyMem() -#include // DEBUG() -#include // gDS -#include // AllocatePool() -#include // PcdGet16() -#include // QemuFwCfgIsAvailable() - -#include "AcpiPlatform.h" - -BOOLEAN -QemuDetected ( - VOID - ) -{ - if (!QemuFwCfgIsAvailable ()) { - return FALSE; - } - - return TRUE; -} - - -STATIC -UINTN -CountBits16 ( - UINT16 Mask - ) -{ - // - // For all N >=3D 1, N bits are enough to represent the number of bits s= et - // among N bits. It's true for N =3D=3D 1. When adding a new bit (N :=3D= N+1), - // the maximum number of possibly set bits increases by one, while the - // representable maximum doubles. - // - Mask =3D ((Mask & 0xAAAA) >> 1) + (Mask & 0x5555); - Mask =3D ((Mask & 0xCCCC) >> 2) + (Mask & 0x3333); - Mask =3D ((Mask & 0xF0F0) >> 4) + (Mask & 0x0F0F); - Mask =3D ((Mask & 0xFF00) >> 8) + (Mask & 0x00FF); - - return Mask; -} - - -STATIC -EFI_STATUS -EFIAPI -QemuInstallAcpiMadtTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ) -{ - UINTN CpuCount; - UINTN PciLinkIsoCount; - UINTN NewBufferSize; - EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt; - EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE *LocalApic; - EFI_ACPI_1_0_IO_APIC_STRUCTURE *IoApic; - EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE *Iso; - EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE *LocalApicNmi; - VOID *Ptr; - UINTN Loop; - EFI_STATUS Status; - - ASSERT (AcpiTableBufferSize >=3D sizeof (EFI_ACPI_DESCRIPTION_HEADER)); - - QemuFwCfgSelectItem (QemuFwCfgItemSmpCpuCount); - CpuCount =3D QemuFwCfgRead16 (); - ASSERT (CpuCount >=3D 1); - - // - // Set Level-tiggered, Active High for these identity mapped IRQs. The b= itset - // corresponds to the union of all possible interrupt assignments for th= e LNKA, - // LNKB, LNKC, LNKD PCI interrupt lines. See the DSDT. - // - PciLinkIsoCount =3D CountBits16 (PcdGet16 (Pcd8259LegacyModeEdgeLevel)); - - NewBufferSize =3D 1 * sizeof (*Madt) + - CpuCount * sizeof (*LocalApic) + - 1 * sizeof (*IoApic) + - (1 + PciLinkIsoCount) * sizeof (*Iso) + - 1 * sizeof (*LocalApicNmi); - - Madt =3D AllocatePool (NewBufferSize); - if (Madt =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } - - CopyMem (&(Madt->Header), AcpiTableBuffer, sizeof (EFI_ACPI_DESCRIPTION_= HEADER)); - Madt->Header.Length =3D (UINT32) NewBufferSize; - Madt->LocalApicAddress =3D PcdGet32 (PcdCpuLocalApicBaseAddress); - Madt->Flags =3D EFI_ACPI_1_0_PCAT_COMPAT; - Ptr =3D Madt + 1; - - LocalApic =3D Ptr; - for (Loop =3D 0; Loop < CpuCount; ++Loop) { - LocalApic->Type =3D EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC; - LocalApic->Length =3D sizeof (*LocalApic); - LocalApic->AcpiProcessorId =3D (UINT8) Loop; - LocalApic->ApicId =3D (UINT8) Loop; - LocalApic->Flags =3D 1; // enabled - ++LocalApic; - } - Ptr =3D LocalApic; - - IoApic =3D Ptr; - IoApic->Type =3D EFI_ACPI_1_0_IO_APIC; - IoApic->Length =3D sizeof (*IoApic); - IoApic->IoApicId =3D (UINT8) CpuCount; - IoApic->Reserved =3D EFI_ACPI_RESERVED_BYTE; - IoApic->IoApicAddress =3D 0xFEC00000; - IoApic->SystemVectorBase =3D 0x00000000; - Ptr =3D IoApic + 1; - - // - // IRQ0 (8254 Timer) =3D> IRQ2 (PIC) Interrupt Source Override Structure - // - Iso =3D Ptr; - Iso->Type =3D EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERR= IDE; - Iso->Length =3D sizeof (*Iso); - Iso->Bus =3D 0x00; // ISA - Iso->Source =3D 0x00; // IRQ0 - Iso->GlobalSystemInterruptVector =3D 0x00000002; - Iso->Flags =3D 0x0000; // Conforms to specs of the= bus - ++Iso; - - // - // Set Level-triggered, Active High for all possible PCI link targets. - // - for (Loop =3D 0; Loop < 16; ++Loop) { - if ((PcdGet16 (Pcd8259LegacyModeEdgeLevel) & (1 << Loop)) =3D=3D 0) { - continue; - } - Iso->Type =3D EFI_ACPI_1_0_INTERRUPT_SOURCE_OVE= RRIDE; - Iso->Length =3D sizeof (*Iso); - Iso->Bus =3D 0x00; // ISA - Iso->Source =3D (UINT8) Loop; - Iso->GlobalSystemInterruptVector =3D (UINT32) Loop; - Iso->Flags =3D 0x000D; // Level-triggered, Activ= e High - ++Iso; - } - ASSERT ( - (UINTN) (Iso - (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE *)Ptr= ) =3D=3D - 1 + PciLinkIsoCount - ); - Ptr =3D Iso; - - LocalApicNmi =3D Ptr; - LocalApicNmi->Type =3D EFI_ACPI_1_0_LOCAL_APIC_NMI; - LocalApicNmi->Length =3D sizeof (*LocalApicNmi); - LocalApicNmi->AcpiProcessorId =3D 0xFF; // applies to all processors - // - // polarity and trigger mode of the APIC I/O input signals conform to the - // specifications of the bus - // - LocalApicNmi->Flags =3D 0x0000; - // - // Local APIC interrupt input LINTn to which NMI is connected. - // - LocalApicNmi->LocalApicInti =3D 0x01; - Ptr =3D LocalApicNmi + 1; - - ASSERT ((UINTN) ((UINT8 *)Ptr - (UINT8 *)Madt) =3D=3D NewBufferSize); - Status =3D InstallAcpiTable (AcpiProtocol, Madt, NewBufferSize, TableKey= ); - - FreePool (Madt); - - return Status; -} - - -#pragma pack(1) - -typedef struct { - UINT64 Base; - UINT64 End; - UINT64 Length; -} PCI_WINDOW; - -typedef struct { - PCI_WINDOW PciWindow32; - PCI_WINDOW PciWindow64; -} FIRMWARE_DATA; - -typedef struct { - UINT8 BytePrefix; - UINT8 ByteValue; -} AML_BYTE; - -typedef struct { - UINT8 NameOp; - UINT8 RootChar; - UINT8 NameChar[4]; - UINT8 PackageOp; - UINT8 PkgLength; - UINT8 NumElements; - AML_BYTE Pm1aCntSlpTyp; - AML_BYTE Pm1bCntSlpTyp; - AML_BYTE Reserved[2]; -} SYSTEM_STATE_PACKAGE; - -#pragma pack() - - -STATIC -EFI_STATUS -EFIAPI -PopulateFwData( - OUT FIRMWARE_DATA *FwData - ) -{ - EFI_STATUS Status; - UINTN NumDesc; - EFI_GCD_MEMORY_SPACE_DESCRIPTOR *AllDesc; - - Status =3D gDS->GetMemorySpaceMap (&NumDesc, &AllDesc); - if (Status =3D=3D EFI_SUCCESS) { - UINT64 NonMmio32MaxExclTop; - UINT64 Mmio32MinBase; - UINT64 Mmio32MaxExclTop; - UINTN CurDesc; - - Status =3D EFI_UNSUPPORTED; - - NonMmio32MaxExclTop =3D 0; - Mmio32MinBase =3D BASE_4GB; - Mmio32MaxExclTop =3D 0; - - for (CurDesc =3D 0; CurDesc < NumDesc; ++CurDesc) { - CONST EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Desc; - UINT64 ExclTop; - - Desc =3D &AllDesc[CurDesc]; - ExclTop =3D Desc->BaseAddress + Desc->Length; - - if (ExclTop <=3D (UINT64) PcdGet32 (PcdOvmfFdBaseAddress)) { - switch (Desc->GcdMemoryType) { - case EfiGcdMemoryTypeNonExistent: - break; - - case EfiGcdMemoryTypeReserved: - case EfiGcdMemoryTypeSystemMemory: - if (NonMmio32MaxExclTop < ExclTop) { - NonMmio32MaxExclTop =3D ExclTop; - } - break; - - case EfiGcdMemoryTypeMemoryMappedIo: - if (Mmio32MinBase > Desc->BaseAddress) { - Mmio32MinBase =3D Desc->BaseAddress; - } - if (Mmio32MaxExclTop < ExclTop) { - Mmio32MaxExclTop =3D ExclTop; - } - break; - - default: - ASSERT(0); - } - } - } - - if (Mmio32MinBase < NonMmio32MaxExclTop) { - Mmio32MinBase =3D NonMmio32MaxExclTop; - } - - if (Mmio32MinBase < Mmio32MaxExclTop) { - FwData->PciWindow32.Base =3D Mmio32MinBase; - FwData->PciWindow32.End =3D Mmio32MaxExclTop - 1; - FwData->PciWindow32.Length =3D Mmio32MaxExclTop - Mmio32MinBase; - - FwData->PciWindow64.Base =3D 0; - FwData->PciWindow64.End =3D 0; - FwData->PciWindow64.Length =3D 0; - - Status =3D EFI_SUCCESS; - } - - FreePool (AllDesc); - } - - DEBUG (( - DEBUG_INFO, - "ACPI PciWindow32: Base=3D0x%08lx End=3D0x%08lx Length=3D0x%08lx\n", - FwData->PciWindow32.Base, - FwData->PciWindow32.End, - FwData->PciWindow32.Length - )); - DEBUG (( - DEBUG_INFO, - "ACPI PciWindow64: Base=3D0x%08lx End=3D0x%08lx Length=3D0x%08lx\n", - FwData->PciWindow64.Base, - FwData->PciWindow64.End, - FwData->PciWindow64.Length - )); - - return Status; -} - - -STATIC -VOID -EFIAPI -GetSuspendStates ( - UINTN *SuspendToRamSize, - SYSTEM_STATE_PACKAGE *SuspendToRam, - UINTN *SuspendToDiskSize, - SYSTEM_STATE_PACKAGE *SuspendToDisk - ) -{ - STATIC CONST SYSTEM_STATE_PACKAGE Template =3D { - 0x08, // NameOp - '\\', // RootChar - { '_', 'S', 'x', '_' }, // NameChar[4] - 0x12, // PackageOp - 0x0A, // PkgLength - 0x04, // NumElements - { 0x0A, 0x00 }, // Pm1aCntSlpTyp - { 0x0A, 0x00 }, // Pm1bCntSlpTyp -- we don't support it - { // Reserved[2] - { 0x0A, 0x00 }, - { 0x0A, 0x00 } - } - }; - RETURN_STATUS Status; - FIRMWARE_CONFIG_ITEM FwCfgItem; - UINTN FwCfgSize; - UINT8 SystemStates[6]; - - // - // configure defaults - // - *SuspendToRamSize =3D sizeof Template; - CopyMem (SuspendToRam, &Template, sizeof Template); - SuspendToRam->NameChar[2] =3D '3'; // S3 - SuspendToRam->Pm1aCntSlpTyp.ByteValue =3D 1; // PIIX4: STR - - *SuspendToDiskSize =3D sizeof Template; - CopyMem (SuspendToDisk, &Template, sizeof Template); - SuspendToDisk->NameChar[2] =3D '4'; // S4 - SuspendToDisk->Pm1aCntSlpTyp.ByteValue =3D 2; // PIIX4: POSCL - - // - // check for overrides - // - Status =3D QemuFwCfgFindFile ("etc/system-states", &FwCfgItem, &FwCfgSiz= e); - if (Status !=3D RETURN_SUCCESS || FwCfgSize !=3D sizeof SystemStates) { - DEBUG ((DEBUG_INFO, "ACPI using S3/S4 defaults\n")); - return; - } - QemuFwCfgSelectItem (FwCfgItem); - QemuFwCfgReadBytes (sizeof SystemStates, SystemStates); - - // - // Each byte corresponds to a system state. In each byte, the MSB tells = us - // whether the given state is enabled. If so, the three LSBs specify the - // value to be written to the PM control register's SUS_TYP bits. - // - if (SystemStates[3] & BIT7) { - SuspendToRam->Pm1aCntSlpTyp.ByteValue =3D - SystemStates[3] & (BIT2 | BIT1 | BIT0); - DEBUG ((DEBUG_INFO, "ACPI S3 value: %d\n", - SuspendToRam->Pm1aCntSlpTyp.ByteValue)); - } else { - *SuspendToRamSize =3D 0; - DEBUG ((DEBUG_INFO, "ACPI S3 disabled\n")); - } - - if (SystemStates[4] & BIT7) { - SuspendToDisk->Pm1aCntSlpTyp.ByteValue =3D - SystemStates[4] & (BIT2 | BIT1 | BIT0); - DEBUG ((DEBUG_INFO, "ACPI S4 value: %d\n", - SuspendToDisk->Pm1aCntSlpTyp.ByteValue)); - } else { - *SuspendToDiskSize =3D 0; - DEBUG ((DEBUG_INFO, "ACPI S4 disabled\n")); - } -} - - -STATIC -EFI_STATUS -EFIAPI -QemuInstallAcpiSsdtTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ) -{ - EFI_STATUS Status; - FIRMWARE_DATA *FwData; - - Status =3D EFI_OUT_OF_RESOURCES; - - FwData =3D AllocateReservedPool (sizeof (*FwData)); - if (FwData !=3D NULL) { - UINTN SuspendToRamSize; - SYSTEM_STATE_PACKAGE SuspendToRam; - UINTN SuspendToDiskSize; - SYSTEM_STATE_PACKAGE SuspendToDisk; - UINTN SsdtSize; - UINT8 *Ssdt; - - GetSuspendStates (&SuspendToRamSize, &SuspendToRam, - &SuspendToDiskSize, &SuspendToDisk); - SsdtSize =3D AcpiTableBufferSize + 17 + SuspendToRamSize + SuspendToDi= skSize; - Ssdt =3D AllocatePool (SsdtSize); - - if (Ssdt !=3D NULL) { - Status =3D PopulateFwData (FwData); - - if (Status =3D=3D EFI_SUCCESS) { - UINT8 *SsdtPtr; - - SsdtPtr =3D Ssdt; - - CopyMem (SsdtPtr, AcpiTableBuffer, AcpiTableBufferSize); - SsdtPtr +=3D AcpiTableBufferSize; - - // - // build "OperationRegion(FWDT, SystemMemory, 0x12345678, 0x876543= 21)" - // - *(SsdtPtr++) =3D 0x5B; // ExtOpPrefix - *(SsdtPtr++) =3D 0x80; // OpRegionOp - *(SsdtPtr++) =3D 'F'; - *(SsdtPtr++) =3D 'W'; - *(SsdtPtr++) =3D 'D'; - *(SsdtPtr++) =3D 'T'; - *(SsdtPtr++) =3D 0x00; // SystemMemory - *(SsdtPtr++) =3D 0x0C; // DWordPrefix - - // - // no virtual addressing yet, take the four least significant bytes - // - CopyMem(SsdtPtr, &FwData, 4); - SsdtPtr +=3D 4; - - *(SsdtPtr++) =3D 0x0C; // DWordPrefix - - *(UINT32*) SsdtPtr =3D sizeof (*FwData); - SsdtPtr +=3D 4; - - // - // add suspend system states - // - CopyMem (SsdtPtr, &SuspendToRam, SuspendToRamSize); - SsdtPtr +=3D SuspendToRamSize; - CopyMem (SsdtPtr, &SuspendToDisk, SuspendToDiskSize); - SsdtPtr +=3D SuspendToDiskSize; - - ASSERT((UINTN) (SsdtPtr - Ssdt) =3D=3D SsdtSize); - ((EFI_ACPI_DESCRIPTION_HEADER *) Ssdt)->Length =3D (UINT32) SsdtSi= ze; - Status =3D InstallAcpiTable (AcpiProtocol, Ssdt, SsdtSize, TableKe= y); - } - - FreePool(Ssdt); - } - - if (Status !=3D EFI_SUCCESS) { - FreePool(FwData); - } - } - - return Status; -} - - -EFI_STATUS -EFIAPI -QemuInstallAcpiTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ) -{ - EFI_ACPI_DESCRIPTION_HEADER *Hdr; - EFI_ACPI_TABLE_INSTALL_ACPI_TABLE TableInstallFunction; - - Hdr =3D (EFI_ACPI_DESCRIPTION_HEADER*) AcpiTableBuffer; - switch (Hdr->Signature) { - case EFI_ACPI_1_0_APIC_SIGNATURE: - TableInstallFunction =3D QemuInstallAcpiMadtTable; - break; - case EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE: - TableInstallFunction =3D QemuInstallAcpiSsdtTable; - break; - default: - TableInstallFunction =3D InstallAcpiTable; - } - - return TableInstallFunction ( - AcpiProtocol, - AcpiTableBuffer, - AcpiTableBufferSize, - TableKey - ); -} --=20 2.19.1.3.g30247aa5d201 -=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 (#75683): https://edk2.groups.io/g/devel/message/75683 Mute This Topic: https://groups.io/mt/83110563/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75684+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75684+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061043; cv=none; d=zohomail.com; s=zohoarc; b=I5jfqOgmSmVdc7F90AuwP1EzZI8BcD97WSSra1Uxteez8hLM5zKXBUL1A/2D+mkW0AnPkMOvi5DrelwnAnY58r/CZewZRfCf4DJ4o3piiKSgnWglhLWxN6Q24w3dyh6jOn3eQ1uxbmar0xdRPyvIEuz6nacBwE2Qr7WeDYv60iM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061043; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=+VCXEJ88wrJXNq8TXC2EEu7z070G3T5+DRQOB8TuTGk=; b=DGdejgKSVpq8Uu+oSykFqG7HolDCWO7iBIpuZ/9P8HlKfpD88+vPfc28vUXAhv7isI5Eaq5iP1nlHewC3MWUntJYbBkc7ZSVpiPdrPPzmrVLnqZalNI2faXNkFCs/nu3nDBMy+t6YnYlI6sDm8kv/2ak3aEJyxHNWDH7U1EnS3U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75684+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206104390877.801833337983; Wed, 26 May 2021 13:30:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id G44AYY1788612x8Soy8BqTTe; Wed, 26 May 2021 13:30:43 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web08.3050.1622061042971740250 for ; Wed, 26 May 2021 13:30:43 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-452-zH8feTDHMRmSJfc-GNh--A-1; Wed, 26 May 2021 16:30:38 -0400 X-MC-Unique: zH8feTDHMRmSJfc-GNh--A-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF306803631; Wed, 26 May 2021 20:30:37 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 398932BFF7; Wed, 26 May 2021 20:30:36 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 15/43] OvmfPkg/XenAcpiPlatformDxe: remove the InstallAcpiTable() helper function Date: Wed, 26 May 2021 22:14:18 +0200 Message-Id: <20210526201446.12554-16-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: Pv4raafIwKEmZU8ECki84ZX2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061043; bh=+VCXEJ88wrJXNq8TXC2EEu7z070G3T5+DRQOB8TuTGk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=wyN6bnILBvyIXVBUVqLnDntfktfvxdhgrGLPBsZ8N6v1uDL8N/dRDUKlymOU31ZAdtY gD3k42cviDaWNSMtLwWEKfEVhIYoaI+Mk19F2AZ1eWYSJgkYAZwgCd1xZlb2Bku+78Vdp Nzqg49ffVnDQhCdRfjacDS3v/SyNc3MRQHQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The InstallAcpiTable() helper function buys us nothing. Reduce code complexity by removing the function. This patch is best viewed with "git show -b". Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h | 9 --- OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c | 30 ++-------- OvmfPkg/XenAcpiPlatformDxe/Xen.c | 60 ++++++++++---------- 3 files changed, 36 insertions(+), 63 deletions(-) diff --git a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/XenAcpiPla= tformDxe/AcpiPlatform.h index 2959ff0be6cf..47d9769ed12b 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h @@ -9,21 +9,12 @@ =20 #ifndef ACPI_PLATFORM_H_ #define ACPI_PLATFORM_H_ =20 #include // EFI_ACPI_TABLE_PROTOCOL =20 -EFI_STATUS -EFIAPI -InstallAcpiTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ); - EFI_STATUS EFIAPI InstallXenTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol ); =20 diff --git a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/XenAcpiPla= tformDxe/AcpiPlatform.c index 66dcf885859e..daf2bf3f458a 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c @@ -11,30 +11,12 @@ #include // gBS #include // XenDetected() #include // gEfiFirmwareVolume2Protoc= ol... =20 #include "AcpiPlatform.h" =20 -EFI_STATUS -EFIAPI -InstallAcpiTable ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, - IN VOID *AcpiTableBuffer, - IN UINTN AcpiTableBufferSize, - OUT UINTN *TableKey - ) -{ - return AcpiProtocol->InstallAcpiTable ( - AcpiProtocol, - AcpiTableBuffer, - AcpiTableBufferSize, - TableKey - ); -} - - /** Locate the first instance of a protocol. If the protocol requested is an FV protocol, then it will return the first FV that contains the ACPI tab= le storage file. =20 @param Instance Return pointer to the first instance of the protoc= ol @@ -197,18 +179,18 @@ InstallOvmfFvTables ( TableSize =3D ((EFI_ACPI_DESCRIPTION_HEADER *) CurrentTable)->Length; ASSERT (Size >=3D TableSize); =20 // // Install ACPI table // - Status =3D InstallAcpiTable ( - AcpiTable, - CurrentTable, - TableSize, - &TableHandle - ); + Status =3D AcpiTable->InstallAcpiTable ( + AcpiTable, + CurrentTable, + TableSize, + &TableHandle + ); =20 // // Free memory allocated by ReadSection // gBS->FreePool (CurrentTable); =20 diff --git a/OvmfPkg/XenAcpiPlatformDxe/Xen.c b/OvmfPkg/XenAcpiPlatformDxe/= Xen.c index e8395db548d9..151376176f7d 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/Xen.c +++ b/OvmfPkg/XenAcpiPlatformDxe/Xen.c @@ -182,18 +182,18 @@ InstallXenTables ( CurrentTablePointer =3D (UINTN) *(UINT64 *)CurrentTableEntry; CurrentTable =3D (EFI_ACPI_DESCRIPTION_HEADER *) CurrentTablePointer; =20 // // Install the XSDT tables // - Status =3D InstallAcpiTable ( - AcpiProtocol, - CurrentTable, - CurrentTable->Length, - &TableHandle - ); + Status =3D AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + CurrentTable, + CurrentTable->Length, + &TableHandle + ); =20 if (EFI_ERROR (Status)) { return Status; } =20 // @@ -232,18 +232,18 @@ InstallXenTables ( CurrentTablePointer =3D *(UINT32 *)CurrentTableEntry; CurrentTable =3D (EFI_ACPI_DESCRIPTION_HEADER *) CurrentTablePointer; =20 // // Install the RSDT tables // - Status =3D InstallAcpiTable ( - AcpiProtocol, - CurrentTable, - CurrentTable->Length, - &TableHandle - ); + Status =3D AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + CurrentTable, + CurrentTable->Length, + &TableHandle + ); =20 if (EFI_ERROR (Status)) { return Status; } =20 // @@ -263,32 +263,32 @@ InstallXenTables ( // Install the FACS table. // if (Fadt2Table) { // // FACS 2.0 // - Status =3D InstallAcpiTable ( - AcpiProtocol, - Facs2Table, - Facs2Table->Length, - &TableHandle - ); + Status =3D AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + Facs2Table, + Facs2Table->Length, + &TableHandle + ); if (EFI_ERROR (Status)) { return Status; } } else if (Fadt1Table) { // // FACS 1.0 // - Status =3D InstallAcpiTable ( - AcpiProtocol, - Facs1Table, - Facs1Table->Length, - &TableHandle - ); + Status =3D AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + Facs1Table, + Facs1Table->Length, + &TableHandle + ); if (EFI_ERROR (Status)) { return Status; } } =20 // @@ -298,18 +298,18 @@ InstallXenTables ( if (DsdtTable =3D=3D NULL) { DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __FUNCTION__)); ASSERT (FALSE); CpuDeadLoop (); } =20 - Status =3D InstallAcpiTable ( - AcpiProtocol, - DsdtTable, - DsdtTable->Length, - &TableHandle - ); + Status =3D AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + DsdtTable, + DsdtTable->Length, + &TableHandle + ); if (EFI_ERROR (Status)) { return Status; } =20 return EFI_SUCCESS; } --=20 2.19.1.3.g30247aa5d201 -=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 (#75684): https://edk2.groups.io/g/devel/message/75684 Mute This Topic: https://groups.io/mt/83110592/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75685+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75685+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061106; cv=none; d=zohomail.com; s=zohoarc; b=Jj6oR50vGLI1e0EWJGKAyEZCLlIO/PNdkmsnemWI7EsbIcFAd0ws4GfHuslQXgT32WSO2f5TcJWTykklaclvDvZG5O82C+Dpw4u5wRJF9emiBBNscoowO24+13R/3tmwtz1qq3DfQ163HEG4OGCVuls+rBpPCkKExvLLJsYUmqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061106; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=9VeqVUlQtiVQs6mhelee0dgyDRErkh1oj2HaSWmPfhc=; b=MqKv7vwdk2oEQ1dDAwbrOwYpCEjoazHMfkI4XHsY3DvCqln8zEsEM6dULyQuIqSmZO8b2H+6WaqFyMHufulrJjw1w9fJqUPWa7rHRb8SItTaW0oEZwbWuuZIkbuMBLyf4GESPvAV7J8OBUi4T9XbkezWQG7nIVxCLusJRLttJhk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75685+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206110631475.76896311942812; Wed, 26 May 2021 13:31:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id LEV2YY1788612xKUEZEdpSSC; Wed, 26 May 2021 13:31:45 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web08.3063.1622061104486997142 for ; Wed, 26 May 2021 13:31:44 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-133-3S7N_2RdPsGl5QlrfiDu2g-1; Wed, 26 May 2021 16:31:41 -0400 X-MC-Unique: 3S7N_2RdPsGl5QlrfiDu2g-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8AF93107ACE3; Wed, 26 May 2021 20:31:40 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6E006EF41; Wed, 26 May 2021 20:31:38 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 16/43] OvmfPkg/XenAcpiPlatformDxe: remove OVMF's built-in ACPI tables Date: Wed, 26 May 2021 22:14:19 +0200 Message-Id: <20210526201446.12554-17-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: rUXoWXd7d32lNEpgVCbfoGHDx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061105; bh=9VeqVUlQtiVQs6mhelee0dgyDRErkh1oj2HaSWmPfhc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=l4Ui2OhqGRgRaCDsg+JchJjvBxcuRPwSoxbgfVFBGd8DI4obCHjybxZ47ejqvVzMlOv v6YXifqtZwo1Cencq5c2zv1F1LZ1D9VoqjLqZpJpeK74j+pHIoF/7oN5Vjeo6vKL3w44r 5qR+e9loV+X4N6IaR53AGHvnszLz5kZZERs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Xen is an advanced hypervisor; no Xen guest can function correctly without the hypervisor's dynamically provided ACPI tables. Remove the built-in (fallback) tables from XenAcpiPlatformDxe -- and the OvmfXen platform. Remove any dependencies from XenAcpiPlatformDxe that are no longer needed. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/OvmfXen.dsc | 1 - OvmfPkg/OvmfXen.fdf | 7 - OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf | 2 - OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c | 202 ------------------= -- 4 files changed, 212 deletions(-) diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 4d5171cd43c1..bcf64242d05c 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -650,13 +650,12 @@ [Components] =20 # # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf - OvmfPkg/AcpiTables/AcpiTables.inf MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf =20 # # Network Support diff --git a/OvmfPkg/OvmfXen.fdf b/OvmfPkg/OvmfXen.fdf index 85306245b50f..8daa000de46a 100644 --- a/OvmfPkg/OvmfXen.fdf +++ b/OvmfPkg/OvmfXen.fdf @@ -350,13 +350,12 @@ [FV.DXEFV] =20 INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf INF OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf -INF RuleOverride=3DACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf =20 INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf @@ -521,18 +520,12 @@ [Rule.Common.UEFI_APPLICATION.BINARY] FILE APPLICATION =3D $(NAMED_GUID) { PE32 PE32 |.efi UI STRING=3D"$(MODULE_NAME)" Optional VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) } =20 -[Rule.Common.USER_DEFINED.ACPITABLE] - FILE FREEFORM =3D $(NAMED_GUID) { - RAW ACPI |.acpi - RAW ASL |.aml - } - [Rule.Common.USER_DEFINED.CSM] FILE FREEFORM =3D $(NAMED_GUID) { RAW BIN |.bin } =20 [Rule.Common.SEC.RESET_VECTOR] diff --git a/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf b/OvmfPkg/Xe= nAcpiPlatformDxe/XenAcpiPlatformDxe.inf index ca8e7e55f788..db9b6e093de4 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf +++ b/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf @@ -39,17 +39,15 @@ [LibraryClasses] UefiBootServicesTableLib UefiDriverEntryPoint XenPlatformLib =20 [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED - gEfiFirmwareVolume2ProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED =20 [Guids] gRootBridgesConnectedEventGroupGuid =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration =20 [Depex] gEfiAcpiTableProtocolGuid diff --git a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/XenAcpiPla= tformDxe/AcpiPlatform.c index daf2bf3f458a..60576f3cc6d6 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.c @@ -4,214 +4,16 @@ Copyright (C) 2021, Red Hat, Inc. Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#include // ASSERT_EFI_ERROR() -#include // gBS #include // XenDetected() -#include // gEfiFirmwareVolume2Protoc= ol... =20 #include "AcpiPlatform.h" =20 -/** - Locate the first instance of a protocol. If the protocol requested is an - FV protocol, then it will return the first FV that contains the ACPI tab= le - storage file. - - @param Instance Return pointer to the first instance of the protoc= ol - - @return EFI_SUCCESS The function completed successfully. - @return EFI_NOT_FOUND The protocol could not be located. - @return EFI_OUT_OF_RESOURCES There are not enough resources to find the= protocol. - -**/ -EFI_STATUS -LocateFvInstanceWithTables ( - OUT EFI_FIRMWARE_VOLUME2_PROTOCOL **Instance - ) -{ - EFI_STATUS Status; - EFI_HANDLE *HandleBuffer; - UINTN NumberOfHandles; - EFI_FV_FILETYPE FileType; - UINT32 FvStatus; - EFI_FV_FILE_ATTRIBUTES Attributes; - UINTN Size; - UINTN Index; - EFI_FIRMWARE_VOLUME2_PROTOCOL *FvInstance; - - FvStatus =3D 0; - - // - // Locate protocol. - // - Status =3D gBS->LocateHandleBuffer ( - ByProtocol, - &gEfiFirmwareVolume2ProtocolGuid, - NULL, - &NumberOfHandles, - &HandleBuffer - ); - if (EFI_ERROR (Status)) { - // - // Defined errors at this time are not found and out of resources. - // - return Status; - } - - // - // Looking for FV with ACPI storage file - // - for (Index =3D 0; Index < NumberOfHandles; Index++) { - // - // Get the protocol on this handle - // This should not fail because of LocateHandleBuffer - // - Status =3D gBS->HandleProtocol ( - HandleBuffer[Index], - &gEfiFirmwareVolume2ProtocolGuid, - (VOID**) &FvInstance - ); - ASSERT_EFI_ERROR (Status); - - // - // See if it has the ACPI storage file - // - Status =3D FvInstance->ReadFile ( - FvInstance, - (EFI_GUID*)PcdGetPtr (PcdAcpiTableStorageFile), - NULL, - &Size, - &FileType, - &Attributes, - &FvStatus - ); - - // - // If we found it, then we are done - // - if (Status =3D=3D EFI_SUCCESS) { - *Instance =3D FvInstance; - break; - } - } - - // - // Our exit status is determined by the success of the previous operatio= ns - // If the protocol was found, Instance already points to it. - // - - // - // Free any allocated buffers - // - gBS->FreePool (HandleBuffer); - - return Status; -} - - -/** - Find ACPI tables in an FV and install them. - - This is now a fall-back path. Normally, we will search for tables provid= ed - by the VMM first. - - If that fails, we use this function to load the ACPI tables from an FV. = The - sources for the FV based tables is located under OvmfPkg/AcpiTables. - - @param AcpiTable Protocol instance pointer - -**/ -EFI_STATUS -EFIAPI -InstallOvmfFvTables ( - IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable - ) -{ - EFI_STATUS Status; - EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol; - INTN Instance; - EFI_ACPI_COMMON_HEADER *CurrentTable; - UINTN TableHandle; - UINT32 FvStatus; - UINTN TableSize; - UINTN Size; - - Instance =3D 0; - CurrentTable =3D NULL; - TableHandle =3D 0; - - // - // set FwVol (and use an ASSERT() below) to suppress incorrect - // compiler/analyzer warnings - // - FwVol =3D NULL; - // - // Locate the firmware volume protocol - // - Status =3D LocateFvInstanceWithTables (&FwVol); - if (EFI_ERROR (Status)) { - return EFI_ABORTED; - } - ASSERT (FwVol !=3D NULL); - - // - // Read tables from the storage file. - // - while (Status =3D=3D EFI_SUCCESS) { - - Status =3D FwVol->ReadSection ( - FwVol, - (EFI_GUID*)PcdGetPtr (PcdAcpiTableStorageFile), - EFI_SECTION_RAW, - Instance, - (VOID**) &CurrentTable, - &Size, - &FvStatus - ); - if (!EFI_ERROR (Status)) { - // - // Add the table - // - TableHandle =3D 0; - - TableSize =3D ((EFI_ACPI_DESCRIPTION_HEADER *) CurrentTable)->Length; - ASSERT (Size >=3D TableSize); - - // - // Install ACPI table - // - Status =3D AcpiTable->InstallAcpiTable ( - AcpiTable, - CurrentTable, - TableSize, - &TableHandle - ); - - // - // Free memory allocated by ReadSection - // - gBS->FreePool (CurrentTable); - - if (EFI_ERROR (Status)) { - return EFI_ABORTED; - } - - // - // Increment the instance - // - Instance++; - CurrentTable =3D NULL; - } - } - - return EFI_SUCCESS; -} - /** Effective entrypoint of Acpi Platform driver. =20 @param ImageHandle @param SystemTable =20 @@ -231,13 +33,9 @@ InstallAcpiTables ( if (XenDetected ()) { Status =3D InstallXenTables (AcpiTable); } else { Status =3D EFI_UNSUPPORTED; } =20 - if (EFI_ERROR (Status)) { - Status =3D InstallOvmfFvTables (AcpiTable); - } - return Status; } =20 --=20 2.19.1.3.g30247aa5d201 -=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 (#75685): https://edk2.groups.io/g/devel/message/75685 Mute This Topic: https://groups.io/mt/83110615/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75686+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75686+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061176; cv=none; d=zohomail.com; s=zohoarc; b=SnRvtObAD8H4tYQs1dkD+nlUdGKpJdL/iDbk0atCx7eOIrsUdxOuTxH/41K6LIdoYLNP80gDY6+CxpAduT6rmjKoCa6GMn2u8pdi31Iu4myPC33PvDcemn7KqyrqrXNpWY6IQZDfJG3BJV5VPF1mrLqOpjFYkf5hXYjcTBqdh4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061176; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=pUxoFrh18T2+MWds8JK8TnzWG1mKbUL1ioNPdaeTzIE=; b=amzJLCyKhBjrr8vPLTZSigu+e/WqkTCKxXcN25xAqO7pG7FeQ/LbGcBcc+LcLs/woif3LR/KbZU4bri/R0aO12nSE9AuONo0NMATfhbmtNy3EYp6q7p15zN3VXHWCttD5jbAjCheuAtLaEFVLXuz3+UgZd2kfuYFLfDKPtK3gHk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75686+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622061176796923.8538580172267; Wed, 26 May 2021 13:32:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id C9oLYY1788612xS4TILsKUDN; Wed, 26 May 2021 13:32:55 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web09.3114.1622061169853768516 for ; Wed, 26 May 2021 13:32:50 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-575-SW5o5ZWEPNypGBKp01v3LA-1; Wed, 26 May 2021 16:32:44 -0400 X-MC-Unique: SW5o5ZWEPNypGBKp01v3LA-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2DD8F802B78; Wed, 26 May 2021 20:32:43 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id B860B18AA1; Wed, 26 May 2021 20:32:41 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , Peter Grehan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rebecca Cran Subject: [edk2-devel] [PATCH 17/43] OvmfPkg/Bhyve/AcpiPlatformDxe: fix file path typo in comment Date: Wed, 26 May 2021 22:14:20 +0200 Message-Id: <20210526201446.12554-18-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: xKDR6OdKX2vqMGVxtS13yljZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061175; bh=pUxoFrh18T2+MWds8JK8TnzWG1mKbUL1ioNPdaeTzIE=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=JP/D1VXJghuxq5+67IjfG5DHLwyQSupaD9euEynVZavGn5XsDlGQ7U8/hRif+9RS8Qt c+72ZhpBJu1mOjL2j+8t/LHOD/12T3NeBEYu9ZbTGEFFyF+W71A84usBH+nMWzkebXls2 uphJQDqw+uyWzTaLMV2llFeo/gh4Zkia4pk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The built-in ACPI tables for Bhyve are located in the "OvmfPkg/Bhyve/AcpiTables" module, not in the "OvmfPkg/AcpiTables" module. Correct the typo in a code comment. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Peter Grehan Cc: Philippe Mathieu-Daud=C3=A9 Cc: Rebecca Cran Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude Reviewed-by: Rebecca Cran --- OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/Bhyve/A= cpiPlatformDxe/AcpiPlatform.c index d5c78c61d5ad..9ccdb4d91cd1 100644 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c @@ -129,13 +129,13 @@ LocateFvInstanceWithTables ( Find ACPI tables in an FV and install them. =20 This is now a fall-back path. Normally, we will search for tables provid= ed by the VMM first. =20 If that fails, we use this function to load the ACPI tables from an FV. = The - sources for the FV based tables is located under OvmfPkg/AcpiTables. + sources for the FV based tables is located under OvmfPkg/Bhyve/AcpiTable= s. =20 @param AcpiTable Protocol instance pointer =20 **/ EFI_STATUS EFIAPI --=20 2.19.1.3.g30247aa5d201 -=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 (#75686): https://edk2.groups.io/g/devel/message/75686 Mute This Topic: https://groups.io/mt/83110639/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75687+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75687+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061236; cv=none; d=zohomail.com; s=zohoarc; b=bVLfe5WxCFZmnrMmivRyEXUwPf3ISppGGFHaZku7mhf01Tc4a2EIKCdv3BYWYcj8WTLasG6Hl/j9WaadeM5u9FNBnyURbo4Vnj7eh1WEoE25tOGFU409UyNBbQPA6d3C6RSoVuVOyxAn/muOYYC30t6eGIV8gmsjS18NC3QHbYw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061236; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=E1yeIqzluYWRKxIeC8xra3poPJ0IPLedY5J6b1JWsx4=; b=T6x5WBUuEul9B8sZWo6/x5ixgiYGaB4ATk2mOwc4Y3W5ebAZcfn9EmcKQZBeR3Aw0VgnDfHe4Wh60xgvE6+VHEp9FnsKjTkeKMbBy/HTpONlgNcJZoThZMXsxWvcqWQm01K11LV2cxzmEBjRU8s3k/J71eX3GEAmrEq5f7pFoSk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75687+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622061236916266.2991491908366; Wed, 26 May 2021 13:33:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id NjufYY1788612xl7abrUgt8m; Wed, 26 May 2021 13:33:56 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.3031.1622061230026631691 for ; Wed, 26 May 2021 13:33:50 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-566-mKnWPm8ZPyqFr-qh3nh1QA-1; Wed, 26 May 2021 16:33:47 -0400 X-MC-Unique: mKnWPm8ZPyqFr-qh3nh1QA-1 X-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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 360B3802690; Wed, 26 May 2021 20:33:46 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BB6616935; Wed, 26 May 2021 20:33:44 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 18/43] OvmfPkg/AcpiTables: remove unused module Date: Wed, 26 May 2021 22:14:21 +0200 Message-Id: <20210526201446.12554-19-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: rS19jfgGSUEo253QlUQQylNFx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061236; bh=E1yeIqzluYWRKxIeC8xra3poPJ0IPLedY5J6b1JWsx4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=b7bQlHtEOYLsGSRASv6zqAjECdW3a+k/e7c4XUdR5FTi9nBCPn6mCayeAsaJ1z18UDv /rBwRHorad0aHUuwcyuMM5ee61O5Eb/ht0BHldufzUHyNsCtSUl+lTb3aa/U8y5OU8N6P ELl5rl/H4UhuoJrMy9QGBA3PVfjwWfEeBfU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The "OvmfPkg/AcpiTables/AcpiTables.inf" module is no longer used by any module in edk2; remove it. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/AcpiTables/AcpiTables.inf | 38 -- OvmfPkg/AcpiTables/Platform.h | 68 -- OvmfPkg/AcpiTables/Dsdt.asl | 692 -------------------- OvmfPkg/AcpiTables/Facp.aslc | 89 --- OvmfPkg/AcpiTables/Facs.aslc | 78 --- OvmfPkg/AcpiTables/Madt.aslc | 153 ----- OvmfPkg/AcpiTables/Ssdt.asl | 13 - 7 files changed, 1131 deletions(-) diff --git a/OvmfPkg/AcpiTables/AcpiTables.inf b/OvmfPkg/AcpiTables/AcpiTab= les.inf deleted file mode 100644 index b7d8d774281b..000000000000 --- a/OvmfPkg/AcpiTables/AcpiTables.inf +++ /dev/null @@ -1,38 +0,0 @@ -## @file -# Component description file for PlatformAcpiTables module. -# -# ACPI table data and ASL sources required to boot the platform. -# -# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D PlatformAcpiTables - FILE_GUID =3D 7E374E25-8E01-4FEE-87F2-390C23C606CD - MODULE_TYPE =3D USER_DEFINED - VERSION_STRING =3D 1.0 - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 EBC -# - -[Sources] - Platform.h - Madt.aslc - Facp.aslc - Facs.aslc - Dsdt.asl - Ssdt.asl - -[Packages] - MdePkg/MdePkg.dec - OvmfPkg/OvmfPkg.dec - -[Pcd] - gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort - diff --git a/OvmfPkg/AcpiTables/Platform.h b/OvmfPkg/AcpiTables/Platform.h deleted file mode 100644 index e4ee848961c6..000000000000 --- a/OvmfPkg/AcpiTables/Platform.h +++ /dev/null @@ -1,68 +0,0 @@ -/** @file - Platform specific defines for constructing ACPI tables - - Copyright (c) 2012, 2013, Red Hat, Inc. - Copyright (c) 2008, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef _Platform_h_INCLUDED_ -#define _Platform_h_INCLUDED_ - -#include -#include - -// -// ACPI table information used to initialize tables. -// -#define EFI_ACPI_OEM_ID 'O','V','M','F',' ',' ' // OEMID 6 byt= es long -#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('O','V','M','F','E','D','K'= ,'2') // OEM table id 8 bytes long -#define EFI_ACPI_OEM_REVISION 0x20130221 -#define EFI_ACPI_CREATOR_ID SIGNATURE_32('O','V','M','F') -#define EFI_ACPI_CREATOR_REVISION 0x00000099 - -#define SCI_INT_VECTOR 0x0009 -#define SMI_CMD_IO_PORT 0xB2 -#define ACPI_ENABLE 0xF1 -#define ACPI_DISABLE 0xF0 -#define S4BIOS_REQ 0x00 -#define PM1a_EVT_BLK 0x0000b000 -#define PM1a_CNT_BLK 0x0000b004 -#define PM_TMR_BLK 0x0000b008 -#define GPE0_BLK 0x0000afe0 -#define PM1_EVT_LEN 0x04 -#define PM1_CNT_LEN 0x02 -#define PM_TM_LEN 0x04 -#define GPE0_BLK_LEN 0x04 -#define RESERVED 0x00 -#define P_LVL2_LAT 0x0065 -#define P_LVL3_LAT 0x03E9 -#define FLUSH_SIZE 0x0000 -#define FLUSH_STRIDE 0x0000 -#define DUTY_OFFSET 0x00 -#define DUTY_WIDTH 0x00 -#define DAY_ALRM 0x00 -#define MON_ALRM 0x00 -#define CENTURY 0x00 -#define FLAG (EFI_ACPI_2_0_WBINVD | \ - EFI_ACPI_2_0_PROC_C1 | \ - EFI_ACPI_2_0_SLP_BUTTON | \ - EFI_ACPI_2_0_RTC_S4 | \ - EFI_ACPI_2_0_RESET_REG_SUP) -#define RESET_REG 0xCF9 -#define RESET_VALUE (BIT2 | BIT1) // PIIX3 Reset CPU + System Reset - -// -// Byte-aligned IO port register block initializer for -// EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE -// -#define GAS2_IO(Base, Size) { \ - EFI_ACPI_2_0_SYSTEM_IO, /* AddressSpaceId */ \ - (Size) * 8, /* RegisterBitWidth */ \ - 0, /* RegisterBitOffset */ \ - 0, /* Reserved */ \ - (Base) /* Address */ \ - } - -#endif diff --git a/OvmfPkg/AcpiTables/Dsdt.asl b/OvmfPkg/AcpiTables/Dsdt.asl deleted file mode 100644 index 7550fb46b628..000000000000 --- a/OvmfPkg/AcpiTables/Dsdt.asl +++ /dev/null @@ -1,692 +0,0 @@ -/** @file - Contains root level name space objects for the platform - - Copyright (c) 2008, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 4) { - // - // System Sleep States - // - // We build S3 and S4 with GetSuspendStates() in - // "OvmfPkg/AcpiPlatformDxe/Qemu.c". - // - Name (\_S0, Package () {5, 0, 0, 0}) // Working - Name (\_S5, Package () {0, 0, 0, 0}) // Soft Off - - // - // System Bus - // - Scope (\_SB) { - // - // PCI Root Bridge - // - Device (PCI0) { - Name (_HID, EISAID ("PNP0A03")) - Name (_ADR, 0x00000000) - Name (_BBN, 0x00) - Name (_UID, 0x00) - - // - // BUS, I/O, and MMIO resources - // - Name (CRES, ResourceTemplate () { - WORDBusNumber ( // Bus number resource (0); the bridge pr= oduces bus numbers for its subsequent buses - ResourceProducer, // bit 0 of general flags is 1 - MinFixed, // Range is fixed - MaxFixed, // Range is fixed - PosDecode, // PosDecode - 0x0000, // Granularity - 0x0000, // Min - 0x00FF, // Max - 0x0000, // Translation - 0x0100 // Range Length =3D Max-Min+1 - ) - - IO (Decode16, 0xCF8, 0xCF8, 0x01, 0x08) //Consumed resource = (0xCF8-0xCFF) - - WORDIO ( // Consumed-and-produced resource (all I/= O below CF8) - ResourceProducer, // bit 0 of general flags is 0 - MinFixed, // Range is fixed - MaxFixed, // Range is fixed - PosDecode, - EntireRange, - 0x0000, // Granularity - 0x0000, // Min - 0x0CF7, // Max - 0x0000, // Translation - 0x0CF8 // Range Length - ) - - WORDIO ( // Consumed-and-produced resource (all I/= O above CFF) - ResourceProducer, // bit 0 of general flags is 0 - MinFixed, // Range is fixed - MaxFixed, // Range is fixed - PosDecode, - EntireRange, - 0x0000, // Granularity - 0x0D00, // Min - 0xFFFF, // Max - 0x0000, // Translation - 0xF300 // Range Length - ) - - DWORDMEMORY ( // Descriptor for legacy VGA video RAM - ResourceProducer, // bit 0 of general flags is 0 - PosDecode, - MinFixed, // Range is fixed - MaxFixed, // Range is Fixed - Cacheable, - ReadWrite, - 0x00000000, // Granularity - 0x000A0000, // Min - 0x000BFFFF, // Max - 0x00000000, // Translation - 0x00020000 // Range Length - ) - - DWORDMEMORY ( // Descriptor for 32-bit MMIO - ResourceProducer, // bit 0 of general flags is 0 - PosDecode, - MinFixed, // Range is fixed - MaxFixed, // Range is Fixed - NonCacheable, - ReadWrite, - 0x00000000, // Granularity - 0xF8000000, // Min - 0xFFFBFFFF, // Max - 0x00000000, // Translation - 0x07FC0000, // Range Length - , // ResourceSourceIndex - , // ResourceSource - PW32 // DescriptorName - ) - }) - - Name (CR64, ResourceTemplate () { - QWordMemory ( // Descriptor for 64-bit MMIO - ResourceProducer, // bit 0 of general flags is 0 - PosDecode, - MinFixed, // Range is fixed - MaxFixed, // Range is Fixed - Cacheable, - ReadWrite, - 0x00000000, // Granularity - 0x8000000000, // Min - 0xFFFFFFFFFF, // Max - 0x00000000, // Translation - 0x8000000000, // Range Length - , // ResourceSourceIndex - , // ResourceSource - PW64 // DescriptorName - ) - }) - - Method (_CRS, 0, Serialized) { - // - // see the FIRMWARE_DATA structure in "OvmfPkg/AcpiPlatformDxe/Qem= u.c" - // - External (FWDT, OpRegionObj) - Field(FWDT, QWordAcc, NoLock, Preserve) { - P0S, 64, // PciWindow32.Base - P0E, 64, // PciWindow32.End - P0L, 64, // PciWindow32.Length - P1S, 64, // PciWindow64.Base - P1E, 64, // PciWindow64.End - P1L, 64 // PciWindow64.Length - } - Field(FWDT, DWordAcc, NoLock, Preserve) { - P0SL, 32, // PciWindow32.Base, low 32 bits - P0SH, 32, // PciWindow32.Base, high 32 bits - P0EL, 32, // PciWindow32.End, low 32 bits - P0EH, 32, // PciWindow32.End, high 32 bits - P0LL, 32, // PciWindow32.Length, low 32 bits - P0LH, 32, // PciWindow32.Length, high 32 bits - P1SL, 32, // PciWindow64.Base, low 32 bits - P1SH, 32, // PciWindow64.Base, high 32 bits - P1EL, 32, // PciWindow64.End, low 32 bits - P1EH, 32, // PciWindow64.End, high 32 bits - P1LL, 32, // PciWindow64.Length, low 32 bits - P1LH, 32 // PciWindow64.Length, high 32 bits - } - - // - // fixup 32-bit PCI IO window - // - CreateDWordField (CRES, \_SB.PCI0.PW32._MIN, PS32) - CreateDWordField (CRES, \_SB.PCI0.PW32._MAX, PE32) - CreateDWordField (CRES, \_SB.PCI0.PW32._LEN, PL32) - Store (P0SL, PS32) - Store (P0EL, PE32) - Store (P0LL, PL32) - - If (LAnd (LEqual (P1SL, 0x00), LEqual (P1SH, 0x00))) { - Return (CRES) - } Else { - // - // fixup 64-bit PCI IO window - // - CreateQWordField (CR64, \_SB.PCI0.PW64._MIN, PS64) - CreateQWordField (CR64, \_SB.PCI0.PW64._MAX, PE64) - CreateQWordField (CR64, \_SB.PCI0.PW64._LEN, PL64) - Store (P1S, PS64) - Store (P1E, PE64) - Store (P1L, PL64) - - // - // add window and return result - // - ConcatenateResTemplate (CRES, CR64, Local0) - Return (Local0) - } - } - - // - // PCI Interrupt Routing Table - PIC Mode Only - // - Method (_PRT, 0, NotSerialized) { - Return ( - Package () { - // - // Bus 0; Devices 0 to 15 - // - Package () {0x0000FFFF, 0x00, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x0000FFFF, 0x01, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x0000FFFF, 0x02, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x0000FFFF, 0x03, \_SB.PCI0.LPC.LNKC, 0x00}, - - // - // Bus 0, Device 1, Pin 0 (INTA) is special; it corresponds to= the - // internally generated SCI (System Control Interrupt), which = is - // always routed to GSI 9. By setting the third (=3D Source) f= ield to - // zero, we could use the fourth (=3D Source Index) field to h= ardwire - // the pin to GSI 9 directly. - // - // That way however, in accordance with the ACPI spec's descri= ption - // of SCI, the interrupt would be treated as "active low, - // shareable, level", and that doesn't match qemu. - // - // In QemuInstallAcpiMadtTable() [OvmfPkg/AcpiPlatformDxe/Qemu= .c] - // we install an Interrupt Override Structure for the identity - // mapped IRQ#9 / GSI 9 (the corresponding bit being set in - // Pcd8259LegacyModeEdgeLevel), which describes the correct - // polarity (active high). As a consequence, some OS'en (eg. L= inux) - // override the default (active low) polarity originating from= the - // _PRT; others (eg. FreeBSD) don't. Therefore we need a separ= ate - // link device just to specify a polarity that matches the MAD= T. - // - Package () {0x0001FFFF, 0x00, \_SB.PCI0.LPC.LNKS, 0x00}, - - Package () {0x0001FFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x0001FFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x0001FFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00}, - - Package () {0x0002FFFF, 0x00, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x0002FFFF, 0x01, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x0002FFFF, 0x02, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x0002FFFF, 0x03, \_SB.PCI0.LPC.LNKA, 0x00}, - - Package () {0x0003FFFF, 0x00, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x0003FFFF, 0x01, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x0003FFFF, 0x02, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x0003FFFF, 0x03, \_SB.PCI0.LPC.LNKB, 0x00}, - - Package () {0x0004FFFF, 0x00, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x0004FFFF, 0x01, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x0004FFFF, 0x02, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x0004FFFF, 0x03, \_SB.PCI0.LPC.LNKC, 0x00}, - - Package () {0x0005FFFF, 0x00, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x0005FFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x0005FFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x0005FFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00}, - - Package () {0x0006FFFF, 0x00, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x0006FFFF, 0x01, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x0006FFFF, 0x02, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x0006FFFF, 0x03, \_SB.PCI0.LPC.LNKA, 0x00}, - - Package () {0x0007FFFF, 0x00, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x0007FFFF, 0x01, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x0007FFFF, 0x02, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x0007FFFF, 0x03, \_SB.PCI0.LPC.LNKB, 0x00}, - - Package () {0x0008FFFF, 0x00, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x0008FFFF, 0x01, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x0008FFFF, 0x02, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x0008FFFF, 0x03, \_SB.PCI0.LPC.LNKC, 0x00}, - - Package () {0x0009FFFF, 0x00, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x0009FFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x0009FFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x0009FFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00}, - - Package () {0x000AFFFF, 0x00, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x000AFFFF, 0x01, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x000AFFFF, 0x02, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x000AFFFF, 0x03, \_SB.PCI0.LPC.LNKA, 0x00}, - - Package () {0x000BFFFF, 0x00, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x000BFFFF, 0x01, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x000BFFFF, 0x02, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x000BFFFF, 0x03, \_SB.PCI0.LPC.LNKB, 0x00}, - - Package () {0x000CFFFF, 0x00, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x000CFFFF, 0x01, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x000CFFFF, 0x02, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x000CFFFF, 0x03, \_SB.PCI0.LPC.LNKC, 0x00}, - - Package () {0x000DFFFF, 0x00, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x000DFFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x000DFFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x000DFFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00}, - - Package () {0x000EFFFF, 0x00, \_SB.PCI0.LPC.LNKB, 0x00}, - Package () {0x000EFFFF, 0x01, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x000EFFFF, 0x02, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x000EFFFF, 0x03, \_SB.PCI0.LPC.LNKA, 0x00}, - - Package () {0x000FFFFF, 0x00, \_SB.PCI0.LPC.LNKC, 0x00}, - Package () {0x000FFFFF, 0x01, \_SB.PCI0.LPC.LNKD, 0x00}, - Package () {0x000FFFFF, 0x02, \_SB.PCI0.LPC.LNKA, 0x00}, - Package () {0x000FFFFF, 0x03, \_SB.PCI0.LPC.LNKB, 0x00} - } - ) - } - - // - // PCI to ISA Bridge (Bus 0, Device 1, Function 0) - // "Low Pin Count" - // - Device (LPC) { - Name (_ADR, 0x00010000) - - // - // The SCI cannot be rerouted or disabled with PIRQRC[A:D]; we only - // need this link device in order to specify the polarity. - // - Device (LNKS) { - Name (_HID, EISAID("PNP0C0F")) - Name (_UID, 0) - - Name (_STA, 0xB) // 0x1: device present - // 0x2: enabled and decoding resources - // 0x8: functioning properly - - Method (_SRS, 1, NotSerialized) { /* no-op */ } - Method (_DIS, 0, NotSerialized) { /* no-op */ } - - Name (_PRS, ResourceTemplate () { - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 9 } - // - // list of IRQs occupied thus far: 9 - // - }) - Method (_CRS, 0, NotSerialized) { Return (_PRS) } - } - - // - // PCI Interrupt Routing Configuration Registers, PIRQRC[A:D] - // - OperationRegion (PRR0, PCI_Config, 0x60, 0x04) - Field (PRR0, ANYACC, NOLOCK, PRESERVE) { - PIRA, 8, - PIRB, 8, - PIRC, 8, - PIRD, 8 - } - - // - // _STA method for LNKA, LNKB, LNKC, LNKD - // Arg0[in]: value of PIRA / PIRB / PIRC / PIRD - // - Method (PSTA, 1, NotSerialized) { - If (And (Arg0, 0x80)) { // disable-bit set? - Return (0x9) // "device present" | "functioning prope= rly" - } Else { - Return (0xB) // same | "enabled and decoding resource= s" - } - } - - // - // _CRS method for LNKA, LNKB, LNKC, LNKD - // Arg0[in]: value of PIRA / PIRB / PIRC / PIRD - // - Method (PCRS, 1, Serialized) { - // - // create temporary buffer with an Extended Interrupt Descriptor - // whose single vector defaults to zero - // - Name (BUF0, ResourceTemplate () { - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared){0} - } - ) - - // - // define reference to first interrupt vector in buffer - // - CreateDWordField (BUF0, 0x05, IRQW) - - // - // If the disable-bit is clear, overwrite the default zero vector - // with the value in Arg0 (ie. PIRQRC[A:D]). Reserved bits are r= ead - // as 0. - // - If (LNot (And (Arg0, 0x80))) { - Store (Arg0, IRQW) - } - Return (BUF0) - } - - // - // _PRS resource for LNKA, LNKB, LNKC, LNKD - // - Name (PPRS, ResourceTemplate () { - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) {5, 10, = 11} - // - // list of IRQs occupied thus far: 9, 5, 10, 11 - // - }) - - // - // PCI IRQ Link A - // - Device (LNKA) { - Name (_HID, EISAID("PNP0C0F")) - Name (_UID, 1) - - Method (_STA, 0, NotSerialized) { Return (PSTA (PIRA)) } - Method (_DIS, 0, NotSerialized) { - Or (PIRA, 0x80, PIRA) // set disable-bit - } - Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRA)) } - Method (_PRS, 0, NotSerialized) { Return (PPRS) } - Method (_SRS, 1, NotSerialized) { - CreateDWordField (Arg0, 0x05, IRQW) - Store (IRQW, PIRA) - } - } - - // - // PCI IRQ Link B - // - Device (LNKB) { - Name (_HID, EISAID("PNP0C0F")) - Name (_UID, 2) - - Method (_STA, 0, NotSerialized) { Return (PSTA (PIRB)) } - Method (_DIS, 0, NotSerialized) { - Or (PIRB, 0x80, PIRB) // set disable-bit - } - Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRB)) } - Method (_PRS, 0, NotSerialized) { Return (PPRS) } - Method (_SRS, 1, NotSerialized) { - CreateDWordField (Arg0, 0x05, IRQW) - Store (IRQW, PIRB) - } - } - - // - // PCI IRQ Link C - // - Device (LNKC) { - Name (_HID, EISAID("PNP0C0F")) - Name (_UID, 3) - - Method (_STA, 0, NotSerialized) { Return (PSTA (PIRC)) } - Method (_DIS, 0, NotSerialized) { - Or (PIRC, 0x80, PIRC) // set disable-bit - } - Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRC)) } - Method (_PRS, 0, NotSerialized) { Return (PPRS) } - Method (_SRS, 1, NotSerialized) { - CreateDWordField (Arg0, 0x05, IRQW) - Store (IRQW, PIRC) - } - } - - // - // PCI IRQ Link D - // - Device (LNKD) { - Name (_HID, EISAID("PNP0C0F")) - Name (_UID, 4) - - Method (_STA, 0, NotSerialized) { Return (PSTA (PIRD)) } - Method (_DIS, 0, NotSerialized) { - Or (PIRD, 0x80, PIRD) // set disable-bit - } - Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRD)) } - Method (_PRS, 0, NotSerialized) { Return (PPRS) } - Method (_SRS, 1, NotSerialized) { - CreateDWordField (Arg0, 0x05, IRQW) - Store (IRQW, PIRD) - } - } - - // - // Programmable Interrupt Controller (PIC) - // - Device(PIC) { - Name (_HID, EISAID ("PNP0000")) - Name (_CRS, ResourceTemplate () { - IO (Decode16, 0x020, 0x020, 0x00, 0x02) - IO (Decode16, 0x0A0, 0x0A0, 0x00, 0x02) - IO (Decode16, 0x4D0, 0x4D0, 0x00, 0x02) - IRQNoFlags () {2} - // - // list of IRQs occupied thus far: 9, 5, 10, 11, 2 - // - }) - } - - // - // ISA DMA - // - Device (DMAC) { - Name (_HID, EISAID ("PNP0200")) - Name (_CRS, ResourceTemplate () { - IO (Decode16, 0x00, 0x00, 0, 0x10) - IO (Decode16, 0x81, 0x81, 0, 0x03) - IO (Decode16, 0x87, 0x87, 0, 0x01) - IO (Decode16, 0x89, 0x89, 0, 0x03) - IO (Decode16, 0x8f, 0x8f, 0, 0x01) - IO (Decode16, 0xc0, 0xc0, 0, 0x20) - DMA (Compatibility, NotBusMaster, Transfer8) {4} - }) - } - - // - // 8254 Timer - // - Device(TMR) { - Name(_HID,EISAID("PNP0100")) - Name(_CRS, ResourceTemplate () { - IO (Decode16, 0x40, 0x40, 0x00, 0x04) - IRQNoFlags () {0} - // - // list of IRQs occupied thus far: 9, 5, 10, 11, 2, 0 - // - }) - } - - // - // Real Time Clock - // - Device (RTC) { - Name (_HID, EISAID ("PNP0B00")) - Name (_CRS, ResourceTemplate () { - IO (Decode16, 0x70, 0x70, 0x00, 0x02) - IRQNoFlags () {8} - // - // list of IRQs occupied thus far: 9, 5, 10, 11, 2, 0, 8 - // - }) - } - - // - // PCAT Speaker - // - Device(SPKR) { - Name (_HID, EISAID("PNP0800")) - Name (_CRS, ResourceTemplate () { - IO (Decode16, 0x61, 0x61, 0x01, 0x01) - }) - } - - // - // Floating Point Coprocessor - // - Device(FPU) { - Name (_HID, EISAID("PNP0C04")) - Name (_CRS, ResourceTemplate () { - IO (Decode16, 0xF0, 0xF0, 0x00, 0x10) - IRQNoFlags () {13} - // - // list of IRQs occupied thus far: 9, 5, 10, 11, 2, 0, 8, 13 - // - }) - } - - // - // Generic motherboard devices and pieces that don't fit anywhere = else - // - Device(XTRA) { - Name (_HID, EISAID ("PNP0C02")) - Name (_UID, 0x01) - Name (_CRS, ResourceTemplate () { - IO (Decode16, 0x010, 0x010, 0x00, 0x10) - IO (Decode16, 0x022, 0x022, 0x00, 0x1E) - IO (Decode16, 0x044, 0x044, 0x00, 0x1C) - IO (Decode16, 0x062, 0x062, 0x00, 0x02) - IO (Decode16, 0x065, 0x065, 0x00, 0x0B) - IO (Decode16, 0x072, 0x072, 0x00, 0x0E) - IO (Decode16, 0x080, 0x080, 0x00, 0x01) - IO (Decode16, 0x084, 0x084, 0x00, 0x03) - IO (Decode16, 0x088, 0x088, 0x00, 0x01) - IO (Decode16, 0x08c, 0x08c, 0x00, 0x03) - IO (Decode16, 0x090, 0x090, 0x00, 0x10) - IO (Decode16, 0x0A2, 0x0A2, 0x00, 0x1E) - IO (Decode16, 0x0E0, 0x0E0, 0x00, 0x10) - IO (Decode16, 0x1E0, 0x1E0, 0x00, 0x10) - IO (Decode16, 0x160, 0x160, 0x00, 0x10) - IO (Decode16, 0x278, 0x278, 0x00, 0x08) - IO (Decode16, 0x370, 0x370, 0x00, 0x02) - IO (Decode16, 0x378, 0x378, 0x00, 0x08) - IO (Decode16, FixedPcdGet16 (PcdDebugIoPort), FixedPcdGet16 (P= cdDebugIoPort), 0x00, 0x01) - IO (Decode16, 0x440, 0x440, 0x00, 0x10) - IO (Decode16, 0x678, 0x678, 0x00, 0x08) - IO (Decode16, 0x778, 0x778, 0x00, 0x08) - IO (Decode16, 0xafe0, 0xafe0, 0x00, 0x04) // QEMU GPE0 BLK - IO (Decode16, 0xb000, 0xb000, 0x00, 0x40) // PMBLK1 - Memory32Fixed (ReadOnly, 0xFEC00000, 0x1000) // IO APIC - Memory32Fixed (ReadOnly, 0xFEE00000, 0x100000) // LAPIC - }) - } - - // - // PS/2 Keyboard and PC/AT Enhanced Keyboard 101/102 - // - Device (PS2K) { - Name (_HID, EISAID ("PNP0303")) - Name (_CID, EISAID ("PNP030B")) - Name(_CRS,ResourceTemplate() { - IO (Decode16, 0x60, 0x60, 0x00, 0x01) - IO (Decode16, 0x64, 0x64, 0x00, 0x01) - IRQNoFlags () {1} - // - // list of IRQs occupied thus far: 9, 5, 10, 11, 2, 0, 8, 13, 1 - // - }) - } - - // - // PS/2 Mouse and Microsoft Mouse - // - Device (PS2M) { // PS/2 stype mouse port - Name (_HID, EISAID ("PNP0F03")) - Name (_CID, EISAID ("PNP0F13")) - Name (_CRS, ResourceTemplate() { - IRQNoFlags () {12} - // - // list of IRQs occupied thus far: - // 9, 5, 10, 11, 2, 0, 8, 13, 1, 12 - // - }) - } - - // - // UART Serial Port - COM1 - // - Device (UAR1) { - Name (_HID, EISAID ("PNP0501")) - Name (_DDN, "COM1") - Name (_UID, 0x01) - Name(_CRS,ResourceTemplate() { - IO (Decode16, 0x3F8, 0x3F8, 0x01, 0x08) - IRQ (Edge, ActiveHigh, Exclusive, ) {4} - // - // list of IRQs occupied thus far: - // 9, 5, 10, 11, 2, 0, 8, 13, 1, 12, 4 - // - }) - } - - // - // UART Serial Port - COM2 - // - Device (UAR2) { - Name (_HID, EISAID ("PNP0501")) - Name (_DDN, "COM2") - Name (_UID, 0x02) - Name(_CRS,ResourceTemplate() { - IO (Decode16, 0x2F8, 0x2F8, 0x01, 0x08) - IRQ (Edge, ActiveHigh, Exclusive, ) {3} - // - // list of IRQs occupied thus far: - // 9, 5, 10, 11, 2, 0, 8, 13, 1, 12, 4, 3 - // - }) - } - - // - // Floppy Disk Controller - // - Device (FDC) { - Name (_HID, EISAID ("PNP0700")) - Name (_CRS,ResourceTemplate() { - IO (Decode16, 0x3F0, 0x3F0, 0x01, 0x06) - IO (Decode16, 0x3F7, 0x3F7, 0x01, 0x01) - IRQNoFlags () {6} - // - // list of IRQs occupied thus far: - // 9, 5, 10, 11, 2, 0, 8, 13, 1, 12, 4, 3, 6 - // - DMA (Compatibility, NotBusMaster, Transfer8) {2} - }) - } - - // - // parallel port -- no DMA for now - // - Device (PAR1) { - Name (_HID, EISAID ("PNP0400")) - Name (_DDN, "LPT1") - Name (_UID, 0x01) - Name(_CRS, ResourceTemplate() { - IO (Decode16, 0x0378, 0x0378, 0x00, 0x08) - IRQNoFlags () {7} - // - // list of IRQs occupied thus far: - // 9, 5, 10, 11, 2, 0, 8, 13, 1, 12, 4, 3, 6, 7 - // in order: - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 - // - }) - } - } - } - } -} diff --git a/OvmfPkg/AcpiTables/Facp.aslc b/OvmfPkg/AcpiTables/Facp.aslc deleted file mode 100644 index 657a8c645821..000000000000 --- a/OvmfPkg/AcpiTables/Facp.aslc +++ /dev/null @@ -1,89 +0,0 @@ -/** @file - FACP Table - - Copyright (c) 2013, Red Hat, Inc. - Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "Platform.h" - -EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE FACP =3D { - { - EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, - sizeof (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE), - EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, - 0, // to make sum of entire table =3D=3D 0 - {EFI_ACPI_OEM_ID}, // OEMID is a 6 bytes long field - EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long) - EFI_ACPI_OEM_REVISION, // OEM revision number - EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID - EFI_ACPI_CREATOR_REVISION // ASL compiler revision number - }, - 0, // Physical address of FACS - 0, // Physical address of DSDT - RESERVED, // System Interrupt Model in ACPI 1.0, eliminated in 2= .0 - EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED, // Preferred PM profile - SCI_INT_VECTOR, // System vector of SCI interrupt - SMI_CMD_IO_PORT, // Port address of SMI command port - ACPI_ENABLE, // value to write to port smi_cmd to enable ACPI - ACPI_DISABLE, // value to write to port smi_cmd to disable ACPI - S4BIOS_REQ, // Value to write to SMI CMD port to enter the S4BIOS = state - 0, // PState control - PM1a_EVT_BLK, // Port address of Power Mgt 1a Event Reg Blk - 0, // Power Mgt 1b Event Reg Blk unsupported - PM1a_CNT_BLK, // Port address of Power Mgt 1a Ctrl Reg Blk - 0, // Power Mgt 1b Ctrl Reg Blk unsupported - 0, // Power Mgt 2 Ctrl Reg Blk unsupported - PM_TMR_BLK, // Port address of Power Mgt Timer Ctrl Reg Blk - GPE0_BLK, // Port addr of General Purpose Event 0 Reg Blk - 0, // General Purpose Event 1 Reg Blk unsupported - PM1_EVT_LEN, // Byte Length of ports at pm1X_evt_blk - PM1_CNT_LEN, // Byte Length of ports at pm1X_cnt_blk - 0, // Power Mgt 2 Ctrl Reg Blk unsupported - PM_TM_LEN, // Byte Length of ports at pm_tm_blk - GPE0_BLK_LEN, // Byte Length of ports at gpe0_blk - 0, // General Purpose Event 1 Reg Blk unsupported - 0, // General Purpose Event 1 Reg Blk unsupported - 0, // _CST support - P_LVL2_LAT, // worst case HW latency to enter/exit C2 state - P_LVL3_LAT, // worst case HW latency to enter/exit C3 state - FLUSH_SIZE, // Size of area read to flush caches - FLUSH_STRIDE, // Stride used in flushing caches - DUTY_OFFSET, // bit location of duty cycle field in p_cnt reg - DUTY_WIDTH, // bit width of duty cycle field in p_cnt reg - DAY_ALRM, // index to day-of-month alarm in RTC CMOS RAM - MON_ALRM, // index to month-of-year alarm in RTC CMOS RAM - CENTURY, // index to century in RTC CMOS RAM - 0x0000, // Boot architecture flag (16-bit) - RESERVED, // reserved - FLAG, // Fixed feature flags - GAS2_IO(RESET_REG, 1), // Extended address of the Reset Register - RESET_VALUE, // Value for the Reset Register to reset the syst= em - { RESERVED }, // reserved[3] - 0, // 64-bit physical address of FACS, set at installation - 0, // 64-bit physical address of DSDT, set at installation - - GAS2_IO(PM1a_EVT_BLK, PM1_EVT_LEN), // Ext. addr. of PM 1a Event Reg Blk - { 0 }, // PM 1b Event Reg Blk unsupported - GAS2_IO(PM1a_CNT_BLK, PM1_CNT_LEN), // Ext. addr. of PM 1a Ctrl Reg Blk - { 0 }, // PM 1b Ctrl Reg Blk unsupported - { 0 }, // PM 2 Ctrl Reg Blk unsupported - GAS2_IO(PM_TMR_BLK, PM_TM_LEN), // Ext. addr. of PM Timer Ctrl Reg B= lk - GAS2_IO(GPE0_BLK, GPE0_BLK_LEN), // Ext. addr. of GPE 0 Reg Blk - { 0 } // GPE 1 Reg Blk unsupported -}; - - -VOID* -ReferenceAcpiTable ( - VOID - ) -{ - // - // Reference the table being generated to prevent the optimizer from rem= oving the - // data structure from the executable - // - return (VOID*)&FACP; -} diff --git a/OvmfPkg/AcpiTables/Facs.aslc b/OvmfPkg/AcpiTables/Facs.aslc deleted file mode 100644 index d4e6ac4b6bad..000000000000 --- a/OvmfPkg/AcpiTables/Facs.aslc +++ /dev/null @@ -1,78 +0,0 @@ -/** @file - FACS Table - - Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include - -EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE FACS =3D { - EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE, - sizeof (EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE), - - // - // Hardware Signature will be updated at runtime - // - 0x00000000, - 0x00, - 0x00, - 0x00, - { - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE, - EFI_ACPI_RESERVED_BYTE - } -}; - - -VOID* -ReferenceAcpiTable ( - VOID - ) -{ - // - // Reference the table being generated to prevent the optimizer from rem= oving the - // data structure from the executable - // - return (VOID*)&FACS; -} - diff --git a/OvmfPkg/AcpiTables/Madt.aslc b/OvmfPkg/AcpiTables/Madt.aslc deleted file mode 100644 index 02fc3649a0d0..000000000000 --- a/OvmfPkg/AcpiTables/Madt.aslc +++ /dev/null @@ -1,153 +0,0 @@ -/** @file - MADT Table - - This file contains a structure definition for the ACPI 1.0 Multiple APIC - Description Table (MADT). - - Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include - -// -// Local APIC address -// -#define EFI_ACPI_LOCAL_APIC_ADDRESS 0xFEE00000 // TBD - -// -// Multiple APIC Flags are defined in AcpiX.0.h -// -#define EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS (EFI_ACPI_1_0_PCAT_COMPAT) - -// -// Define the number of each table type. -// This is where the table layout is modified. -// -#define EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT 1 -#define EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT 2 -#define EFI_ACPI_IO_APIC_COUNT 1 - -// -// Ensure proper structure formats -// -#pragma pack (1) - -// -// ACPI 1.0 MADT structure -// -typedef struct { - EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header; - -#if EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT > 0 - EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE LocalApic[EFI_ACPI= _PROCESSOR_LOCAL_APIC_COUNT]; -#endif - -#if EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT > 0 - EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE Iso[EFI_ACPI_INTER= RUPT_SOURCE_OVERRIDE_COUNT]; -#endif - -#if EFI_ACPI_IO_APIC_COUNT > 0 - EFI_ACPI_1_0_IO_APIC_STRUCTURE IoApic[EFI_ACPI_IO= _APIC_COUNT]; -#endif - -} EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE; - -#pragma pack () - -// -// Multiple APIC Description Table -// -EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt =3D { - { - { - EFI_ACPI_1_0_APIC_SIGNATURE, - sizeof (EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE), - EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, - 0x00, // Checksu= m will be updated at runtime - {EFI_ACPI_OEM_ID}, - EFI_ACPI_OEM_TABLE_ID, - EFI_ACPI_OEM_REVISION, - EFI_ACPI_CREATOR_ID, - EFI_ACPI_CREATOR_REVISION - }, - - // - // MADT specific fields - // - EFI_ACPI_LOCAL_APIC_ADDRESS, - EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS, - }, - - // - // Processor Local APIC Structure - // - { - { - EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC, // Type - sizeof (EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length - 0x00, // Process= or ID - 0x00, // Local A= PIC ID - 0x00000001 // Flags -= Enabled by default - } - }, - - // - // Interrupt Source Override Structure - // - - { - { - // - // IRQ0=3D>IRQ2 Interrupt Source Override Structure - // - EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type - sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length - 0x00, // Bus - I= SA - 0x00, // Source = - IRQ0 - 0x00000002, // Global = System Interrupt - IRQ2 - 0x0000 // Flags -= Conforms to specifications of the bus - }, - - { - // - // ISO (SCI Active High) Interrupt Source Override Structure - // - EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type - sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length - 0x00, // Bus - I= SA - 0x09, // Source = - IRQ0 - 0x00000009, // Global = System Interrupt - IRQ2 - 0x000D // Flags -= Level-tiggered, Active High - } - }, - - // - // IO APIC Structure - // - { - { - EFI_ACPI_1_0_IO_APIC, // Type - sizeof (EFI_ACPI_1_0_IO_APIC_STRUCTURE), // Length - 0x02, // IO APIC= ID - EFI_ACPI_RESERVED_BYTE, // Reserved - 0xFEC00000, // IO APIC= Address (physical) - 0x00000000 // Global = System Interrupt Base - } - }, -}; - - -VOID* -ReferenceAcpiTable ( - VOID - ) -{ - // - // Reference the table being generated to prevent the optimizer from rem= oving the - // data structure from the executable - // - return (VOID*)&Madt; -} diff --git a/OvmfPkg/AcpiTables/Ssdt.asl b/OvmfPkg/AcpiTables/Ssdt.asl deleted file mode 100644 index 6926e56dafc1..000000000000 --- a/OvmfPkg/AcpiTables/Ssdt.asl +++ /dev/null @@ -1,13 +0,0 @@ -/** @file - Placeholder for runtime-generated objects. - - This empty table provides only a header for dynamic copying and extensio= n, - and a trigger for QemuInstallAcpiSsdtTable(). - - Copyright (C) 2012 Red Hat, Inc. - - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -DefinitionBlock ("Ssdt.aml", "SSDT", 1, "REDHAT", "OVMF ", 1) { -} --=20 2.19.1.3.g30247aa5d201 -=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 (#75687): https://edk2.groups.io/g/devel/message/75687 Mute This Topic: https://groups.io/mt/83110660/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75688+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75688+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061304; cv=none; d=zohomail.com; s=zohoarc; b=TedglKUEqrWbpGeDFpSXBa2ksbOuI2DA0sOxbIxnU9bijVYwCRiBcnXeeBGDuGoKeEDvcNrQ//zIyQYoP5b1tmVQqSlDN00SdchG1Ha5osJVWXWVPpdlSir2lAu9709HACWa41ehRv9QGqHMR/EaiShh7KIMUN9M6vWRqoRTBoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061304; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=PHrphZ206bPLD/7X6aEsAXZxI83T5lIswyWlDWFeBwU=; b=nmDTECLZ69SapMTL20Hra39L9CNX+FIhmUYtHpuzK+NgmdQmL5C8sxd+biAvLvsmZYhoxkGFrdIiIcHKPjKNsdn+7BZeYmAmCb5SmdnESaF1bAB89X+OXTJVr4RHf7gjpWCSiXOitSt/hmutaa4QE8sMGd6VQIGohEz2IOdZmoM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75688+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622061304748749.5943388368461; Wed, 26 May 2021 13:35:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tIm6YY1788612x8cSN9oDX8Q; Wed, 26 May 2021 13:35:04 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.2994.1622061298713610691 for ; Wed, 26 May 2021 13:34:58 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-190-0R-92foWMdeW7ReZk2w5-g-1; Wed, 26 May 2021 16:34:49 -0400 X-MC-Unique: 0R-92foWMdeW7ReZk2w5-g-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C6D978189C6; Wed, 26 May 2021 20:34:48 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5726310074E0; Wed, 26 May 2021 20:34:47 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 19/43] OvmfPkg/OvmfXen: make "PcdPciDisableBusEnumeration" Fixed-at-Build Date: Wed, 26 May 2021 22:14:22 +0200 Message-Id: <20210526201446.12554-20-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: pQyX1rFYFcSDNVrbHwl7EhC0x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061304; bh=PHrphZ206bPLD/7X6aEsAXZxI83T5lIswyWlDWFeBwU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=mR7Na8HB9zVtONsum4E/iU6mvoXeCUOZeshh1eEva3F79c/2O+blmPS0zvZ2fPVkvki KamSHiM7gstDtnQsMGSSC+bBwPCC9phIEVPaf40ajdZqrKcVWbes2WiS2XuQMn022pQdV wDsMf6qSdbb8b6ikSzwsNHlmQrgynxh/aJI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The OvmfXen platform specifies the dynamic access method for "PcdPciDisableBusEnumeration" needlessly. After the DSC file sets the PCD to TRUE by default, the InitializeXen() function in XenPlatformPei superfluously sets the PCD to TRUE again. There are no other writes to the PCD in the platform. Make the PCD Fixed-At-Build, and remove the access (in fact, the whole InitializeXen() function) from XenPlatformPei. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/OvmfXen.dsc | 2 +- OvmfPkg/XenPlatformPei/XenPlatformPei.inf | 1 - OvmfPkg/XenPlatformPei/Platform.h | 5 ----- OvmfPkg/XenPlatformPei/Platform.c | 1 - OvmfPkg/XenPlatformPei/Xen.c | 20 -------------------- 5 files changed, 1 insertion(+), 28 deletions(-) diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index bcf64242d05c..779bcc3f8b9a 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -357,12 +357,13 @@ [PcdsFeatureFlag] gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE !ifdef $(CSM_ENABLE) gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE !endif =20 [PcdsFixedAtBuild] + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FAL= SE gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10 gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|0 !if ($(FD_SIZE_IN_KB) =3D=3D 1024) || ($(FD_SIZE_IN_KB) =3D=3D 2048) gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 @@ -458,13 +459,12 @@ [PcdsFixedAtBuild] =20 [PcdsDynamicDefault] gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable|FALSE gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize|0x0 diff --git a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf b/OvmfPkg/XenPlatfor= mPei/XenPlatformPei.inf index 87dd4b24679a..597cb6fcd7ff 100644 --- a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf +++ b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf @@ -78,13 +78,12 @@ [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask gEfiMdePkgTokenSpaceGuid.PcdFSBClock gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress diff --git a/OvmfPkg/XenPlatformPei/Platform.h b/OvmfPkg/XenPlatformPei/Pla= tform.h index 77d88fc159d7..67887c9c4cd9 100644 --- a/OvmfPkg/XenPlatformPei/Platform.h +++ b/OvmfPkg/XenPlatformPei/Platform.h @@ -88,17 +88,12 @@ InstallClearCacheCallback ( =20 EFI_STATUS XenConnect ( VOID ); =20 -EFI_STATUS -InitializeXen ( - VOID - ); - BOOLEAN XenDetect ( VOID ); =20 BOOLEAN diff --git a/OvmfPkg/XenPlatformPei/Platform.c b/OvmfPkg/XenPlatformPei/Pla= tform.c index e9511eb40c62..a811e72ee301 100644 --- a/OvmfPkg/XenPlatformPei/Platform.c +++ b/OvmfPkg/XenPlatformPei/Platform.c @@ -444,13 +444,12 @@ InitializeXenPlatform ( mHostBridgeDevId =3D PciRead16 (OVMF_HOSTBRIDGE_DID); =20 PublishPeiMemory (); =20 InitializeRamRegions (); =20 - InitializeXen (); CalibrateLapicTimer (); =20 if (mBootMode !=3D BOOT_ON_S3_RESUME) { ReserveEmuVariableNvStore (); PeiFvInitialization (); MemMapInitialization (); diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xen.c index cf14ee8eb3a0..a4e82b356936 100644 --- a/OvmfPkg/XenPlatformPei/Xen.c +++ b/OvmfPkg/XenPlatformPei/Xen.c @@ -369,32 +369,12 @@ XenPublishRamRegions ( break; } } } =20 =20 -/** - Perform Xen PEI initialization. - - @return EFI_SUCCESS Xen initialized successfully - @return EFI_NOT_FOUND Not running under Xen - -**/ -EFI_STATUS -InitializeXen ( - VOID - ) -{ - RETURN_STATUS PcdStatus; - - PcdStatus =3D PcdSetBoolS (PcdPciDisableBusEnumeration, TRUE); - ASSERT_RETURN_ERROR (PcdStatus); - - return EFI_SUCCESS; -} - EFI_STATUS PhysicalAddressIdentityMapping ( IN EFI_PHYSICAL_ADDRESS AddressToMap ) { INTN Index; --=20 2.19.1.3.g30247aa5d201 -=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 (#75688): https://edk2.groups.io/g/devel/message/75688 Mute This Topic: https://groups.io/mt/83110677/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75689+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75689+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061365; cv=none; d=zohomail.com; s=zohoarc; b=JbjYf2Thd0vZ260DeVyrvEfKx4/v4mAZ7UPgLh47LzIdsN0Q5fv4lY2sVoVDcL01kgNXiS7LiSwYnLWG4e9+iIrasyW5qJdBH3CB8FohJOU1/HQa9wUuaQXHPPS4LmIJqbPprOXv33nJoFdbjgCCqufF97+jMkbiiuHivYeJlRQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061365; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=1UK22CqzKJqkRLsaboN00QcVmeZG+Q8qO2wDWHNAK80=; b=n9qh/H7nU9sW6C/P0ZqTnbhu+IoreZmFdMWGWnr6VCwiWLU+774hpwUS8B+TaLfWyUMfyO2hg616tPgqVEd7GWe4BDq2+Zs+MG8iLScAD8JCN9Rk3WhfX/T78ueLZRslIwxfmw1WcGVLwl8VvHuw0ZwWwo9tRikF6zmKh1Fp+B0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75689+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622061365110278.63655606003624; Wed, 26 May 2021 13:36:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id r5V0YY1788612xGVKBXLvvOL; Wed, 26 May 2021 13:36:04 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web08.3115.1622061358743520282 for ; Wed, 26 May 2021 13:35:59 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-oSGc1Vf9OhmiUwQzVPeQdg-1; Wed, 26 May 2021 16:35:52 -0400 X-MC-Unique: oSGc1Vf9OhmiUwQzVPeQdg-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72DFB106BB24; Wed, 26 May 2021 20:35:51 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 016115D6D3; Wed, 26 May 2021 20:35:49 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 20/43] OvmfPkg/XenAcpiPlatformDxe: remove delayed ACPI table installation Date: Wed, 26 May 2021 22:14:23 +0200 Message-Id: <20210526201446.12554-21-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: XkXt9CYDUAcnVRfpXzDNu9fzx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061364; bh=1UK22CqzKJqkRLsaboN00QcVmeZG+Q8qO2wDWHNAK80=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=AiL7zzCvPg8LnG/9l4/1HN8njEcFyLUoRdfp4JcXD8nSbKWtj2YJYCpim3Y/LDdw/cA G2zqbUkgNtbPHpbLKqUzy+E+XQH9WF0vWxg3olwGBvn8JHQ52/xNKMqUQ1c8GP+Lqi1sE xsvyPChrzfJ/JwKYDNJYBEpnmDQN32ujBTc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Because "PcdPciDisableBusEnumeration" is always TRUE in the OvmfXen platform, we can remove the delayed ACPI table installation from XenAcpiPlatformDxe. A number of dependencies become useless this way; remove them too. (Note that, conversely, in the QemuFwCfgAcpiPlatformDxe driver, we *cannot* assume that "PcdPciDisableBusEnumeration" is always FALSE, regardless of Xen: in the ArmVirtQemu platform, the PCD may carry either FALSE or TRUE, dependent on whether or not the QEMU "virt" machine configuration includes a PCIe host controller, respectively.) Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf | 8 --- OvmfPkg/XenAcpiPlatformDxe/EntryPoint.c | 56 +------------------- 2 files changed, 2 insertions(+), 62 deletions(-) diff --git a/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf b/OvmfPkg/Xe= nAcpiPlatformDxe/XenAcpiPlatformDxe.inf index db9b6e093de4..d3a6353a50a6 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf +++ b/OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf @@ -25,29 +25,21 @@ [Sources] AcpiPlatform.c AcpiPlatform.h EntryPoint.c Xen.c =20 [Packages] - MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] BaseLib DebugLib - PcdLib UefiBootServicesTableLib UefiDriverEntryPoint XenPlatformLib =20 [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED =20 -[Guids] - gRootBridgesConnectedEventGroupGuid - -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration - [Depex] gEfiAcpiTableProtocolGuid diff --git a/OvmfPkg/XenAcpiPlatformDxe/EntryPoint.c b/OvmfPkg/XenAcpiPlatf= ormDxe/EntryPoint.c index b6d0835fe3d4..1a23790a3b2c 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/EntryPoint.c +++ b/OvmfPkg/XenAcpiPlatformDxe/EntryPoint.c @@ -4,15 +4,13 @@ Copyright (C) 2015-2021, Red Hat, Inc. Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 -#include // gRootBridgesConnectedE= ve... -#include // DEBUG() -#include // PcdGetBool() +#include // ASSERT_EFI_ERROR() #include // gBS #include // EFI_ACPI_TABLE_PROTOCOL =20 #include "AcpiPlatform.h" =20 STATIC @@ -31,65 +29,15 @@ FindAcpiTableProtocol ( ); ASSERT_EFI_ERROR (Status); return AcpiTable; } =20 =20 -STATIC -VOID -EFIAPI -OnRootBridgesConnected ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - EFI_STATUS Status; - - DEBUG ((DEBUG_INFO, - "%a: root bridges have been connected, installing ACPI tables\n", - __FUNCTION__)); - Status =3D InstallAcpiTables (FindAcpiTableProtocol ()); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: InstallAcpiTables: %r\n", __FUNCTION__, Stat= us)); - } - gBS->CloseEvent (Event); -} - - EFI_STATUS EFIAPI AcpiPlatformEntryPoint ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { - EFI_STATUS Status; - EFI_EVENT RootBridgesConnected; - - // - // If the platform doesn't support PCI, or PCI enumeration has been disa= bled, - // install the tables at once, and let the entry point's return code ref= lect - // the full functionality. - // - if (PcdGetBool (PcdPciDisableBusEnumeration)) { - DEBUG ((DEBUG_INFO, "%a: PCI or its enumeration disabled, installing " - "ACPI tables\n", __FUNCTION__)); - return InstallAcpiTables (FindAcpiTableProtocol ()); - } - - // - // Otherwise, delay installing the ACPI tables until root bridges are - // connected. The entry point's return status will only reflect the call= back - // setup. (Note that we're a DXE_DRIVER; our entry point function is inv= oked - // strictly before BDS is entered and can connect the root bridges.) - // - Status =3D gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_CALLBACK, - OnRootBridgesConnected, NULL /* Context */, - &gRootBridgesConnectedEventGroupGuid, &RootBridgesConnec= ted); - if (!EFI_ERROR (Status)) { - DEBUG ((DEBUG_INFO, - "%a: waiting for root bridges to be connected, registered callback\n= ", - __FUNCTION__)); - } - - return Status; + return InstallAcpiTables (FindAcpiTableProtocol ()); } --=20 2.19.1.3.g30247aa5d201 -=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 (#75689): https://edk2.groups.io/g/devel/message/75689 Mute This Topic: https://groups.io/mt/83110694/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75690+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75690+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061426; cv=none; d=zohomail.com; s=zohoarc; b=Ng1HIxu0DxcnF3zQVZr1whpxqp75J7W7i2Q1jXNN0rlHnhdFooN62uTDc3MvSK0QJncDC/Wr7/51UoIcjRPoT+rBXmvNON4ZGecWcZMaRPtCy1iThsBdtixu73LkiLiyNwpk90U2ujNgrgliQaM6170CldJiWZyrGkkLuGsgha8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061426; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=CT50IASkTyf5+jkhginsKDfZL3ZPiTfMhYbHka4HXTk=; b=SSvCYw/XAtaYM00IiI3l6spPDVT0to0Xjb5n2+bKUGqAlsIUi6jUKd80msyKF40CK2z12oktbH4PnTpp9MO5H0xWrh/5ZtLeNFnwvjIQv07x3IQ2ZQ9qh3Ztkg3E8u+RqVQLiggQlE7hPH6VpsC1Xz2NJ/QIS6ZAdBBpfu7mp58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75690+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16220614263631012.6713797981386; Wed, 26 May 2021 13:37:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ZsRfYY1788612xft2kZriEoV; Wed, 26 May 2021 13:37:06 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web11.3020.1622061420385936617 for ; Wed, 26 May 2021 13:37:00 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-Nu66clw1Pke5m3hsY1ysSw-1; Wed, 26 May 2021 16:36:56 -0400 X-MC-Unique: Nu66clw1Pke5m3hsY1ysSw-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B7B9106BB4D; Wed, 26 May 2021 20:36:54 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id A176A5D9DE; Wed, 26 May 2021 20:36:52 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Andrew Fish , Ard Biesheuvel , Jordan Justen , Leif Lindholm , Michael D Kinney , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 21/43] OvmfPkg/PlatformPei: remove Xen support Date: Wed, 26 May 2021 22:14:24 +0200 Message-Id: <20210526201446.12554-22-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: TsAMdocy19NAbx7Ld83lJBGRx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061426; bh=CT50IASkTyf5+jkhginsKDfZL3ZPiTfMhYbHka4HXTk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=YCvDCYRKg+dPEARimGnte3/GjvYOo6DKTXa5+KaW4cqGpPsZ/XNT807bWqBO2L59g+/ avRVxHOT89KziilzyvnPrkrQjIwLnEi0L9wLk+1ZxjwfAHRM8DgwNIIOsTzORtuP2JY+H 3kOcY8+Vtj2RJKsxb8RLDmJB8NQIY1g0iX0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The "OvmfPkg/PlatformPei/PlatformPei.inf" module is used by the following platform DSCs: OvmfPkg/AmdSev/AmdSevX64.dsc OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgX64.dsc Remove Xen support from "OvmfPkg/PlatformPei", including any dependencies that now become unused. The basic idea is to substitute FALSE for "mXen". Remove "OvmfPkg/PlatformPei" from the "OvmfPkg: Xen-related modules" section of "Maintainers.txt". This patch is best reviewed with "git show -b -W". Cc: Andrew Fish Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Leif Lindholm Cc: Michael D Kinney Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/PlatformPei/PlatformPei.inf | 4 - Maintainers.txt | 3 - OvmfPkg/PlatformPei/Platform.h | 17 -- OvmfPkg/PlatformPei/Xen.h | 39 ---- OvmfPkg/PlatformPei/MemDetect.c | 10 +- OvmfPkg/PlatformPei/Platform.c | 162 +++++++------- OvmfPkg/PlatformPei/Xen.c | 222 -------------------- 7 files changed, 77 insertions(+), 380 deletions(-) diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 6ef77ba7bb21..89d1f7636870 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -30,26 +30,23 @@ [Sources] FeatureControl.c Fv.c MemDetect.c MemTypeInfo.c Platform.c Platform.h - Xen.c - Xen.h =20 [Packages] EmbeddedPkg/EmbeddedPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec SecurityPkg/SecurityPkg.dec UefiCpuPkg/UefiCpuPkg.dec OvmfPkg/OvmfPkg.dec =20 [Guids] gEfiMemoryTypeInformationGuid - gEfiXenInfoGuid =20 [LibraryClasses] BaseLib CacheMaintenanceLib DebugLib HobLib @@ -93,13 +90,12 @@ [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase diff --git a/Maintainers.txt b/Maintainers.txt index 82008a0046c6..be40a1d6f2b6 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -498,15 +498,12 @@ F: OvmfPkg/Library/XenConsoleSerialPortLib/ F: OvmfPkg/Library/XenHypercallLib/ F: OvmfPkg/Library/XenIoMmioLib/ F: OvmfPkg/Library/XenPlatformLib/ F: OvmfPkg/Library/XenRealTimeClockLib/ F: OvmfPkg/OvmfXen.* F: OvmfPkg/OvmfXenElfHeaderGenerator.c -F: OvmfPkg/PlatformPei/MemDetect.c -F: OvmfPkg/PlatformPei/Platform.* -F: OvmfPkg/PlatformPei/Xen.* F: OvmfPkg/SmbiosPlatformDxe/*Xen.c F: OvmfPkg/XenAcpiPlatformDxe/ F: OvmfPkg/XenBusDxe/ F: OvmfPkg/XenIoPciDxe/ F: OvmfPkg/XenIoPvhDxe/ F: OvmfPkg/XenPlatformPei/ diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h index 0484ec9e6b4c..8b1d270c2b0b 100644 --- a/OvmfPkg/PlatformPei/Platform.h +++ b/OvmfPkg/PlatformPei/Platform.h @@ -94,34 +94,17 @@ InstallFeatureControlCallback ( =20 VOID InstallClearCacheCallback ( VOID ); =20 -EFI_STATUS -InitializeXen ( - VOID - ); - -BOOLEAN -XenDetect ( - VOID - ); - VOID AmdSevInitialize ( VOID ); =20 -extern BOOLEAN mXen; - -VOID -XenPublishRamRegions ( - VOID - ); - extern EFI_BOOT_MODE mBootMode; =20 extern BOOLEAN mS3Supported; =20 extern UINT8 mPhysMemAddressWidth; =20 diff --git a/OvmfPkg/PlatformPei/Xen.h b/OvmfPkg/PlatformPei/Xen.h deleted file mode 100644 index 2605481280c0..000000000000 --- a/OvmfPkg/PlatformPei/Xen.h +++ /dev/null @@ -1,39 +0,0 @@ -/** @file - Ovmf info structure passed by Xen - -Copyright (c) 2013, Citrix Systems UK Ltd.
- -SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef __XEN_H__ -#define __XEN_H__ - -#include - -// Physical address of OVMF info -#define OVMF_INFO_PHYSICAL_ADDRESS 0x00001000 - -// This structure must match the definition on Xen side -#pragma pack(1) -typedef struct { - CHAR8 Signature[14]; // XenHVMOVMF\0 - UINT8 Length; // Length of this structure - UINT8 Checksum; // Set such that the sum over bytes 0..length =3D= =3D 0 - // - // Physical address of an array of TablesCount elements. - // - // Each element contains the physical address of a BIOS table. - // - EFI_PHYSICAL_ADDRESS Tables; - UINT32 TablesCount; - // - // Physical address of the E820 table, contains E820EntriesCount entries. - // - EFI_PHYSICAL_ADDRESS E820; - UINT32 E820EntriesCount; -} EFI_XEN_OVMF_INFO; -#pragma pack() - -#endif /* __XEN_H__ */ diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetec= t.c index c08aa2e45a53..2deec128f464 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -132,16 +132,12 @@ QemuUc32BaseInitialization ( VOID ) { UINT32 LowerMemorySize; UINT32 Uc32Size; =20 - if (mXen) { - return; - } - if (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { // // On q35, the 32-bit area that we'll mark as UC, through variable MTR= Rs, // starts at PcdPciExpressBaseAddress. The platform DSC is responsible= for // setting PcdPciExpressBaseAddress such that describing the // [PcdPciExpressBaseAddress, 4GB) range require a very small number of @@ -816,17 +812,13 @@ QemuInitializeRam ( **/ VOID InitializeRamRegions ( VOID ) { - if (!mXen) { - QemuInitializeRam (); - } else { - XenPublishRamRegions (); - } + QemuInitializeRam (); =20 if (mS3Supported && mBootMode !=3D BOOT_ON_S3_RESUME) { // // This is the memory range that will be used for PEI on S3 resume // BuildMemoryAllocationHob ( diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 96468701e3b8..d3a20122a2ea 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -143,103 +143,100 @@ MemMapInitialization ( VOID ) { UINT64 PciIoBase; UINT64 PciIoSize; RETURN_STATUS PcdStatus; + UINT32 TopOfLowRam; + UINT64 PciExBarBase; + UINT32 PciBase; + UINT32 PciSize; =20 PciIoBase =3D 0xC000; PciIoSize =3D 0x4000; =20 // // Video memory + Legacy BIOS region // AddIoMemoryRangeHob (0x0A0000, BASE_1MB); =20 - if (!mXen) { - UINT32 TopOfLowRam; - UINT64 PciExBarBase; - UINT32 PciBase; - UINT32 PciSize; - - TopOfLowRam =3D GetSystemMemorySizeBelow4gb (); - PciExBarBase =3D 0; - if (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { - // - // The MMCONFIG area is expected to fall between the top of low RAM = and - // the base of the 32-bit PCI host aperture. - // - PciExBarBase =3D FixedPcdGet64 (PcdPciExpressBaseAddress); - ASSERT (TopOfLowRam <=3D PciExBarBase); - ASSERT (PciExBarBase <=3D MAX_UINT32 - SIZE_256MB); - PciBase =3D (UINT32)(PciExBarBase + SIZE_256MB); - } else { - ASSERT (TopOfLowRam <=3D mQemuUc32Base); - PciBase =3D mQemuUc32Base; - } - + TopOfLowRam =3D GetSystemMemorySizeBelow4gb (); + PciExBarBase =3D 0; + if (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { // - // address purpose size - // ------------ -------- ------------------------- - // max(top, 2g) PCI MMIO 0xFC000000 - max(top, 2g) - // 0xFC000000 gap 44 MB - // 0xFEC00000 IO-APIC 4 KB - // 0xFEC01000 gap 1020 KB - // 0xFED00000 HPET 1 KB - // 0xFED00400 gap 111 KB - // 0xFED1C000 gap (PIIX4) / RCRB (ICH9) 16 KB - // 0xFED20000 gap 896 KB - // 0xFEE00000 LAPIC 1 MB + // The MMCONFIG area is expected to fall between the top of low RAM and + // the base of the 32-bit PCI host aperture. // - PciSize =3D 0xFC000000 - PciBase; - AddIoMemoryBaseSizeHob (PciBase, PciSize); - PcdStatus =3D PcdSet64S (PcdPciMmio32Base, PciBase); - ASSERT_RETURN_ERROR (PcdStatus); - PcdStatus =3D PcdSet64S (PcdPciMmio32Size, PciSize); - ASSERT_RETURN_ERROR (PcdStatus); + PciExBarBase =3D FixedPcdGet64 (PcdPciExpressBaseAddress); + ASSERT (TopOfLowRam <=3D PciExBarBase); + ASSERT (PciExBarBase <=3D MAX_UINT32 - SIZE_256MB); + PciBase =3D (UINT32)(PciExBarBase + SIZE_256MB); + } else { + ASSERT (TopOfLowRam <=3D mQemuUc32Base); + PciBase =3D mQemuUc32Base; + } =20 - AddIoMemoryBaseSizeHob (0xFEC00000, SIZE_4KB); - AddIoMemoryBaseSizeHob (0xFED00000, SIZE_1KB); - if (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { - AddIoMemoryBaseSizeHob (ICH9_ROOT_COMPLEX_BASE, SIZE_16KB); - // - // Note: there should be an - // - // AddIoMemoryBaseSizeHob (PciExBarBase, SIZE_256MB); - // - // call below, just like the one above for RCBA. However, Linux insi= sts - // that the MMCONFIG area be marked in the E820 or UEFI memory map as - // "reserved memory" -- Linux does not content itself with a simple = gap - // in the memory map wherever the MCFG ACPI table points to. - // - // This appears to be a safety measure. The PCI Firmware Specificati= on - // (rev 3.1) says in 4.1.2. "MCFG Table Description": "The resources= can - // *optionally* be returned in [...] EFIGetMemoryMap as reserved mem= ory - // [...]". (Emphasis added here.) - // - // Normally we add memory resource descriptor HOBs in - // QemuInitializeRam(), and pre-allocate from those with memory - // allocation HOBs in InitializeRamRegions(). However, the MMCONFIG = area - // is most definitely not RAM; so, as an exception, cover it with - // uncacheable reserved memory right here. - // - AddReservedMemoryBaseSizeHob (PciExBarBase, SIZE_256MB, FALSE); - BuildMemoryAllocationHob (PciExBarBase, SIZE_256MB, - EfiReservedMemoryType); - } - AddIoMemoryBaseSizeHob (PcdGet32(PcdCpuLocalApicBaseAddress), SIZE_1MB= ); + // + // address purpose size + // ------------ -------- ------------------------- + // max(top, 2g) PCI MMIO 0xFC000000 - max(top, 2g) + // 0xFC000000 gap 44 MB + // 0xFEC00000 IO-APIC 4 KB + // 0xFEC01000 gap 1020 KB + // 0xFED00000 HPET 1 KB + // 0xFED00400 gap 111 KB + // 0xFED1C000 gap (PIIX4) / RCRB (ICH9) 16 KB + // 0xFED20000 gap 896 KB + // 0xFEE00000 LAPIC 1 MB + // + PciSize =3D 0xFC000000 - PciBase; + AddIoMemoryBaseSizeHob (PciBase, PciSize); + PcdStatus =3D PcdSet64S (PcdPciMmio32Base, PciBase); + ASSERT_RETURN_ERROR (PcdStatus); + PcdStatus =3D PcdSet64S (PcdPciMmio32Size, PciSize); + ASSERT_RETURN_ERROR (PcdStatus); =20 + AddIoMemoryBaseSizeHob (0xFEC00000, SIZE_4KB); + AddIoMemoryBaseSizeHob (0xFED00000, SIZE_1KB); + if (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { + AddIoMemoryBaseSizeHob (ICH9_ROOT_COMPLEX_BASE, SIZE_16KB); + // + // Note: there should be an + // + // AddIoMemoryBaseSizeHob (PciExBarBase, SIZE_256MB); // - // On Q35, the IO Port space is available for PCI resource allocations= from - // 0x6000 up. + // call below, just like the one above for RCBA. However, Linux insists + // that the MMCONFIG area be marked in the E820 or UEFI memory map as + // "reserved memory" -- Linux does not content itself with a simple gap + // in the memory map wherever the MCFG ACPI table points to. // - if (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { - PciIoBase =3D 0x6000; - PciIoSize =3D 0xA000; - ASSERT ((ICH9_PMBASE_VALUE & 0xF000) < PciIoBase); - } + // This appears to be a safety measure. The PCI Firmware Specification + // (rev 3.1) says in 4.1.2. "MCFG Table Description": "The resources c= an + // *optionally* be returned in [...] EFIGetMemoryMap as reserved memory + // [...]". (Emphasis added here.) + // + // Normally we add memory resource descriptor HOBs in + // QemuInitializeRam(), and pre-allocate from those with memory + // allocation HOBs in InitializeRamRegions(). However, the MMCONFIG ar= ea + // is most definitely not RAM; so, as an exception, cover it with + // uncacheable reserved memory right here. + // + AddReservedMemoryBaseSizeHob (PciExBarBase, SIZE_256MB, FALSE); + BuildMemoryAllocationHob (PciExBarBase, SIZE_256MB, + EfiReservedMemoryType); + } + AddIoMemoryBaseSizeHob (PcdGet32(PcdCpuLocalApicBaseAddress), SIZE_1MB); + + // + // On Q35, the IO Port space is available for PCI resource allocations f= rom + // 0x6000 up. + // + if (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { + PciIoBase =3D 0x6000; + PciIoSize =3D 0xA000; + ASSERT ((ICH9_PMBASE_VALUE & 0xF000) < PciIoBase); } =20 // // Add PCI IO Port space available for PCI resource allocations. // BuildResourceDescriptorHob ( @@ -368,15 +365,15 @@ MiscInitialization ( return; } PcdStatus =3D PcdSet16S (PcdOvmfHostBridgePciDevId, mHostBridgeDevId); ASSERT_RETURN_ERROR (PcdStatus); =20 // - // If the appropriate IOspace enable bit is set, assume the ACPI PMBA - // has been configured (e.g., by Xen) and skip the setup here. - // This matches the logic in AcpiTimerLibConstructor (). + // If the appropriate IOspace enable bit is set, assume the ACPI PMBA has + // been configured and skip the setup here. This matches the logic in + // AcpiTimerLibConstructor (). // if ((PciRead8 (AcpiCtlReg) & AcpiEnBit) =3D=3D 0) { // // The PEI phase should be exited with fully accessibe ACPI PM IO spac= e: // 1. set PMBA // @@ -700,14 +697,12 @@ InitializePlatform ( EFI_STATUS Status; =20 DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n")); =20 DebugDumpCmos (); =20 - XenDetect (); - if (QemuFwCfgS3Enabled ()) { DEBUG ((DEBUG_INFO, "S3 support was detected on QEMU\n")); mS3Supported =3D TRUE; Status =3D PcdSetBoolS (PcdAcpiS3Enable, TRUE); ASSERT_EFI_ERROR (Status); } @@ -732,17 +727,12 @@ InitializePlatform ( PublishPeiMemory (); =20 QemuUc32BaseInitialization (); =20 InitializeRamRegions (); =20 - if (mXen) { - DEBUG ((DEBUG_INFO, "Xen was detected\n")); - InitializeXen (); - } - if (mBootMode !=3D BOOT_ON_S3_RESUME) { if (!FeaturePcdGet (PcdSmmSmramRequire)) { ReserveEmuVariableNvStore (); } PeiFvInitialization (); MemTypeInfoInitialization (); diff --git a/OvmfPkg/PlatformPei/Xen.c b/OvmfPkg/PlatformPei/Xen.c deleted file mode 100644 index 104922c67e7e..000000000000 --- a/OvmfPkg/PlatformPei/Xen.c +++ /dev/null @@ -1,222 +0,0 @@ -/**@file - Xen Platform PEI support - - Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
- Copyright (c) 2011, Andrei Warkentin - - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -// -// The package level header files this module uses -// -#include - -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Platform.h" -#include "Xen.h" - -BOOLEAN mXen =3D FALSE; - -STATIC UINT32 mXenLeaf =3D 0; - -EFI_XEN_INFO mXenInfo; - -/** - Returns E820 map provided by Xen - - @param Entries Pointer to E820 map - @param Count Number of entries - - @return EFI_STATUS -**/ -EFI_STATUS -XenGetE820Map ( - EFI_E820_ENTRY64 **Entries, - UINT32 *Count - ) -{ - EFI_XEN_OVMF_INFO *Info =3D - (EFI_XEN_OVMF_INFO *)(UINTN) OVMF_INFO_PHYSICAL_ADDRESS; - - if (AsciiStrCmp ((CHAR8 *) Info->Signature, "XenHVMOVMF")) { - return EFI_NOT_FOUND; - } - - ASSERT (Info->E820 < MAX_ADDRESS); - *Entries =3D (EFI_E820_ENTRY64 *)(UINTN) Info->E820; - *Count =3D Info->E820EntriesCount; - - return EFI_SUCCESS; -} - -/** - Connects to the Hypervisor. - - @param XenLeaf CPUID index used to connect. - - @return EFI_STATUS - -**/ -EFI_STATUS -XenConnect ( - UINT32 XenLeaf - ) -{ - UINT32 Index; - UINT32 TransferReg; - UINT32 TransferPages; - UINT32 XenVersion; - - AsmCpuid (XenLeaf + 2, &TransferPages, &TransferReg, NULL, NULL); - mXenInfo.HyperPages =3D AllocatePages (TransferPages); - if (!mXenInfo.HyperPages) { - return EFI_OUT_OF_RESOURCES; - } - - for (Index =3D 0; Index < TransferPages; Index++) { - AsmWriteMsr64 (TransferReg, - (UINTN) mXenInfo.HyperPages + - (Index << EFI_PAGE_SHIFT) + Index); - } - - AsmCpuid (XenLeaf + 1, &XenVersion, NULL, NULL, NULL); - DEBUG ((DEBUG_ERROR, "Detected Xen version %d.%d\n", - XenVersion >> 16, XenVersion & 0xFFFF)); - mXenInfo.VersionMajor =3D (UINT16)(XenVersion >> 16); - mXenInfo.VersionMinor =3D (UINT16)(XenVersion & 0xFFFF); - - BuildGuidDataHob ( - &gEfiXenInfoGuid, - &mXenInfo, - sizeof(mXenInfo) - ); - - return EFI_SUCCESS; -} - -/** - Figures out if we are running inside Xen HVM. - - @retval TRUE Xen was detected - @retval FALSE Xen was not detected - -**/ -BOOLEAN -XenDetect ( - VOID - ) -{ - UINT8 Signature[13]; - - if (mXenLeaf !=3D 0) { - return TRUE; - } - - Signature[12] =3D '\0'; - for (mXenLeaf =3D 0x40000000; mXenLeaf < 0x40010000; mXenLeaf +=3D 0x100= ) { - AsmCpuid (mXenLeaf, - NULL, - (UINT32 *) &Signature[0], - (UINT32 *) &Signature[4], - (UINT32 *) &Signature[8]); - - if (!AsciiStrCmp ((CHAR8 *) Signature, "XenVMMXenVMM")) { - mXen =3D TRUE; - return TRUE; - } - } - - mXenLeaf =3D 0; - return FALSE; -} - - -VOID -XenPublishRamRegions ( - VOID - ) -{ - EFI_E820_ENTRY64 *E820Map; - UINT32 E820EntriesCount; - EFI_STATUS Status; - - if (!mXen) { - return; - } - - DEBUG ((DEBUG_INFO, "Using memory map provided by Xen\n")); - - // - // Parse RAM in E820 map - // - E820EntriesCount =3D 0; - Status =3D XenGetE820Map (&E820Map, &E820EntriesCount); - - ASSERT_EFI_ERROR (Status); - - if (E820EntriesCount > 0) { - EFI_E820_ENTRY64 *Entry; - UINT32 Loop; - - for (Loop =3D 0; Loop < E820EntriesCount; Loop++) { - Entry =3D E820Map + Loop; - - // - // Only care about RAM - // - if (Entry->Type !=3D EfiAcpiAddressRangeMemory) { - continue; - } - - AddMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length); - - MtrrSetMemoryAttribute (Entry->BaseAddr, Entry->Length, CacheWriteBa= ck); - } - } -} - - -/** - Perform Xen PEI initialization. - - @return EFI_SUCCESS Xen initialized successfully - @return EFI_NOT_FOUND Not running under Xen - -**/ -EFI_STATUS -InitializeXen ( - VOID - ) -{ - RETURN_STATUS PcdStatus; - - if (mXenLeaf =3D=3D 0) { - return EFI_NOT_FOUND; - } - - XenConnect (mXenLeaf); - - // - // Reserve away HVMLOADER reserved memory [0xFC000000,0xFD000000). - // This needs to match HVMLOADER RESERVED_MEMBASE/RESERVED_MEMSIZE. - // - AddReservedMemoryBaseSizeHob (0xFC000000, 0x1000000, FALSE); - - PcdStatus =3D PcdSetBoolS (PcdPciDisableBusEnumeration, TRUE); - ASSERT_RETURN_ERROR (PcdStatus); - - return EFI_SUCCESS; -} --=20 2.19.1.3.g30247aa5d201 -=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 (#75690): https://edk2.groups.io/g/devel/message/75690 Mute This Topic: https://groups.io/mt/83110716/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75691+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75691+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061485; cv=none; d=zohomail.com; s=zohoarc; b=iegO5l1z12x7aG5JuRosvM22JvUH347Nsn08fgp+gv6FiTLIxfL7dSo9QWOluiy/Uk8NbXfY4QhoCKgprqUWHt4lsl+SNZiXfh7MGFpb6isbEUcvJExyTmOkIS4tL2EbBA5X4OBp7UQ6wkrxV32UViKba/qRVTYAw6ytvOF6xZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061485; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=BbMR1DZ2u+amSwD0mTYoI38gDt9M+y7+07u0rnqhdr0=; b=CENbFSSlFLVE3yK2YJ4IdBe4E+M0032gs0/dMNGEc9mhsiSN7Pde9sFOP8N+U5+WyQIG6zEz3c8FUa55wkWRxtsELpw707a5khE4usCSndv51VoRfCojbmat1YnZOoMaqTCMdBAbhp/+qQcMYFOvCiblOUYgo7KAyW9FUZn5zBI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75691+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206148580237.71081724275098; Wed, 26 May 2021 13:38:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id SKEDYY1788612xGnYp25ilfa; Wed, 26 May 2021 13:38:05 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web08.3137.1622061484794700938 for ; Wed, 26 May 2021 13:38:04 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-163-4Tlcnrd_OPG4HIHNhVsUlA-1; Wed, 26 May 2021 16:38:00 -0400 X-MC-Unique: 4Tlcnrd_OPG4HIHNhVsUlA-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8A816D25B; Wed, 26 May 2021 20:37:59 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDEB561F5E; Wed, 26 May 2021 20:37:55 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 22/43] OvmfPkg: drop PcdPciDisableBusEnumeration from the IA32, IA32X64, X64 DSCs Date: Wed, 26 May 2021 22:14:25 +0200 Message-Id: <20210526201446.12554-23-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: Jbr6sqBtfRyWhqt1IadMzyrox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061485; bh=BbMR1DZ2u+amSwD0mTYoI38gDt9M+y7+07u0rnqhdr0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=PlMh2RJ/Am8zIYAqAQv2zNVVyhcuMMl8LpquscTArv2bBTDW5+j4vz4YqSqK6t9P+ef +wq7RVOdb/ICs0PYYRt9jZylXRNrrstopwbAj3eaA+4SN0bkixH0DLtlxC4sO72XIJWgo fnpaHN3tnCPnZX+ZvNTwW1Crr+442ZpapeM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" With the Xen-dependent PcdSetBoolS() call removed from OvmfPkg/PlatformPei, the "OvmfPkgIa32.dsc", "OvmfPkgIa32X64.dsc", "OvmfPkgX64.dsc" platforms never write "PcdPciDisableBusEnumeration". This means we don't need a dynamic default for the PCD in the DSC files; it could be declared Fixed-at-Build. However, because the PCD's default value in "MdeModulePkg.dec" is FALSE, remove the (same-value) platform defaults altogether. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/OvmfPkgIa32.dsc | 1 - OvmfPkg/OvmfPkgIa32X64.dsc | 1 - OvmfPkg/OvmfPkgX64.dsc | 1 - 3 files changed, 3 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 4b7e1c731ef5..7a37efd35664 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -595,13 +595,12 @@ [PcdsDynamicDefault] =20 !if $(SMM_REQUIRE) =3D=3D FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 !endif - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable|FALSE gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize|0x0 diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 1d1dea4b19cd..d6cc58a261d9 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -601,13 +601,12 @@ [PcdsDynamicDefault] =20 !if $(SMM_REQUIRE) =3D=3D FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 !endif - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable|FALSE gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize|0x0 diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index d71edd6b2272..ab60c36eca27 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -601,13 +601,12 @@ [PcdsDynamicDefault] =20 !if $(SMM_REQUIRE) =3D=3D FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 !endif - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable|FALSE gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize|0x0 --=20 2.19.1.3.g30247aa5d201 -=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 (#75691): https://edk2.groups.io/g/devel/message/75691 Mute This Topic: https://groups.io/mt/83110732/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75692+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75692+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061564; cv=none; d=zohomail.com; s=zohoarc; b=VkTiRKLsoigXXwvCLZE2872EMy27vJKxjLO831GzoUkeyQMhiwQ6Wx8U0wYdWorZsZBWqyVtQOJBVhX+fhXNsJw9WLExRdl9T77poUGXKeW2IxEpFX1pNGz+z0Maitc9c+Jb6xDQ5hUzegwQx3ChGSvR0h3qw4GXRNZB6WvxyAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061564; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=M5CXx8YWjonjE9cB9kgfXuVIESlkvlmYJT/r+wRap6g=; b=DXaAuaeaEit5XEkX354pAh8hy2HC7Yw5QLre5Mc3/OV5NI6Z3JAyQgAizdOGbQz3LZvAWj6UasFRnrfYlUM9UaVYaigUIBQUFLWnbo7cDV+Palj7xJ/8FdRBK/ai2nJm8ESv8Si0fdXLtoBTA11WBuWPPDsRQrdj1EneL158KHc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75692+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622061564243755.0086147552146; Wed, 26 May 2021 13:39:24 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8NgGYY1788612xoFQX8m9Uw6; Wed, 26 May 2021 13:39:23 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.3068.1622061558340636834 for ; Wed, 26 May 2021 13:39:18 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-265-jlXDrPbAMYiQL5W--FlfkQ-1; Wed, 26 May 2021 16:39:04 -0400 X-MC-Unique: jlXDrPbAMYiQL5W--FlfkQ-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A08A802690; Wed, 26 May 2021 20:39:03 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id E643259440; Wed, 26 May 2021 20:39:00 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Jordan Justen , Min Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Tom Lendacky Subject: [edk2-devel] [PATCH 23/43] OvmfPkg: drop PcdPciDisableBusEnumeration from the AmdSev platform Date: Wed, 26 May 2021 22:14:26 +0200 Message-Id: <20210526201446.12554-24-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: IVq4iOJMGK2D17U72u8VqYGgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061563; bh=M5CXx8YWjonjE9cB9kgfXuVIESlkvlmYJT/r+wRap6g=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=t9CukCgiRdXOFGVWVO6Vh1LU9dU5b9XCo0+02NkD7HrGAQ5fk3sSO2SICm4z6X00ccJ dhnluexDQiRVp2litzzMTlU0iru4bZ2Vyvapgq+c4UhhBCknE8Oa5QLWD89Mln0ERlRkw b7TMR5PEyTC8oY2bPu822YO9Fp/OKd3GyYY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" With the Xen-dependent PcdSetBoolS() call removed from OvmfPkg/PlatformPei, the "AmdSevX64.dsc" platform never writes "PcdPciDisableBusEnumeration". This means we don't need a dynamic default for the PCD in the DSC file; it could be declared Fixed-at-Build. However, because the PCD's default value in "MdeModulePkg.dec" is FALSE, remove the (same-value) platform default altogether. Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Jordan Justen Cc: Min Xu Cc: Philippe Mathieu-Daud=C3=A9 Cc: Tom Lendacky Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/AmdSev/AmdSevX64.dsc | 1 - 1 file changed, 1 deletion(-) diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index 9e7c459e9a8b..1d487befae08 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -532,13 +532,12 @@ [PcdsFixedAtBuild] [PcdsDynamicDefault] gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 =20 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable|FALSE gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize|0x0 --=20 2.19.1.3.g30247aa5d201 -=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 (#75692): https://edk2.groups.io/g/devel/message/75692 Mute This Topic: https://groups.io/mt/83110778/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75693+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75693+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061615; cv=none; d=zohomail.com; s=zohoarc; b=LS8yhAB6DyzCsORT7QHWaeIt5MdndOniKKtP0sB24jmdJ8Q9RQ28lX8MOxNnnHzmlwwrTF458oIVm22GXwd21EqeFsDwm0rU1PNe1DQ5BBmtXC3jBgqWN68rFMLn28mlL1NQfCaTaEbwDl5+f/IRSuQ072Lh/Y3xeRxQONJCzhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061615; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=xoakmmC9jCon0oqhn9CqaaeYgDzHgt51Ot7RHZDmA74=; b=AiXDGU4s/2BwvD6eYJZ2yevQGXEKCoXVAkGTugMZb5qtdbpFMIlFibKXk0W+ofdvXXbPxwx4UhrUFZuA1u7uTJnQ0Z5Oo6MsoO8t3y1OZTbo2uFAoEg2e9S4BPyWWIUoolUrOZKvO1uV4ZRUu2PKVqaHgp8NSK6K7khvewGJ02M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75693+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206161495255.018969703120774; Wed, 26 May 2021 13:40:14 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id BkD9YY1788612xAubDWlKht6; Wed, 26 May 2021 13:40:14 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.3084.1622061613795533895 for ; Wed, 26 May 2021 13:40:14 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-486-As5Ng5l_OJS18flyyLQXgA-1; Wed, 26 May 2021 16:40:06 -0400 X-MC-Unique: As5Ng5l_OJS18flyyLQXgA-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C08BD802575; Wed, 26 May 2021 20:40:05 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A6775D6D3; Wed, 26 May 2021 20:40:04 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , Peter Grehan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rebecca Cran Subject: [edk2-devel] [PATCH 24/43] OvmfPkg/Bhyve: make "PcdPciDisableBusEnumeration" Fixed-at-Build Date: Wed, 26 May 2021 22:14:27 +0200 Message-Id: <20210526201446.12554-25-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: 8PD4GhLSI0x85R1qfchZua5Xx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061614; bh=xoakmmC9jCon0oqhn9CqaaeYgDzHgt51Ot7RHZDmA74=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=LGwxF0DaJASyjR5jya0x95AXaxxF8tJjSrgYLZo7TL1nzVZkZ32l61g7eB8wlIfLTH/ j3auY3DvqCHEkqDxpLO26M44TnWoc69ThgyoQBcg8Kpj+gRSmih48/6/OXIlOcPEes4mM +jd1WlpEqjWIiiyF7Fi4Jtw4SxT7ysVQQn0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The Bhyve platform specifies the dynamic access method for "PcdPciDisableBusEnumeration" needlessly. After the DSC file sets the PCD to TRUE by default, the PCD is never written again. In particular, the "OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf" file references the PCD superfluously. Make the PCD Fixed-At-Build, and remove the PCD reference from the INF file. (Note that further simplifications are possible in "OvmfPkg/Bhyve/AcpiPlatformDxe", but those are out of scope for this patch series.) Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Peter Grehan Cc: Philippe Mathieu-Daud=C3=A9 Cc: Rebecca Cran Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude Reviewed-by: Rebecca Cran --- OvmfPkg/Bhyve/BhyveX64.dsc | 2 +- OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index 7d9e88040000..896b62881bdb 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -428,12 +428,13 @@ [PcdsFeatureFlag] gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE =20 [PcdsFixedAtBuild] + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FAL= SE gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10 gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|0 @@ -526,13 +527,12 @@ [PcdsDynamicDefault] # ($(SMM_REQUIRE) =3D=3D FALSE) gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 =20 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable|FALSE gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize|0x0 diff --git a/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf b/OvmfPkg/Bhyve/Plat= formPei/PlatformPei.inf index 12203e9f804d..739d63098b1e 100644 --- a/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf @@ -83,13 +83,12 @@ [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDecompressionScratchEnd gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy --=20 2.19.1.3.g30247aa5d201 -=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 (#75693): https://edk2.groups.io/g/devel/message/75693 Mute This Topic: https://groups.io/mt/83110800/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75695+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75695+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061680; cv=none; d=zohomail.com; s=zohoarc; b=LFiE40ws+7vw4rohXsJOMJrZhguBb6802skTx5vNDCRmNeXbO+q3PsGR8sGXpTmXqr3SHU5f9ucmxXjV4w8ieGvV4wM1y6HUmLYkZaLMD0cVp5fvjI9Wb2vLXfnXQQONzLDonAdSGY6sJXOkccynY0rtW48nMA9XWn4k5tcQPDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061680; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ftQz7gOjvgweEreI6Vz09Gvh35KMCKhmGzYnazbuwtU=; b=bdNfXjykwR4ERkfthiDxTTyvNm9FgDkJ6IBjnEqXTtwMFl78jd7OurnLgXtRiWnEJldZdyYbWJKUsc6kxhOCwiihOQ2v4YKiTlOvvg2pFJlcjFkzU1Ub1bi1dGN7ce0jJ0fzhqoqwEZ5QyNExaVO5I/wZ+xZd08A1H5EvgQPxao= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75695+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622061680322955.0441939030945; Wed, 26 May 2021 13:41:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jLaoYY1788612xduFPGk9n9A; Wed, 26 May 2021 13:41:20 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.3098.1622061673848438554 for ; Wed, 26 May 2021 13:41:14 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-419-orlDQCg2MJyQrDaeYhNNmw-1; Wed, 26 May 2021 16:41:11 -0400 X-MC-Unique: orlDQCg2MJyQrDaeYhNNmw-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 64155188E3C2; Wed, 26 May 2021 20:41:08 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDCEB18AA1; Wed, 26 May 2021 20:41:06 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 25/43] OvmfPkg/OvmfXen: remove IncompatiblePciDeviceSupport DXE driver Date: Wed, 26 May 2021 22:14:28 +0200 Message-Id: <20210526201446.12554-26-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: NG402HthpClZzvqKIKVlekbUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061680; bh=ftQz7gOjvgweEreI6Vz09Gvh35KMCKhmGzYnazbuwtU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=TB+Yc/SdTzefL9Qf7hjdzp5ifT4+HddWLOf5duB4mdqI+dALVVi8NS5eYxWeL5/L00N Ave2DZcZf6W3rf6eBY7WZiwRB5M580WL2Gg08AHBeYfacL0c1y2yUwAlOO4iqD7xXuTrD gwgDjueI1IFWFxFYgJNvnikLsauTewp8yA8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The entry point function of "OvmfPkg/IncompatiblePciDeviceSupportDxe", namely DriverInitialize() [OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c], bails out immediately if "PcdPciDisableBusEnumeration" is TRUE. The OvmfXen platform statically assigns this PCD TRUE. Thus, remove the driver from the OvmfXen platform. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/OvmfXen.dsc | 1 - OvmfPkg/OvmfXen.fdf | 1 - 2 files changed, 2 deletions(-) diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 779bcc3f8b9a..2d32c5734fa7 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -551,13 +551,12 @@ [Components] MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf =20 MdeModulePkg/Universal/EbcDxe/EbcDxe.inf OvmfPkg/XenTimerDxe/XenTimerDxe.inf UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf UefiCpuPkg/CpuDxe/CpuDxe.inf - OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf { PciHostBridgeLib|OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.i= nf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciH= ostBridgeUtilityLib.inf NULL|OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf diff --git a/OvmfPkg/OvmfXen.fdf b/OvmfPkg/OvmfXen.fdf index 8daa000de46a..9acc7c93b98b 100644 --- a/OvmfPkg/OvmfXen.fdf +++ b/OvmfPkg/OvmfXen.fdf @@ -298,13 +298,12 @@ [FV.DXEFV] INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf INF OvmfPkg/XenTimerDxe/XenTimerDxe.inf INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf INF UefiCpuPkg/CpuDxe/CpuDxe.inf -INF OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.= inf INF OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf INF MdeModulePkg/Universal/Metronome/Metronome.inf INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf --=20 2.19.1.3.g30247aa5d201 -=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 (#75695): https://edk2.groups.io/g/devel/message/75695 Mute This Topic: https://groups.io/mt/83110823/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75697+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75697+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061735; cv=none; d=zohomail.com; s=zohoarc; b=YUn6NeqvCCZ2WfUI7aVkTdBJy+Xv+akabM9y+JWCcO6trwOd2IxInF/xaSEe+8CjXMHE/RgVYYQ4mblRKhE0NB+wHJV9DXxmuERKrswhREs6ayGb0oJ4JApllyrVoQKecTdTq+HtJFGuACEAbXMJ1eq37fgTTGz+e6vJtNaWtcI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061735; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=hGqgPYEZe9x3f6rJY+AmrRj13JpbGcK2grSERHfjBrg=; b=Ggw7KJYkWXhQBLE5wkZPwJarM5MXJ4u2CYxMUXwINgCTvStoT2Aa8tWhorVGrNOn4tE9K42u6E5RJXIK4dvB6UYIPbXJs89wiyAmGC1eUr4AKm1Ezt60dY3UC+ckZJCTEIHCqw1gli6PdvaDf9gY3eRZoma2nrnYTqSd6HbfAfk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75697+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16220617358291008.8551294174387; Wed, 26 May 2021 13:42:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id A1XUYY1788612x2mgzet2UvC; Wed, 26 May 2021 13:42:15 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web09.3232.1622061734536519119 for ; Wed, 26 May 2021 13:42:14 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-290-3pxCnY32PwaO9RzmW_dfQQ-1; Wed, 26 May 2021 16:42:11 -0400 X-MC-Unique: 3pxCnY32PwaO9RzmW_dfQQ-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3FC0818401; Wed, 26 May 2021 20:42:10 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78FA410074E0; Wed, 26 May 2021 20:42:09 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , Peter Grehan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rebecca Cran Subject: [edk2-devel] [PATCH 26/43] OvmfPkg/Bhyve: remove IncompatiblePciDeviceSupport DXE driver Date: Wed, 26 May 2021 22:14:29 +0200 Message-Id: <20210526201446.12554-27-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: vQLnnNfLLGtfx2zBZeESOfPGx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061735; bh=hGqgPYEZe9x3f6rJY+AmrRj13JpbGcK2grSERHfjBrg=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=mO1oyWvIiSjU3WSzkyGHEOW/LFiljTRlvttHrfpYi+f0SvGZhkFek+hv5J6TG/hGCCJ vP/TFYKuzFrU+hLm0MePZh4RdxSFDdYTuZPaXWMfZ5HHukkV+xZruZnsPkNEII8yNHMqe ldRI+Obw3hALfN9ZUe2JpdSaUdBWcorV+aI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The entry point function of "OvmfPkg/IncompatiblePciDeviceSupportDxe", namely DriverInitialize() [OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c], bails out immediately if "PcdPciDisableBusEnumeration" is TRUE. The Bhyve platform statically assigns this PCD TRUE. Thus, remove the driver from the Bhyve platform. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Peter Grehan Cc: Philippe Mathieu-Daud=C3=A9 Cc: Rebecca Cran Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/Bhyve/BhyveX64.dsc | 1 - OvmfPkg/Bhyve/BhyveX64.fdf | 1 - 2 files changed, 2 deletions(-) diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index 896b62881bdb..30a99e2a3425 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -660,13 +660,12 @@ [Components] } =20 MdeModulePkg/Universal/EbcDxe/EbcDxe.inf UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf UefiCpuPkg/CpuDxe/CpuDxe.inf PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf - OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf { PciHostBridgeLib|OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.i= nf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciH= ostBridgeUtilityLib.inf NULL|OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf diff --git a/OvmfPkg/Bhyve/BhyveX64.fdf b/OvmfPkg/Bhyve/BhyveX64.fdf index f4050c4934b7..3eff36dac18f 100644 --- a/OvmfPkg/Bhyve/BhyveX64.fdf +++ b/OvmfPkg/Bhyve/BhyveX64.fdf @@ -207,13 +207,12 @@ [FV.DXEFV] INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf INF UefiCpuPkg/CpuDxe/CpuDxe.inf INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf -INF OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.= inf INF OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf INF MdeModulePkg/Universal/Metronome/Metronome.inf INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDx= e.inf --=20 2.19.1.3.g30247aa5d201 -=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 (#75697): https://edk2.groups.io/g/devel/message/75697 Mute This Topic: https://groups.io/mt/83110849/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75698+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75698+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061805; cv=none; d=zohomail.com; s=zohoarc; b=CH2/7/TJNSdwAEHsOyK5bkYEG3UD+XFMDASgyLfeYnXiwcuYO0Jlc0D5PVBGNelr2ED1MwNrwoLXoluvF19s42ITSPX3gNDxAJFNGJPM9c2Yg5mHOeHUAx1TbEf3GANk4do38701AhJcFhoNCPYc1SE3T4JnetDNmI641EVQo7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061805; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=29rjQ0qpiG/guQioZFDJ+uq9M12McSjTUGJ2taRa2pQ=; b=HJ5o+vJ9/VU7qHeyGYNglOwxqF8zMNf7kFrqBN876RKyLXKZE8qzS4pBcpZtQ61/zduDIFtsyvv2K2fEmJYI9DwDukUfcEYqzV8TYNERlrr2tBx9z3L3FuWVzpOfleexEEJcLn5va1oi6Mp7jZejDU9DuSR9PJeEHyk6j/CBHuU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75698+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622061805218925.6760390751452; Wed, 26 May 2021 13:43:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id av0sYY1788612xfkyk5ekIk6; Wed, 26 May 2021 13:43:24 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.3132.1622061798232848678 for ; Wed, 26 May 2021 13:43:18 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-491-O1GF4MvXOkKghI63QgE2yA-1; Wed, 26 May 2021 16:43:14 -0400 X-MC-Unique: O1GF4MvXOkKghI63QgE2yA-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39BCA6D4E3; Wed, 26 May 2021 20:43:13 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27B0B60CCD; Wed, 26 May 2021 20:43:11 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 27/43] OvmfPkg/IncompatiblePciDeviceSupportDxe: remove PcdPciDisableBusEnumeration Date: Wed, 26 May 2021 22:14:30 +0200 Message-Id: <20210526201446.12554-28-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: PwDQ5xipySQIX9bDFsj0DwWrx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061804; bh=29rjQ0qpiG/guQioZFDJ+uq9M12McSjTUGJ2taRa2pQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=q0dw9J0kxuLKI1PM31tSy/Zv/whYuy03CFqVkFCJBCA3lwn6+S2zODnb0VgltCMrhK+ 4UayvfC7fi0JjJOPoKEZXkvk+Iqb4/SexGpIIBu2Lg1Bw+/IOXKr9TFN6V2rUEyw9ZGJG nJCUzMUoYfCCMQFcKV9zvp1bNqYo1sqsZ64= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" At this point, the IncompatiblePciDeviceSupportDxe driver is included in the following platforms in edk2: OvmfPkg/AmdSev/AmdSevX64.dsc OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgX64.dsc All those platforms inherit FALSE for "PcdPciDisableBusEnumeration" from "MdeModulePkg.dec". This makes the PcdGetBool() call in the entry point of the driver superfluous; remove it. Clean up now unused dependencies in the INF file as well. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf |= 2 -- OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c |= 10 +++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceS= upport.inf b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceS= upport.inf index f08b6f4bd4b4..c3e6bb944791 100644 --- a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.= inf +++ b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.= inf @@ -17,13 +17,12 @@ [Defines] ENTRY_POINT =3D DriverInitialize =20 [Sources] IncompatiblePciDeviceSupport.c =20 [Packages] - MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] DebugLib MemoryAllocationLib @@ -33,11 +32,10 @@ [LibraryClasses] =20 [Protocols] gEfiIncompatiblePciDeviceSupportProtocolGuid ## SOMETIMES_PRODUCES gEfiLegacyBiosProtocolGuid ## NOTIFY =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration ## CONSUMES gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size ## CONSUMES =20 [Depex] TRUE diff --git a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceS= upport.c b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSup= port.c index 53c768167de9..db1532f10934 100644 --- a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c +++ b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c @@ -263,20 +263,16 @@ DriverInitialize ( { EFI_STATUS Status; EFI_EVENT Event; VOID *Registration; =20 // - // If the PCI Bus driver is not supposed to allocate resources, then it = makes - // no sense to install a protocol that influences the resource allocatio= n. + // If there is no 64-bit PCI MMIO aperture, then 64-bit MMIO BARs have t= o be + // allocated under 4 GB unconditionally. // - // Similarly, if there is no 64-bit PCI MMIO aperture, then 64-bit MMIO = BARs - // have to be allocated under 4 GB unconditionally. - // - if (PcdGetBool (PcdPciDisableBusEnumeration) || - PcdGet64 (PcdPciMmio64Size) =3D=3D 0) { + if (PcdGet64 (PcdPciMmio64Size) =3D=3D 0) { return EFI_UNSUPPORTED; } =20 // // Otherwise, create a protocol notify to see if a CSM is present. (With= the // CSM absent, the PCI Bus driver won't have to worry about allocating 6= 4-bit --=20 2.19.1.3.g30247aa5d201 -=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 (#75698): https://edk2.groups.io/g/devel/message/75698 Mute This Topic: https://groups.io/mt/83110873/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75699+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75699+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061861; cv=none; d=zohomail.com; s=zohoarc; b=hgSpIIhTGrQG1Cl0H2kEa7v+09nxxJJOl04lYmI1CvQm0VegxRA0xIVCmskqBETm7aM71VGfAaOzgVwI/1XaqnAg5HiCcGbMAMw3xwo8gusRaE6/KQpCSYE7rN469uICRpfKQouC3PXRiu/CmwJ2Qiar17oK1aijFxJiQKml4Xg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061861; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=++KhoKdDZhIbDTm7R1ScQE16nAXNw2SJ32hkXF/6qA8=; b=mOiQM3LT8wArXXTltTT/cn9VyFwtzP1X9idMyGvl1ntb9LrImqn/nZ6JqwwiPSzcntyVGQzLgJmYCwik5oBdNOfcqqtTli+lRgvlQTJPJ+7fvRHYgtxRRaT0v19L0ZeMJkgBC/qB0cJcQblYy2siEQEitXm9+UFmD5WceyiaFv8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75699+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622061861513586.0840062308844; Wed, 26 May 2021 13:44:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6BZXYY1788612xPptlOfLjfa; Wed, 26 May 2021 13:44:21 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web09.3259.1622061859641928735 for ; Wed, 26 May 2021 13:44:19 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-296-Ri48rTVsMbORHETAaecJwA-1; Wed, 26 May 2021 16:44:16 -0400 X-MC-Unique: Ri48rTVsMbORHETAaecJwA-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D3E7A6D4F4; Wed, 26 May 2021 20:44:15 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6850B687E4; Wed, 26 May 2021 20:44:14 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 28/43] OvmfPkg/PciHostBridgeLib: consolidate #includes and INF file sections Date: Wed, 26 May 2021 22:14:31 +0200 Message-Id: <20210526201446.12554-29-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: ifiqVtHFAjK5wj4l8JXp6VFmx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061861; bh=++KhoKdDZhIbDTm7R1ScQE16nAXNw2SJ32hkXF/6qA8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=xFrX0Mfp61XfKNKDX5B3YFTZscFNcfBurTk9sxnnrXY8BP2K2MOMnoHgQenUAiFZM7j eHuXHZWKKQ0U67u1LQpRWQHW4cuc/3TzpIV64200D+kNtbjEJJhdIRJnKQFz/wr0PKZgf 7jeJKuDNcW84pXa2FSXiHtPESWCp9FyykNo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" - In every C file, list every necessary public #include individually, with an example identifier that's actually consumed. - Place all public #includes first, all module-private #includes second. Separate them with a single empty line. Keep each section sorted in itself. - Sort all sections in the INF file, except [Defines]. - Add unlisted lib classes. - Remove unnecessary #include directives, add unlisted #include directives. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf | 7 +++--- OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 22 +++++++--------= --- OvmfPkg/Library/PciHostBridgeLib/XenSupport.c | 24 +++++++++------= ----- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/OvmfPk= g/Library/PciHostBridgeLib/PciHostBridgeLib.inf index 4610a0c1490b..622780888472 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -22,32 +22,33 @@ [Defines] # tools. # # VALID_ARCHITECTURES =3D IA32 X64 EBC # =20 [Sources] + PciHostBridge.h PciHostBridgeLib.c XenSupport.c - PciHostBridge.h =20 [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] + BaseLib BaseMemoryLib DebugLib MemoryAllocationLib PcdLib PciHostBridgeUtilityLib PciLib =20 [Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size - gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/= Library/PciHostBridgeLib/PciHostBridgeLib.c index 7d9fb0fb293a..6db91fb7e20c 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -4,29 +4,23 @@ Copyright (C) 2016, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ -#include +#include // PCI_MAX_BUS +#include // INTEL_Q35_MCH_DEV= IC... +#include // ZeroMem() +#include // PcdGet64() +#include // PCI_ROOT_BRIDGE_A= PE... +#include // PciHostBridgeUtil= it... +#include // EFI_PCI_HOST_BRID= GE... +#include // EFI_PCI_ATTRIBUTE= _I... =20 -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include #include "PciHostBridge.h" =20 - STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture =3D { MAX_UINT64, 0 }; =20 =20 /** Return all the root bridge instances in an array. =20 diff --git a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c b/OvmfPkg/Librar= y/PciHostBridgeLib/XenSupport.c index 9ef39f01821b..07c498dd0ea2 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c +++ b/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c @@ -3,27 +3,25 @@ =20 Copyright (c) 2016, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ -#include =20 -#include -#include +#include // EFI_PCI_COMMAND_IO_SPACE +#include // INTEL_Q35_MCH_DEVICE_ID +#include // DisableInterrupts() +#include // ZeroMem() +#include // ASSERT() +#include // ReallocatePool() +#include // PcdGet16() +#include // PCI_ROOT_BRIDGE_APERTURE +#include // PciHostBridgeUtilityInitRo= ot... +#include // PciRead32() +#include // EFI_PCI_ATTRIBUTE_ISA_IO =20 -#include -#include - -#include -#include -#include -#include -#include -#include -#include #include "PciHostBridge.h" =20 STATIC VOID PcatPciRootBridgeBarExisted ( IN UINTN Address, --=20 2.19.1.3.g30247aa5d201 -=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 (#75699): https://edk2.groups.io/g/devel/message/75699 Mute This Topic: https://groups.io/mt/83110898/1787277 Mute #includes:https://edk2.groups.io/g/devel/mutehashtag/includes 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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75700+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75700+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061931; cv=none; d=zohomail.com; s=zohoarc; b=VgJarAYkPhYrW16sJ0Wf8yiITwNynWwTWlH6T/zcL2GatQHcRmecXHjwNixD4KiFg4MhOpQx0047GgPTrWMym1EKLO9SWIAEJo0iO16SMllQ6IEiIE3/v9D9qLQO9XPp7x+FsJQzwPvEFfOARsKey5JliYgb7qFKQkdwZ+mhBDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061931; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=6a5JEKJUp6f1HaSbHfZatEGNb0h7yDFchrhnHrUUBC4=; b=CEf0HuIB7AUgAqnkyMSnbP+f4cGMfapdYzAebZNZ2umxkvByIg6aJVhFrGUVlkQRjtabP5FfK5Ne4Z6M8F87dttOqKSQ8xpv6srGozLB4qdL7y0U6w/Dn+hhjjUfUE4PN7lWeVgkwbB5qUnwG1N6AixS5v+ayt5xGYQOQoUoC40= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75700+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622061931046313.2727940813321; Wed, 26 May 2021 13:45:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UZfkYY1788612xirnImVgpQc; Wed, 26 May 2021 13:45:30 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.3168.1622061924861990098 for ; Wed, 26 May 2021 13:45:25 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-539-7WnQKGe7O3iYMn6T37RM9g-1; Wed, 26 May 2021 16:45:20 -0400 X-MC-Unique: 7WnQKGe7O3iYMn6T37RM9g-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D30DE188E3CA; Wed, 26 May 2021 20:45:18 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0EAEF59466; Wed, 26 May 2021 20:45:16 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , Peter Grehan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rebecca Cran Subject: [edk2-devel] [PATCH 29/43] OvmfPkg/PciHostBridgeLibScan: create from PciHostBridgeLib Date: Wed, 26 May 2021 22:14:32 +0200 Message-Id: <20210526201446.12554-30-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: lgASrhfnh32cTTTxA5nxhMdTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061930; bh=6a5JEKJUp6f1HaSbHfZatEGNb0h7yDFchrhnHrUUBC4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=XNXJMvb5YL5Px2NYDYfYJHWT5PCldmZnUCihIaNif+9TVs34XNgJiiu3APP+swqhmCM Evjvz+ERTlYUT9uSuYFgGTVlcsX+oeitK87UyQ7iRa/m9Q9ajNgv/t4IOfXUpvPFEBN35 wFFTrX5OTVwlVtdtZIAl7UeZhhaVmOFIEQI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Create an almost verbatim copy of the "OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf" library instance. The new PciHostBridgeLibScan instance will ultimately duplicate a negligible amount of code from the original, and will be used by the Bhyve and OvmfXen platforms. List the new driver in "Maintainers.txt", in the "OvmfPkg: bhyve-related modules" and "OvmfPkg: Xen-related modules" sections. This patch should be reviewed with "git show --find-copies-harder". Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Peter Grehan Cc: Philippe Mathieu-Daud=C3=A9 Cc: Rebecca Cran Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/Library/{PciHostBridgeLib/PciHostBridgeLib.inf =3D> PciHostBridgeL= ibScan/PciHostBridgeLibScan.inf} | 6 +++--- Maintainers.txt = | 2 ++ OvmfPkg/Library/{PciHostBridgeLib =3D> PciHostBridgeLibScan}/PciHostBridge= .h | 1 + OvmfPkg/Library/{PciHostBridgeLib =3D> PciHostBridgeLibScan}/PciHostBridge= Lib.c | 2 +- OvmfPkg/Library/{PciHostBridgeLib =3D> PciHostBridgeLibScan}/XenSupport.c = | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/OvmfPk= g/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf similarity index 84% copy from OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf copy to OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf index 622780888472..46859388870f 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf @@ -1,21 +1,21 @@ ## @file # OVMF's instance of the PCI Host Bridge Library. # -# Copyright (C) 2016, Red Hat, Inc. +# Copyright (C) 2016-2021, Red Hat, Inc. # Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # # ## =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D PciHostBridgeLib - FILE_GUID =3D 9F2BC05E-51EA-4AED-9A3E-7699641734E8 + BASE_NAME =3D PciHostBridgeLibScan + FILE_GUID =3D c93f2411-9bf5-4894-b552-67fae0c3d291 MODULE_TYPE =3D DXE_DRIVER VERSION_STRING =3D 1.0 LIBRARY_CLASS =3D PciHostBridgeLib =20 # # The following information is for reference only and not required by the = build diff --git a/Maintainers.txt b/Maintainers.txt index be40a1d6f2b6..a273409a923f 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -432,12 +432,13 @@ OvmfPkg: bhyve-related modules F: OvmfPkg/Bhyve/ F: OvmfPkg/Include/IndustryStandard/Bhyve.h F: OvmfPkg/Include/Library/BhyveFwCtlLib.h F: OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLibBhyve.c F: OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLibBhyve.inf F: OvmfPkg/Library/BhyveFwCtlLib/ +F: OvmfPkg/Library/PciHostBridgeLibScan/ F: OvmfPkg/Library/PlatformBootManagerLibBhyve/ F: OvmfPkg/Library/ResetSystemLib/BaseResetShutdownBhyve.c F: OvmfPkg/Library/ResetSystemLib/BaseResetSystemLibBhyve.inf R: Rebecca Cran R: Peter Grehan =20 @@ -490,12 +491,13 @@ F: OvmfPkg/Include/IndustryStandard/Xen/ F: OvmfPkg/Include/Library/XenHypercallLib.h F: OvmfPkg/Include/Library/XenIoMmioLib.h F: OvmfPkg/Include/Library/XenPlatformLib.h F: OvmfPkg/Include/Protocol/XenBus.h F: OvmfPkg/Include/Protocol/XenIo.h F: OvmfPkg/Library/PciHostBridgeLib/XenSupport.c +F: OvmfPkg/Library/PciHostBridgeLibScan/ F: OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c F: OvmfPkg/Library/XenConsoleSerialPortLib/ F: OvmfPkg/Library/XenHypercallLib/ F: OvmfPkg/Library/XenIoMmioLib/ F: OvmfPkg/Library/XenPlatformLib/ F: OvmfPkg/Library/XenRealTimeClockLib/ diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h b/OvmfPkg/Lib= rary/PciHostBridgeLibScan/PciHostBridge.h similarity index 83% copy from OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h copy to OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridge.h index a2e4d8696281..582b7929aff2 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridge.h @@ -1,9 +1,10 @@ /** @file Header file of OVMF instance of PciHostBridgeLib. =20 + Copyright (C) 2021, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/= Library/PciHostBridgeLibScan/PciHostBridgeLib.c similarity index 95% copy from OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c copy to OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c index 6db91fb7e20c..6c2acc9f99bc 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c @@ -1,10 +1,10 @@ /** @file OVMF's instance of the PCI Host Bridge Library. =20 - Copyright (C) 2016, Red Hat, Inc. + Copyright (C) 2016-2021, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ #include // PCI_MAX_BUS diff --git a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c b/OvmfPkg/Librar= y/PciHostBridgeLibScan/XenSupport.c similarity index 96% copy from OvmfPkg/Library/PciHostBridgeLib/XenSupport.c copy to OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c index 07c498dd0ea2..a4a61e5836e0 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c +++ b/OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c @@ -1,9 +1,10 @@ /** @file Scan the entire PCI bus for root bridges to support OVMF above Xen. =20 + Copyright (C) 2021, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 --=20 2.19.1.3.g30247aa5d201 -=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 (#75700): https://edk2.groups.io/g/devel/message/75700 Mute This Topic: https://groups.io/mt/83110927/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75701+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75701+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622061992; cv=none; d=zohomail.com; s=zohoarc; b=Ns3De3UHBZuvapQHGYWkdosX1E63MPipnJasGgtamXhS0T8IfbM+Xmz7GyqpDm5Ws2yF8saaLWb8Z3xv1RJbhBg8jzEa7/Uwi39n47mJnwfMvsEWiWq1eEP1N3NO8Tx3poGOV23vv9pzfN7FipLU3Mlib0mrkHU86oae5zaP7NA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622061992; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=hC8oMeDyynze+VXhKALTF7XPDozsMUpAQCBth6EBQ+A=; b=jvmf65YRChmS6LcZKZLsGNvw7gpY8ltzA2U4gQ7I6daFBP8DKR8OTbY5v52gOznWGlLgj4AG6F9Gzz9uefM92mL/INDaNFnijoQE3vPmoSY8DiwShbaMHeij40vCtHA9Hj5ZuizKfJruSgZbz+fK/2Wno8AEHjzc/wSGPelgS8I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75701+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622061992872480.0408850582065; Wed, 26 May 2021 13:46:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id oPwfYY1788612x3JmduMzIh7; Wed, 26 May 2021 13:46:32 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.3181.1622061986983568861 for ; Wed, 26 May 2021 13:46:27 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-252-RR1jonWkPAeinRdXlabVhQ-1; Wed, 26 May 2021 16:46:22 -0400 X-MC-Unique: RR1jonWkPAeinRdXlabVhQ-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9109B107ACCA; Wed, 26 May 2021 20:46:21 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1FC3159469; Wed, 26 May 2021 20:46:19 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , Peter Grehan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rebecca Cran Subject: [edk2-devel] [PATCH 30/43] OvmfPkg/Bhyve: consume PciHostBridgeLibScan Date: Wed, 26 May 2021 22:14:33 +0200 Message-Id: <20210526201446.12554-31-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: GqP2VVfkdu6wz4OauUfLTETrx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622061992; bh=hC8oMeDyynze+VXhKALTF7XPDozsMUpAQCBth6EBQ+A=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=ucsR68t0Sa61YBMUtTwdHdfKEpANGGxvLVpTN4zZmynyTWQrmFo4jrWKBBQDNKmOV// ib8NNbJimNq3v/l8H24RgYgKLnYm1oUV0xJsSniNImQXjXCP0HQYVwVcjQlW8DqoTs7jE dt6WiaoKN1bBeixmUrmlhvoYJW46t/+/86o= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Switch the Bhyve platform from the "OvmfPkg/PciHostBridgeLib" instance to the "OvmfPkg/PciHostBridgeLibScan" instance. Currently this is a no-op functionally; we'll customize the "PciHostBridgeLibScan" instance later. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Peter Grehan Cc: Philippe Mathieu-Daud=C3=A9 Cc: Rebecca Cran Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude Reviewed-by: Rebecca Cran --- OvmfPkg/Bhyve/BhyveX64.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index 30a99e2a3425..d8792812ab21 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -663,13 +663,13 @@ [Components] UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf UefiCpuPkg/CpuDxe/CpuDxe.inf PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf { - PciHostBridgeLib|OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.i= nf + PciHostBridgeLib|OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeL= ibScan.inf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciH= ostBridgeUtilityLib.inf NULL|OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf } MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf --=20 2.19.1.3.g30247aa5d201 -=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 (#75701): https://edk2.groups.io/g/devel/message/75701 Mute This Topic: https://groups.io/mt/83110944/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75702+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75702+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062051; cv=none; d=zohomail.com; s=zohoarc; b=GKGu79EDVmKx3gwTAfoAlhhUE5r97uY8QpxvMqgCarh2akFETK8/1husQ6eq7rBMq0Vh2IkPnCky1zropDFr8EznW2xK37/XVRdV5xIlc3cHNcXamO0DYc0WRtRWQAD6uA/xji5crKcRSN8+AJzQ5IxAGifWugLxoT4LLQF2WIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062051; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=pRzzA2z7RvB8Zp2S08pm+OnTMXZl828+ULxyuxiJ7uQ=; b=dwa/ojwqGXHk24XsK6pESfbyPdvktGToemGrPhC9D51b8CH20e8w/IbtyOl+NRPSJZoc/FJBWe/M21I5h6PX0lkGU6bQ6A40fi5S8vVceOdhJWMWkNWHfELL2+QA5LHPqAsCu0XznWhHtbUUYQjlSAjnay6Zo/so/sfyoRdx4Uc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75702+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062051475517.4050874666469; Wed, 26 May 2021 13:47:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id nwRnYY1788612xdmVV2SAWaC; Wed, 26 May 2021 13:47:30 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web08.3259.1622062050244603908 for ; Wed, 26 May 2021 13:47:30 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-103-yMT0Olt5NEC3cvUIOlCpOQ-1; Wed, 26 May 2021 16:47:25 -0400 X-MC-Unique: yMT0Olt5NEC3cvUIOlCpOQ-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E9F91020C2E; Wed, 26 May 2021 20:47:24 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id C27395D6D3; Wed, 26 May 2021 20:47:22 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 31/43] OvmfPkg/OvmfXen: consume PciHostBridgeLibScan Date: Wed, 26 May 2021 22:14:34 +0200 Message-Id: <20210526201446.12554-32-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: 8rlQmyo6amDeghwzKm20ryOJx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062050; bh=pRzzA2z7RvB8Zp2S08pm+OnTMXZl828+ULxyuxiJ7uQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=XisZB8k0G9vgcn3ISVC07/2F4xQf5cm22jTAmmSH/S80fBhdiFBzca84azxu/etnouR hNc4Y6xsC8MY+oMnoC33ww49TTjBv1S6yVwyTBVUXG2933M7mb5hXoXZsH5Ev+rdUtkRo Tl+jO5T1u5QOB2D3fB6Q+r16OVUnAMwTEcU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Switch the OvmfXen platform from the "OvmfPkg/PciHostBridgeLib" instance to the "OvmfPkg/PciHostBridgeLibScan" instance. Currently this is a no-op functionally; we'll customize the "PciHostBridgeLibScan" instance later. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/OvmfXen.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 2d32c5734fa7..0986d9f5c356 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -554,13 +554,13 @@ [Components] OvmfPkg/XenTimerDxe/XenTimerDxe.inf UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf UefiCpuPkg/CpuDxe/CpuDxe.inf OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf { - PciHostBridgeLib|OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.i= nf + PciHostBridgeLib|OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeL= ibScan.inf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciH= ostBridgeUtilityLib.inf NULL|OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf } MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf --=20 2.19.1.3.g30247aa5d201 -=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 (#75702): https://edk2.groups.io/g/devel/message/75702 Mute This Topic: https://groups.io/mt/83110963/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75703+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75703+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062127; cv=none; d=zohomail.com; s=zohoarc; b=LCKBmaXISZeFjJAKkMZj5Z4HxjnTgTnl65yeA6xErCzPYit97T5B2tPJm/IY3MbaplRP2Slcu3S85y/sFQNirmEVTE0Yj8b7hLRnNzVenb11QFRlAgDkNU7QMIzoCTXvStkbNYPBFNLPS49UBY3iUa23P7dmsPY/6SOly618Ank= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062127; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=TUqIZEk+vDF0yP8ImRj83/fgVyDkHMIFw7C9VTJFofo=; b=C6wBj7F5HSoOQiW6vi344tabCYXSbCjGOPS/r1wDc05kQSVx2n2bguTp1amJf4kohL748ndgNoyhwWIUScswmXWFX0q15/4Zm2RybDn+WWEwEi+dV4TzBqrrAyKdDAPpa0l0F2VpqVeNFLv2Jc0yxggUtzFAZXduknbikTlLiMc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75703+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206212760426.650787394229837; Wed, 26 May 2021 13:48:47 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ThVbYY1788612xp60LX1Rrcd; Wed, 26 May 2021 13:48:47 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.3228.1622062125647598786 for ; Wed, 26 May 2021 13:48:45 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-494-eOQMj-NAOe-xMWCaIukHTA-1; Wed, 26 May 2021 16:48:41 -0400 X-MC-Unique: eOQMj-NAOe-xMWCaIukHTA-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9E0001075F28; Wed, 26 May 2021 20:48:27 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81AC579535; Wed, 26 May 2021 20:48:25 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Andrew Fish , Ard Biesheuvel , Jordan Justen , Leif Lindholm , Michael D Kinney , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 32/43] OvmfPkg/PciHostBridgeLib: remove Bhyve and Xen support Date: Wed, 26 May 2021 22:14:35 +0200 Message-Id: <20210526201446.12554-33-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: gHMxAukezGBPXbqEFzd9nmILx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062127; bh=TUqIZEk+vDF0yP8ImRj83/fgVyDkHMIFw7C9VTJFofo=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=pc93qVJHqMmAS4JvcE9h6mkH2Ld1JGgtSGoTD8Hy/alM0ie0KpqL9/g2va9bSVnhZED Z1WtM2mk/jknpGz++RB3D7Wr0qk/z5pxa7WNS9twBG62W3VzNETxeO1IOy0/AqPqwy4lJ XTT06ZAxLBfmUp0XVr3W2CAgPcvwlhwbe44= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The "OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf" instance is used by the following platforms in edk2: OvmfPkg/AmdSev/AmdSevX64.dsc OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgX64.dsc All these platforms statically inherit PcdPciDisableBusEnumeration=3DFALSE from "MdeModulePkg.dec". Remove the the PCD and everything that depends on it from the PciHostBridgeLib instance. Namely, remove the logic that determines the root bridge apertures by (a) scanning the entire bus, device and function number space, and (b) parsing the BAR values that were pre-set by the Bhyve or Xen machinery. "XenSupport.c" used to be listed explicitly in "Maintainers.txt", remove it from that spot too. Cc: Andrew Fish Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Leif Lindholm Cc: Michael D Kinney Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf | 7 - Maintainers.txt | 1 - OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h | 13 - OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 6 - OvmfPkg/Library/PciHostBridgeLib/XenSupport.c | 471 --------------= ------ 5 files changed, 498 deletions(-) diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/OvmfPk= g/Library/PciHostBridgeLib/PciHostBridgeLib.inf index 622780888472..f9f182557453 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -22,32 +22,25 @@ [Defines] # tools. # # VALID_ARCHITECTURES =3D IA32 X64 EBC # =20 [Sources] - PciHostBridge.h PciHostBridgeLib.c - XenSupport.c =20 [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] - BaseLib BaseMemoryLib - DebugLib - MemoryAllocationLib PcdLib PciHostBridgeUtilityLib - PciLib =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base diff --git a/Maintainers.txt b/Maintainers.txt index a273409a923f..e5f419e67f0c 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -490,13 +490,12 @@ F: OvmfPkg/Include/Guid/XenInfo.h F: OvmfPkg/Include/IndustryStandard/Xen/ F: OvmfPkg/Include/Library/XenHypercallLib.h F: OvmfPkg/Include/Library/XenIoMmioLib.h F: OvmfPkg/Include/Library/XenPlatformLib.h F: OvmfPkg/Include/Protocol/XenBus.h F: OvmfPkg/Include/Protocol/XenIo.h -F: OvmfPkg/Library/PciHostBridgeLib/XenSupport.c F: OvmfPkg/Library/PciHostBridgeLibScan/ F: OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c F: OvmfPkg/Library/XenConsoleSerialPortLib/ F: OvmfPkg/Library/XenHypercallLib/ F: OvmfPkg/Library/XenIoMmioLib/ F: OvmfPkg/Library/XenPlatformLib/ diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h b/OvmfPkg/Lib= rary/PciHostBridgeLib/PciHostBridge.h deleted file mode 100644 index a2e4d8696281..000000000000 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h +++ /dev/null @@ -1,13 +0,0 @@ -/** @file - Header file of OVMF instance of PciHostBridgeLib. - - Copyright (c) 2016, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -PCI_ROOT_BRIDGE * -ScanForRootBridges ( - UINTN *NumberOfRootBridges -); diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/= Library/PciHostBridgeLib/PciHostBridgeLib.c index 6db91fb7e20c..835efffccaf5 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -13,14 +13,12 @@ #include // PcdGet64() #include // PCI_ROOT_BRIDGE_A= PE... #include // PciHostBridgeUtil= it... #include // EFI_PCI_HOST_BRID= GE... #include // EFI_PCI_ATTRIBUTE= _I... =20 -#include "PciHostBridge.h" - STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture =3D { MAX_UINT64, 0 }; =20 =20 /** Return all the root bridge instances in an array. =20 @@ -39,16 +37,12 @@ PciHostBridgeGetRootBridges ( UINT64 Attributes; UINT64 AllocationAttributes; PCI_ROOT_BRIDGE_APERTURE Io; PCI_ROOT_BRIDGE_APERTURE Mem; PCI_ROOT_BRIDGE_APERTURE MemAbove4G; =20 - if (PcdGetBool (PcdPciDisableBusEnumeration)) { - return ScanForRootBridges (Count); - } - ZeroMem (&Io, sizeof (Io)); ZeroMem (&Mem, sizeof (Mem)); ZeroMem (&MemAbove4G, sizeof (MemAbove4G)); =20 Attributes =3D EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO | EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO | diff --git a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c b/OvmfPkg/Librar= y/PciHostBridgeLib/XenSupport.c deleted file mode 100644 index 07c498dd0ea2..000000000000 --- a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c +++ /dev/null @@ -1,471 +0,0 @@ -/** @file - Scan the entire PCI bus for root bridges to support OVMF above Xen. - - Copyright (c) 2016, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include // EFI_PCI_COMMAND_IO_SPACE -#include // INTEL_Q35_MCH_DEVICE_ID -#include // DisableInterrupts() -#include // ZeroMem() -#include // ASSERT() -#include // ReallocatePool() -#include // PcdGet16() -#include // PCI_ROOT_BRIDGE_APERTURE -#include // PciHostBridgeUtilityInitRo= ot... -#include // PciRead32() -#include // EFI_PCI_ATTRIBUTE_ISA_IO - -#include "PciHostBridge.h" - -STATIC -VOID -PcatPciRootBridgeBarExisted ( - IN UINTN Address, - OUT UINT32 *OriginalValue, - OUT UINT32 *Value - ) -{ - // - // Preserve the original value - // - *OriginalValue =3D PciRead32 (Address); - - // - // Disable timer interrupt while the BAR is probed - // - DisableInterrupts (); - - PciWrite32 (Address, 0xFFFFFFFF); - *Value =3D PciRead32 (Address); - PciWrite32 (Address, *OriginalValue); - - // - // Enable interrupt - // - EnableInterrupts (); -} - -#define PCI_COMMAND_DECODE ((UINT16)(EFI_PCI_COMMAND_IO_SPACE | \ - EFI_PCI_COMMAND_MEMORY_SPACE)) -STATIC -VOID -PcatPciRootBridgeDecodingDisable ( - IN UINTN Address - ) -{ - UINT16 Value; - - Value =3D PciRead16 (Address); - if (Value & PCI_COMMAND_DECODE) { - PciWrite16 (Address, Value & ~(UINT32)PCI_COMMAND_DECODE); - } -} - -STATIC -VOID -PcatPciRootBridgeParseBars ( - IN UINT16 Command, - IN UINTN Bus, - IN UINTN Device, - IN UINTN Function, - IN UINTN BarOffsetBase, - IN UINTN BarOffsetEnd, - IN PCI_ROOT_BRIDGE_APERTURE *Io, - IN PCI_ROOT_BRIDGE_APERTURE *Mem, - IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G - -) -{ - UINT32 OriginalValue; - UINT32 Value; - UINT32 OriginalUpperValue; - UINT32 UpperValue; - UINT64 Mask; - UINTN Offset; - UINT64 Base; - UINT64 Length; - UINT64 Limit; - PCI_ROOT_BRIDGE_APERTURE *MemAperture; - - // Disable address decoding for every device before OVMF starts sizing it - PcatPciRootBridgeDecodingDisable ( - PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET) - ); - - for (Offset =3D BarOffsetBase; Offset < BarOffsetEnd; Offset +=3D sizeof= (UINT32)) { - PcatPciRootBridgeBarExisted ( - PCI_LIB_ADDRESS (Bus, Device, Function, Offset), - &OriginalValue, &Value - ); - if (Value =3D=3D 0) { - continue; - } - if ((Value & BIT0) =3D=3D BIT0) { - // - // IO Bar - // - if (Command & EFI_PCI_COMMAND_IO_SPACE) { - Mask =3D 0xfffffffc; - Base =3D OriginalValue & Mask; - Length =3D ((~(Value & Mask)) & Mask) + 0x04; - if (!(Value & 0xFFFF0000)) { - Length &=3D 0x0000FFFF; - } - Limit =3D Base + Length - 1; - - if (Base < Limit) { - if (Io->Base > Base) { - Io->Base =3D Base; - } - if (Io->Limit < Limit) { - Io->Limit =3D Limit; - } - } - } - } else { - // - // Mem Bar - // - if (Command & EFI_PCI_COMMAND_MEMORY_SPACE) { - - Mask =3D 0xfffffff0; - Base =3D OriginalValue & Mask; - Length =3D Value & Mask; - - if ((Value & (BIT1 | BIT2)) =3D=3D 0) { - // - // 32bit - // - Length =3D ((~Length) + 1) & 0xffffffff; - - MemAperture =3D Mem; - } else { - // - // 64bit - // - Offset +=3D 4; - PcatPciRootBridgeBarExisted ( - PCI_LIB_ADDRESS (Bus, Device, Function, Offset), - &OriginalUpperValue, - &UpperValue - ); - - Base =3D Base | LShiftU64 ((UINT64) OriginalUpperValue, 32); - Length =3D Length | LShiftU64 ((UINT64) UpperValue, 32); - Length =3D (~Length) + 1; - - if (Base < BASE_4GB) { - MemAperture =3D Mem; - } else { - MemAperture =3D MemAbove4G; - } - } - - Limit =3D Base + Length - 1; - if (Base < Limit) { - if (MemAperture->Base > Base) { - MemAperture->Base =3D Base; - } - if (MemAperture->Limit < Limit) { - MemAperture->Limit =3D Limit; - } - } - } - } - } -} - -STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture =3D { MAX_UINT64, 0 }; - -PCI_ROOT_BRIDGE * -ScanForRootBridges ( - UINTN *NumberOfRootBridges - ) -{ - UINTN PrimaryBus; - UINTN SubBus; - UINT8 Device; - UINT8 Function; - UINTN NumberOfDevices; - UINTN Address; - PCI_TYPE01 Pci; - UINT64 Attributes; - UINT64 Base; - UINT64 Limit; - UINT64 Value; - PCI_ROOT_BRIDGE_APERTURE Io, Mem, MemAbove4G, *MemAperture; - PCI_ROOT_BRIDGE *RootBridges; - UINTN BarOffsetEnd; - - - *NumberOfRootBridges =3D 0; - RootBridges =3D NULL; - - // - // After scanning all the PCI devices on the PCI root bridge's primary b= us, - // update the Primary Bus Number for the next PCI root bridge to be this= PCI - // root bridge's subordinate bus number + 1. - // - for (PrimaryBus =3D 0; PrimaryBus <=3D PCI_MAX_BUS; PrimaryBus =3D SubBu= s + 1) { - SubBus =3D PrimaryBus; - Attributes =3D 0; - - ZeroMem (&Io, sizeof (Io)); - ZeroMem (&Mem, sizeof (Mem)); - ZeroMem (&MemAbove4G, sizeof (MemAbove4G)); - Io.Base =3D Mem.Base =3D MemAbove4G.Base =3D MAX_UINT64; - // - // Scan all the PCI devices on the primary bus of the PCI root bridge - // - for (Device =3D 0, NumberOfDevices =3D 0; Device <=3D PCI_MAX_DEVICE; = Device++) { - - for (Function =3D 0; Function <=3D PCI_MAX_FUNC; Function++) { - - // - // Compute the PCI configuration address of the PCI device to probe - // - Address =3D PCI_LIB_ADDRESS (PrimaryBus, Device, Function, 0); - - // - // Read the Vendor ID from the PCI Configuration Header - // - if (PciRead16 (Address) =3D=3D MAX_UINT16) { - if (Function =3D=3D 0) { - // - // If the PCI Configuration Read fails, or a PCI device does n= ot - // exist, then skip this entire PCI device - // - break; - } else { - // - // If PCI function !=3D 0, VendorId =3D=3D 0xFFFF, we continue= to search - // PCI function. - // - continue; - } - } - - // - // Read the entire PCI Configuration Header - // - PciReadBuffer (Address, sizeof (Pci), &Pci); - - // - // Increment the number of PCI device found on the primary bus of = the - // PCI root bridge - // - NumberOfDevices++; - - // - // Look for devices with the VGA Palette Snoop enabled in the COMM= AND - // register of the PCI Config Header - // - if ((Pci.Hdr.Command & EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) !=3D 0) { - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16; - } - - BarOffsetEnd =3D 0; - - // - // PCI-PCI Bridge - // - if (IS_PCI_BRIDGE (&Pci)) { - // - // Get the Bus range that the PPB is decoding - // - if (Pci.Bridge.SubordinateBus > SubBus) { - // - // If the subordinate bus number of the PCI-PCI bridge is grea= ter - // than the PCI root bridge's current subordinate bus number, - // then update the PCI root bridge's subordinate bus number - // - SubBus =3D Pci.Bridge.SubordinateBus; - } - - // - // Get the I/O range that the PPB is decoding - // - Value =3D Pci.Bridge.IoBase & 0x0f; - Base =3D ((UINT32) Pci.Bridge.IoBase & 0xf0) << 8; - Limit =3D (((UINT32) Pci.Bridge.IoLimit & 0xf0) << 8) | 0x0fff; - if (Value =3D=3D BIT0) { - Base |=3D ((UINT32) Pci.Bridge.IoBaseUpper16 << 16); - Limit |=3D ((UINT32) Pci.Bridge.IoLimitUpper16 << 16); - } - if (Base < Limit) { - if (Io.Base > Base) { - Io.Base =3D Base; - } - if (Io.Limit < Limit) { - Io.Limit =3D Limit; - } - } - - // - // Get the Memory range that the PPB is decoding - // - Base =3D ((UINT32) Pci.Bridge.MemoryBase & 0xfff0) << 16; - Limit =3D (((UINT32) Pci.Bridge.MemoryLimit & 0xfff0) << 16) | 0= xfffff; - if (Base < Limit) { - if (Mem.Base > Base) { - Mem.Base =3D Base; - } - if (Mem.Limit < Limit) { - Mem.Limit =3D Limit; - } - } - - // - // Get the Prefetchable Memory range that the PPB is decoding - // and merge it into Memory range - // - Value =3D Pci.Bridge.PrefetchableMemoryBase & 0x0f; - Base =3D ((UINT32) Pci.Bridge.PrefetchableMemoryBase & 0xfff0) <= < 16; - Limit =3D (((UINT32) Pci.Bridge.PrefetchableMemoryLimit & 0xfff0) - << 16) | 0xfffff; - MemAperture =3D &Mem; - if (Value =3D=3D BIT0) { - Base |=3D LShiftU64 (Pci.Bridge.PrefetchableBaseUpper32, 32); - Limit |=3D LShiftU64 (Pci.Bridge.PrefetchableLimitUpper32, 32); - MemAperture =3D &MemAbove4G; - } - if (Base < Limit) { - if (MemAperture->Base > Base) { - MemAperture->Base =3D Base; - } - if (MemAperture->Limit < Limit) { - MemAperture->Limit =3D Limit; - } - } - - // - // Look at the PPB Configuration for legacy decoding attributes - // - if ((Pci.Bridge.BridgeControl & EFI_PCI_BRIDGE_CONTROL_ISA) - =3D=3D EFI_PCI_BRIDGE_CONTROL_ISA) { - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_IO_16; - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO; - } - if ((Pci.Bridge.BridgeControl & EFI_PCI_BRIDGE_CONTROL_VGA) - =3D=3D EFI_PCI_BRIDGE_CONTROL_VGA) { - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_MEMORY; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_IO; - if ((Pci.Bridge.BridgeControl & EFI_PCI_BRIDGE_CONTROL_VGA_16) - !=3D 0) { - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_IO_16; - } - } - - BarOffsetEnd =3D OFFSET_OF (PCI_TYPE01, Bridge.Bar[2]); - } else { - // - // Parse the BARs of the PCI device to get what I/O Ranges, Memo= ry - // Ranges, and Prefetchable Memory Ranges the device is decoding - // - if ((Pci.Hdr.HeaderType & HEADER_LAYOUT_CODE) =3D=3D HEADER_TYPE= _DEVICE) { - BarOffsetEnd =3D OFFSET_OF (PCI_TYPE00, Device.Bar[6]); - } - } - - PcatPciRootBridgeParseBars ( - Pci.Hdr.Command, - PrimaryBus, - Device, - Function, - OFFSET_OF (PCI_TYPE00, Device.Bar), - BarOffsetEnd, - &Io, - &Mem, &MemAbove4G - ); - - // - // See if the PCI device is an IDE controller - // - if (IS_CLASS2 (&Pci, PCI_CLASS_MASS_STORAGE, - PCI_CLASS_MASS_STORAGE_IDE)) { - if (Pci.Hdr.ClassCode[0] & 0x80) { - Attributes |=3D EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO; - } - if (Pci.Hdr.ClassCode[0] & 0x01) { - Attributes |=3D EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO; - } - if (Pci.Hdr.ClassCode[0] & 0x04) { - Attributes |=3D EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO; - } - } - - // - // See if the PCI device is a legacy VGA controller or - // a standard VGA controller - // - if (IS_CLASS2 (&Pci, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA) || - IS_CLASS2 (&Pci, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA) - ) { - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_MEMORY; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_IO_16; - } - - // - // See if the PCI Device is a PCI - ISA or PCI - EISA - // or ISA_POSITIVE_DECODE Bridge device - // - if (Pci.Hdr.ClassCode[2] =3D=3D PCI_CLASS_BRIDGE) { - if (Pci.Hdr.ClassCode[1] =3D=3D PCI_CLASS_BRIDGE_ISA || - Pci.Hdr.ClassCode[1] =3D=3D PCI_CLASS_BRIDGE_EISA || - Pci.Hdr.ClassCode[1] =3D=3D PCI_CLASS_BRIDGE_ISA_PDECODE) { - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_IO_16; - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO; - } - } - - // - // If this device is not a multi function device, then skip the re= st - // of this PCI device - // - if (Function =3D=3D 0 && !IS_PCI_MULTI_FUNC (&Pci)) { - break; - } - } - } - - // - // If at least one PCI device was found on the primary bus of this PCI - // root bridge, then the PCI root bridge exists. - // - if (NumberOfDevices > 0) { - RootBridges =3D ReallocatePool ( - (*NumberOfRootBridges) * sizeof (PCI_ROOT_BRIDGE), - (*NumberOfRootBridges + 1) * sizeof (PCI_ROOT_BRIDGE), - RootBridges - ); - ASSERT (RootBridges !=3D NULL); - PciHostBridgeUtilityInitRootBridge ( - Attributes, Attributes, 0, - FALSE, PcdGet16 (PcdOvmfHostBridgePciDevId) !=3D INTEL_Q35_MCH_DEV= ICE_ID, - (UINT8) PrimaryBus, (UINT8) SubBus, - &Io, &Mem, &MemAbove4G, &mNonExistAperture, &mNonExistAperture, - &RootBridges[*NumberOfRootBridges] - ); - RootBridges[*NumberOfRootBridges].ResourceAssigned =3D TRUE; - // - // Increment the index for the next PCI Root Bridge - // - (*NumberOfRootBridges)++; - } - } - - return RootBridges; -} --=20 2.19.1.3.g30247aa5d201 -=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 (#75703): https://edk2.groups.io/g/devel/message/75703 Mute This Topic: https://groups.io/mt/83110982/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75704+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75704+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062181; cv=none; d=zohomail.com; s=zohoarc; b=e4evSfiGFj0U2oETlbnjchqxLGWlC+PHBYYmW4vVq5mQWpPqbjlT+RYHMZ36cQX5hY+i36Dd2ygjBd7UpicZktHrVlCEW8dBWWteqUoKmF7+vvlcr/oUJHaYTgoqnLT9Ddm8SEI9vhZ7XWn/Gw5QzBJeRcwQXqzaaIocYCXVlA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062181; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=EyN1982TJIlBnH6xPBe2QqSBTMz/bIGPpMIeqVEkKwE=; b=aSn1VeyAPJ5uwLr3LwaaNGzON8s22+XAQG6CjCqPcwpoXZIqfgUkGzyFg+CmyMND1ZS+fNJ1cdzmvFB1xBjLKTRiYZGAuL0UYJdeReFwwbNs1QT6SfgpIhYqa+FzIPr/aSA46JEVJOmTrbDM0E9BDg5h6TjMIfLcFx9aSfWRoQI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75704+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062181791703.9516923538941; Wed, 26 May 2021 13:49:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id M7x0YY1788612xHLITuDcfBn; Wed, 26 May 2021 13:49:41 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.3244.1622062175841630487 for ; Wed, 26 May 2021 13:49:36 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-38-BSv55bihNwaWKqflACJZvQ-1; Wed, 26 May 2021 16:49:32 -0400 X-MC-Unique: BSv55bihNwaWKqflACJZvQ-1 X-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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id BCFF91009E3F; Wed, 26 May 2021 20:49:30 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD04E61156; Wed, 26 May 2021 20:49:28 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , Peter Grehan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rebecca Cran Subject: [edk2-devel] [PATCH 33/43] OvmfPkg/PciHostBridgeLibScan: remove QEMU (fw_cfg) support Date: Wed, 26 May 2021 22:14:36 +0200 Message-Id: <20210526201446.12554-34-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: TgdPPelE3XhfUAyTkN1Rz7gZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062181; bh=EyN1982TJIlBnH6xPBe2QqSBTMz/bIGPpMIeqVEkKwE=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=PORMPaRV1JIbRhrXWO47XKgJ/mD4j3Jpz9alRARkNfjFuvmqiHd1dm5iQ+Frc6CasDK wFVjNjFdHSF0T9APNlq+1CNx/9szIR0J8L2SklM8Bu5jh3Ig04msABHPcYuHmOhnsrCMn iTtAysu5DkT6YhuAG+W7dCZWm97PMqAwBXc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The "OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf" instance is used in the following platforms in edk2: OvmfPkg/Bhyve/BhyveX64.dsc OvmfPkg/OvmfXen.dsc Both platforms define "PcdPciDisableBusEnumeration" with Fixed-at-Build access method, and TRUE value. Remove the PCD from the PciHostBridgeLibScan instance, and everything else that is useful only when the PCD is FALSE. In practice, this removes the PciHostBridgeUtilityGetRootBridges() function call, which is based on fw-cfg; see "OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c". (Note that the dependency on PciHostBridgeUtilityLib remains in place, given that the PciHostBridgeLibScan instance continues using lower-level functions from the library that do not depend on fw-cfg.) Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Peter Grehan Cc: Philippe Mathieu-Daud=C3=A9 Cc: Rebecca Cran Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf | 7 --- OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c | 63 +------= ------------- 2 files changed, 2 insertions(+), 68 deletions(-) diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf = b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf index 46859388870f..1ba880be6782 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf @@ -41,14 +41,7 @@ [LibraryClasses] MemoryAllocationLib PcdLib PciHostBridgeUtilityLib PciLib =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId - gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase - gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize - gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base - gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size - gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base - gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c b/Ovmf= Pkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c index 6c2acc9f99bc..f0166e0f7279 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c @@ -4,26 +4,17 @@ Copyright (C) 2016-2021, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ -#include // PCI_MAX_BUS -#include // INTEL_Q35_MCH_DEV= IC... -#include // ZeroMem() -#include // PcdGet64() -#include // PCI_ROOT_BRIDGE_A= PE... +#include // PCI_ROOT_BRIDGE #include // PciHostBridgeUtil= it... -#include // EFI_PCI_HOST_BRID= GE... -#include // EFI_PCI_ATTRIBUTE= _I... =20 #include "PciHostBridge.h" =20 -STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture =3D { MAX_UINT64, 0 }; - - /** Return all the root bridge instances in an array. =20 @param Count Return the count of root bridge instances. =20 @return All the root bridge instances in an array. @@ -33,63 +24,13 @@ STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture =3D {= MAX_UINT64, 0 }; PCI_ROOT_BRIDGE * EFIAPI PciHostBridgeGetRootBridges ( UINTN *Count ) { - UINT64 Attributes; - UINT64 AllocationAttributes; - PCI_ROOT_BRIDGE_APERTURE Io; - PCI_ROOT_BRIDGE_APERTURE Mem; - PCI_ROOT_BRIDGE_APERTURE MemAbove4G; - - if (PcdGetBool (PcdPciDisableBusEnumeration)) { - return ScanForRootBridges (Count); - } - - ZeroMem (&Io, sizeof (Io)); - ZeroMem (&Mem, sizeof (Mem)); - ZeroMem (&MemAbove4G, sizeof (MemAbove4G)); - - Attributes =3D EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO | - EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO | - EFI_PCI_ATTRIBUTE_ISA_IO_16 | - EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO | - EFI_PCI_ATTRIBUTE_VGA_MEMORY | - EFI_PCI_ATTRIBUTE_VGA_IO_16 | - EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16; - - AllocationAttributes =3D EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM; - if (PcdGet64 (PcdPciMmio64Size) > 0) { - AllocationAttributes |=3D EFI_PCI_HOST_BRIDGE_MEM64_DECODE; - MemAbove4G.Base =3D PcdGet64 (PcdPciMmio64Base); - MemAbove4G.Limit =3D PcdGet64 (PcdPciMmio64Base) + - PcdGet64 (PcdPciMmio64Size) - 1; - } else { - CopyMem (&MemAbove4G, &mNonExistAperture, sizeof (mNonExistAperture)); - } - - Io.Base =3D PcdGet64 (PcdPciIoBase); - Io.Limit =3D PcdGet64 (PcdPciIoBase) + (PcdGet64 (PcdPciIoSize) - 1); - Mem.Base =3D PcdGet64 (PcdPciMmio32Base); - Mem.Limit =3D PcdGet64 (PcdPciMmio32Base) + (PcdGet64 (PcdPciMmio32Size)= - 1); - - return PciHostBridgeUtilityGetRootBridges ( - Count, - Attributes, - AllocationAttributes, - FALSE, - PcdGet16 (PcdOvmfHostBridgePciDevId) !=3D INTEL_Q35_MCH_DEVICE_ID, - 0, - PCI_MAX_BUS, - &Io, - &Mem, - &MemAbove4G, - &mNonExistAperture, - &mNonExistAperture - ); + return ScanForRootBridges (Count); } =20 =20 /** Free the root bridge instances array returned from PciHostBridgeGetRootBridges(). --=20 2.19.1.3.g30247aa5d201 -=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 (#75704): https://edk2.groups.io/g/devel/message/75704 Mute This Topic: https://groups.io/mt/83111003/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75705+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75705+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062245; cv=none; d=zohomail.com; s=zohoarc; b=bdzkU+4TSWFSdJTO29FGmAto5FNPt5ascAlVjd5JkazZlQ8XJl8agtzaTtoWejbkPvC+cZ39gaQCZLM1SQT6oVNuHAQt9N2IuvgzN+qRRenAB8+5BgRbDvgSy7Mdd6bCRYlQHB+N0sRxusjKOqhruFYejbgnQkagdyCCKM6x1p8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062245; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=NZXAhdo0oDN4Lkna41NCabYfeXWcfj6D2vZoV6AUSGI=; b=ahKA90sKdcjiKiFPC7mW+MEF2hs+G1T/RQ/eeYd5LBU73yvXwQCyBptsFbGPAa+GoPpXg/BHi73PCcYsluSb05+3U7W3BWN1lOwcrF3C/C0dIjbnSpaMC3hQ8bcAuimD/JdoEz0HVdfpK3tTrJNCFxTU8r9J1FtfmU5cW/PtQig= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75705+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062245442968.7954222566872; Wed, 26 May 2021 13:50:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7AtwYY1788612xgDW6MIZrzv; Wed, 26 May 2021 13:50:45 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web09.3336.1622062239538801274 for ; Wed, 26 May 2021 13:50:39 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-479-UaLK6LHhPK6Prmv-PaATVg-1; Wed, 26 May 2021 16:50:35 -0400 X-MC-Unique: UaLK6LHhPK6Prmv-PaATVg-1 X-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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id B756B106BB24; Wed, 26 May 2021 20:50:33 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA1345044D; Wed, 26 May 2021 20:50:31 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , Peter Grehan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rebecca Cran Subject: [edk2-devel] [PATCH 34/43] OvmfPkg/PciHostBridgeLibScan: remove PcdOvmfHostBridgePciDevId Date: Wed, 26 May 2021 22:14:37 +0200 Message-Id: <20210526201446.12554-35-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: Ysq4hJv2XXVvBr5obwHvvGHUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062245; bh=NZXAhdo0oDN4Lkna41NCabYfeXWcfj6D2vZoV6AUSGI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=LSfFSsVz8BCPKKwjoojXKLgoDyGNQionbLxQmvQ2/XUs2AyE/gLQ/SMEgBKwnZ2uv5c QGtEz3PQF0U04fZrjvHhUyBczO2dhzA6PjuXY4eBXtbLBSI245/w4hSYQcS9xCdb7ExEi yeujTDKbbLEwGb+6yE/uwcuBnCQjWRGJQsU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The "OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf" instance is used in the following platforms in edk2: OvmfPkg/Bhyve/BhyveX64.dsc OvmfPkg/OvmfXen.dsc Neither Bhyve nor Xen provide a Q35 board, therefore the expression PcdGet16 (PcdOvmfHostBridgePciDevId) !=3D INTEL_Q35_MCH_DEVICE_ID always evaluates to TRUE, in the PciHostBridgeLibScan instance. Replace the expression with constant TRUE, eliminating the PCD dependency. (In effect, this reports that the root bridge being registered does not support extended PCI config space.) Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Peter Grehan Cc: Philippe Mathieu-Daud=C3=A9 Cc: Rebecca Cran Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf | 4 ---- OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf = b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf index 1ba880be6782..199db4cbbd19 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf @@ -36,12 +36,8 @@ [Packages] =20 [LibraryClasses] BaseLib BaseMemoryLib DebugLib MemoryAllocationLib - PcdLib PciHostBridgeUtilityLib PciLib - -[Pcd] - gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c b/OvmfPkg/Li= brary/PciHostBridgeLibScan/XenSupport.c index a4a61e5836e0..edf993e82dcc 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c +++ b/OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c @@ -6,18 +6,16 @@ =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include // EFI_PCI_COMMAND_IO_SPACE -#include // INTEL_Q35_MCH_DEVICE_ID #include // DisableInterrupts() #include // ZeroMem() #include // ASSERT() #include // ReallocatePool() -#include // PcdGet16() #include // PCI_ROOT_BRIDGE_APERTURE #include // PciHostBridgeUtilityInitRo= ot... #include // PciRead32() #include // EFI_PCI_ATTRIBUTE_ISA_IO =20 #include "PciHostBridge.h" @@ -452,13 +450,13 @@ ScanForRootBridges ( (*NumberOfRootBridges + 1) * sizeof (PCI_ROOT_BRIDGE), RootBridges ); ASSERT (RootBridges !=3D NULL); PciHostBridgeUtilityInitRootBridge ( Attributes, Attributes, 0, - FALSE, PcdGet16 (PcdOvmfHostBridgePciDevId) !=3D INTEL_Q35_MCH_DEV= ICE_ID, + FALSE, TRUE /* NoExtendedConfigSpace */, (UINT8) PrimaryBus, (UINT8) SubBus, &Io, &Mem, &MemAbove4G, &mNonExistAperture, &mNonExistAperture, &RootBridges[*NumberOfRootBridges] ); RootBridges[*NumberOfRootBridges].ResourceAssigned =3D TRUE; // --=20 2.19.1.3.g30247aa5d201 -=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 (#75705): https://edk2.groups.io/g/devel/message/75705 Mute This Topic: https://groups.io/mt/83111024/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75706+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75706+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062306; cv=none; d=zohomail.com; s=zohoarc; b=k96/VSJCTqonWKaZS+RLjiaFOCXPo7GPKiSJ5hB3+tmRJJr0TkrsGcC/izrSdzjl5em1fn0OzUDdHZEnwPjfuIZl6uCsHJRLI0kH+cG7Ehy0i35b+ZeE4aJrforSIjH447qvvQdgczJH8bk4XTljaR7qf2Z2IYFyJ2TQoHioT4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062306; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=fioHandeLeIcFluvQ9UjpNQ0qqDK0I1u4BVoSgYLGGY=; b=ERIFVAXdLiWUxWNUWDaNixJ8j3ojFcBcJgAlq4+Xr/k16s4GxLhLkehIwVCUOb7FT0TbbYAup8LLHhgWexpitEHUEBXTyWCaH5rOH9Xdljtsm1wOy/OGSz20Tf85RIIgw/xlm5FHuub6OzaP8wVM7nT7Q3COzu2bwH4Mk+ttQNM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75706+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062306475407.7257005785166; Wed, 26 May 2021 13:51:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id S1FkYY1788612xaRtapxW2nf; Wed, 26 May 2021 13:51:46 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web08.3312.1622062300488883463 for ; Wed, 26 May 2021 13:51:40 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-262-XQ7rgKTjN3CT-CLhmZFDww-1; Wed, 26 May 2021 16:51:38 -0400 X-MC-Unique: XQ7rgKTjN3CT-CLhmZFDww-1 X-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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id B87C68015F8; Wed, 26 May 2021 20:51:36 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id D68E661156; Wed, 26 May 2021 20:51:34 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , Peter Grehan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rebecca Cran Subject: [edk2-devel] [PATCH 35/43] OvmfPkg/PciHostBridgeLibScan: clean up file names and file-top comments Date: Wed, 26 May 2021 22:14:38 +0200 Message-Id: <20210526201446.12554-36-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: Axd5beXC7s1HL8OvazQv3iULx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062306; bh=fioHandeLeIcFluvQ9UjpNQ0qqDK0I1u4BVoSgYLGGY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=NSsgdYs4CywHU4YTt/e7CdoLSj5Pg/8L9FYtLCiHkd7jGp1L098jgQM29Jvd+iQdRQI r8MHNgyhmkrHUAHiovlLBeCKZ5nUBQolcmMIWuIpSjTDfz2qAkiOnR119qsUoY3az70rr 0RZtTNVFLyZlx6n9FdM5j2AUwkpDfUiU3y8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Rename "XenSupport.c" to "ScanForRootBridges.c", after the main function in it. Update the file-top comments; refer to both Bhyve and Xen. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Peter Grehan Cc: Philippe Mathieu-Daud=C3=A9 Cc: Rebecca Cran Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf = | 4 ++-- OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridge.h = | 3 ++- OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c = | 2 +- OvmfPkg/Library/PciHostBridgeLibScan/{XenSupport.c =3D> ScanForRootBridges= .c} | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf = b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf index 199db4cbbd19..a2ac5f93d193 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf @@ -1,8 +1,8 @@ ## @file -# OVMF's instance of the PCI Host Bridge Library. +# OVMF's instance of the PCI Host Bridge Library, for Bhyve and Xen guest= s. # # Copyright (C) 2016-2021, Red Hat, Inc. # Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -24,13 +24,13 @@ [Defines] # VALID_ARCHITECTURES =3D IA32 X64 EBC # =20 [Sources] PciHostBridge.h PciHostBridgeLib.c - XenSupport.c + ScanForRootBridges.c =20 [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridge.h b/OvmfPkg= /Library/PciHostBridgeLibScan/PciHostBridge.h index 582b7929aff2..cb05220161d7 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridge.h +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridge.h @@ -1,8 +1,9 @@ /** @file - Header file of OVMF instance of PciHostBridgeLib. + OVMF's instance of the PCI Host Bridge Library, for Bhyve and Xen guests; + internal declarations. =20 Copyright (C) 2021, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c b/Ovmf= Pkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c index f0166e0f7279..ac8d1033df24 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c @@ -1,8 +1,8 @@ /** @file - OVMF's instance of the PCI Host Bridge Library. + OVMF's instance of the PCI Host Bridge Library, for Bhyve and Xen guests. =20 Copyright (C) 2016-2021, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c b/OvmfPkg/Li= brary/PciHostBridgeLibScan/ScanForRootBridges.c similarity index 96% rename from OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c rename to OvmfPkg/Library/PciHostBridgeLibScan/ScanForRootBridges.c index edf993e82dcc..a6126a1aea52 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c +++ b/OvmfPkg/Library/PciHostBridgeLibScan/ScanForRootBridges.c @@ -1,8 +1,8 @@ /** @file - Scan the entire PCI bus for root bridges to support OVMF above Xen. + Scan the entire PCI bus for root bridges to support OVMF on Bhyve and Xe= n. =20 Copyright (C) 2021, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 --=20 2.19.1.3.g30247aa5d201 -=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 (#75706): https://edk2.groups.io/g/devel/message/75706 Mute This Topic: https://groups.io/mt/83111054/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75707+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75707+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062390; cv=none; d=zohomail.com; s=zohoarc; b=nZc4VbdvxPEbvMiJXmW/v8ZiKEpK+XCy5bcmHUJAsE9e1f6Sq/OsXmqtFAYglvMYlG1udERIRK8QkHzpHAIfxnlugEpxiCTH8mNO/4PdJkl7yidjsM2EABrVlmj5WaZMuRL2RrfyzS5OVAididCDtZmRlOP0RjID/QERoE5F1gA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062390; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=sSP2OryWkALfSTHS3pDZuZj//wXsmOMy3p83c6McgeA=; b=K/MvjUmghYHpG5ktBOY5MkErjOc31nB15k8BH2y//NTJ/iwqaNwHhBmem0UqEbDTuVuX9k+NMAUkEPsXHenJs6n2MXIXHI/Ii1Kv9sMx/iAegDLf0Gn05DQSAtvH+rF8AoF694EuVQcUAtVj9DDNkr0kRxBZqXizAZPspqdeUSE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75707+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206239054954.7061942134701; Wed, 26 May 2021 13:53:10 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9qM6YY1788612xrZDgjUIlHJ; Wed, 26 May 2021 13:53:10 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.3294.1622062389345759245 for ; Wed, 26 May 2021 13:53:09 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-264-WFINsaSEN6uIuesG-otcfg-1; Wed, 26 May 2021 16:53:04 -0400 X-MC-Unique: WFINsaSEN6uIuesG-otcfg-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 64F6E108C31A; Wed, 26 May 2021 20:53:03 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id E71A9131C4; Wed, 26 May 2021 20:52:37 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 36/43] OvmfPkg/SmbiosPlatformDxe: clean up #includes and INF Date: Wed, 26 May 2021 22:14:39 +0200 Message-Id: <20210526201446.12554-37-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: hDGd6UF4tmE3khyfjmUUdUUax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062390; bh=sSP2OryWkALfSTHS3pDZuZj//wXsmOMy3p83c6McgeA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=E02xJf0iIPIE4cf7xTxX4KLQ0FR08fft2ZTCUK11zPySrKvroOkWh7i1VRT+BuVRsvD YyGhYwtNMtZGfwEDF0BGuR1p6C4FP47LC1Ck2iGpn22nTByzG/pbhvn0vUvOrQzU80dxZ XKgeHctbG9xu7cGKjnVXyg5UMJGd+Kdf0h0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" - Sort all sections in the INF file. - Remove unused packages (MdeModulePkg) and lib classes (BaseMemoryLib) from the INF file. - Restrict some lib classes (BaseLib, HobLib) and GUIDs (gEfiXenInfoGuid) to IA32 and X64, in the INF file; only the IA32/X64 Xen implementation requires these. - Don't make "SmbiosPlatformDxe.h" #include everything just as a convenience. Spell out directly needed #includes in every file (annotate each with an example identifier consumed), drop unused #includes. - Keep #includes sorted. - Remove the leading underscore from the #include guard macro name in "SmbiosPlatformDxe.h". Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 20 ++++++++++---------- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 15 +++------------ OvmfPkg/SmbiosPlatformDxe/Qemu.c | 8 +++++--- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 6 ++++++ OvmfPkg/SmbiosPlatformDxe/X86Xen.c | 6 ++++-- 5 files changed, 28 insertions(+), 27 deletions(-) diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/Smbi= osPlatformDxe/SmbiosPlatformDxe.inf index 8b56d90cf805..6063c0c9f609 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -21,44 +21,44 @@ [Defines] # The following information is for reference only and not required by the = build tools. # # VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 # =20 [Sources] - SmbiosPlatformDxe.h - SmbiosPlatformDxe.c Qemu.c + SmbiosPlatformDxe.c + SmbiosPlatformDxe.h =20 [Sources.IA32, Sources.X64] X86Xen.c =20 [Sources.ARM, Sources.AARCH64] ArmXen.c =20 [Packages] MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] - UefiBootServicesTableLib - BaseMemoryLib - BaseLib - UefiDriverEntryPoint DebugLib - HobLib - QemuFwCfgLib MemoryAllocationLib PcdLib + QemuFwCfgLib + UefiBootServicesTableLib + UefiDriverEntryPoint + +[LibraryClasses.IA32, LibraryClasses.X64] + BaseLib + HobLib =20 [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated =20 [Protocols] gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED =20 -[Guids] +[Guids.IA32, Guids.X64] gEfiXenInfoGuid =20 [Depex] gEfiSmbiosProtocolGuid =20 diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.h index 21aa916d7784..ad42a326418c 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -5,25 +5,16 @@ Copyright (c) 2011, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#ifndef _SMBIOS_PLATFORM_DXE_H_ -#define _SMBIOS_PLATFORM_DXE_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include +#ifndef SMBIOS_PLATFORM_DXE_H_ +#define SMBIOS_PLATFORM_DXE_H_ =20 +#include // SMBIOS_TABLE_ENTRY_POINT =20 /** Locates the Xen SMBIOS data if it exists =20 @return SMBIOS_TABLE_ENTRY_POINT Address of Xen SMBIOS data =20 diff --git a/OvmfPkg/SmbiosPlatformDxe/Qemu.c b/OvmfPkg/SmbiosPlatformDxe/Q= emu.c index e34658238123..fcfc3e33c28c 100644 --- a/OvmfPkg/SmbiosPlatformDxe/Qemu.c +++ b/OvmfPkg/SmbiosPlatformDxe/Qemu.c @@ -3,16 +3,18 @@ =20 Copyright (C) 2014, Gabriel L. Somlo =20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 +#include // ASSERT_EFI_ERROR() +#include // AllocatePool() +#include // PcdGetBool() +#include // QemuFwCfgFindFile() + #include "SmbiosPlatformDxe.h" -#include -#include -#include =20 /** Locates and extracts the QEMU SMBIOS data if present in fw_cfg =20 @return Address of extracted QEMU SMBIOS data =20 diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.c index 7991a19dc9c6..9bfc9f14f1a5 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -5,12 +5,18 @@ Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 +#include // SMBIOS_TABLE_TYPE0 +#include // ASSERT_EFI_ERROR() +#include // FreePool() +#include // gBS +#include // EFI_SMBIOS_PROTOCOL + #include "SmbiosPlatformDxe.h" =20 #define TYPE0_STRINGS \ "EFI Development Kit II / OVMF\0" /* Vendor */ \ "0.0.0\0" /* BiosVersion */ \ "02/06/2015\0" /* BiosReleaseDate */ diff --git a/OvmfPkg/SmbiosPlatformDxe/X86Xen.c b/OvmfPkg/SmbiosPlatformDxe= /X86Xen.c index bead810efddb..e0b1b29f80db 100644 --- a/OvmfPkg/SmbiosPlatformDxe/X86Xen.c +++ b/OvmfPkg/SmbiosPlatformDxe/X86Xen.c @@ -5,15 +5,17 @@ Copyright (c) 2011, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 +#include // AsciiStrnCmp() +#include // GetFirstGuidHob() +#include // EFI_HOB_GUID_TYPE + #include "SmbiosPlatformDxe.h" -#include -#include =20 #define XEN_SMBIOS_PHYSICAL_ADDRESS 0x000EB000 #define XEN_SMBIOS_PHYSICAL_END 0x000F0000 =20 /** Validates the SMBIOS entry point structure --=20 2.19.1.3.g30247aa5d201 -=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 (#75707): https://edk2.groups.io/g/devel/message/75707 Mute This Topic: https://groups.io/mt/83111084/1787277 Mute #includes:https://edk2.groups.io/g/devel/mutehashtag/includes 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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75708+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75708+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062451; cv=none; d=zohomail.com; s=zohoarc; b=FRCSrjVwfz9J04+VLr56pAaOzxuCF6xBfIkDfKQPyOX0yz2MUvWHDkZyKk2uyNu/CJPzUvaRrpwLcosOimEHAiIkwdLUaf7EzHNibbCgZJaNnfPRX0PF/Ev3p+ZWU7u8ebYLlfdRQ3wQg4UnF3zAPMqmESbT7ms6vCgW5OPCjyw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062451; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=qN7aQNNpSoFZQKc3G14mWOJrpk1Om0pimmnvEQtBb4Q=; b=MAlLfZjSFeCeNkvm9DNhJc0uw5j4m156tXQIj4p4cjCYUbEl3ZxgkQ83hyOF8K+qIKxCJWxUCihFP26RL4DKa/glaudjhKbsYdIZIWE31RCranD2fHodGxwrAuaYhDz3F3sGdPakue1MV3c1lRtEiRSSHOzBEwQk+Qxt3w2VRTs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75708+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062451813731.6934726978624; Wed, 26 May 2021 13:54:11 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tDCWYY1788612xgGOGvs3LZf; Wed, 26 May 2021 13:54:11 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web08.3352.1622062450797332084 for ; Wed, 26 May 2021 13:54:10 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-194-SqaXRcznNsalHSp1ijz9-w-1; Wed, 26 May 2021 16:54:06 -0400 X-MC-Unique: SqaXRcznNsalHSp1ijz9-w-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E373106BAE3; Wed, 26 May 2021 20:54:05 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78FB861F5E; Wed, 26 May 2021 20:54:04 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 37/43] OvmfPkg/SmbiosPlatformDxe: return EFI_NOT_FOUND if there is no SMBIOS data Date: Wed, 26 May 2021 22:14:40 +0200 Message-Id: <20210526201446.12554-38-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: KznWtVmzWh71QHA6j5QcpDCOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062451; bh=qN7aQNNpSoFZQKc3G14mWOJrpk1Om0pimmnvEQtBb4Q=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=YUkdc5AJDykImJ6eoDnpdk7dGZEdc37fbB9HB3M9a+EmYHZToSU5BQUEKxw3DnRRFU/ X7dtUgCUavPyKXIOhAKgc3NjSidyRIc3QaUZ4Tyix9RbaGNpPx0rC8gsr4szoe+3xva2X xfBP1Rjlvd3l8FRD7iLs8kCN6CeOd+ABMfM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" According to the function-top comment, SmbiosTablePublishEntry() is supposed to return an error code if no SMBIOS data is found, from either GetXenSmbiosTables() or GetQemuSmbiosTables(). Currently the function returns EFI_SUCCESS in this case however (propagated from gBS->LocateProtocol()). Make the return code match the documentation. (This issue is not too important, but it gets in the way of splitting the entry point function next.) Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.c index 9bfc9f14f1a5..6d73173aa512 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -189,12 +189,13 @@ SmbiosTablePublishEntry ( (VOID**)&Smbios ); if (EFI_ERROR (Status)) { return Status; } =20 + Status =3D EFI_NOT_FOUND; // // Add Xen or QEMU SMBIOS data if found // EntryPointStructure =3D GetXenSmbiosTables (); if (EntryPointStructure !=3D NULL) { SmbiosTables =3D (UINT8*)(UINTN)EntryPointStructure->TableAddress; --=20 2.19.1.3.g30247aa5d201 -=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 (#75708): https://edk2.groups.io/g/devel/message/75708 Mute This Topic: https://groups.io/mt/83111115/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75709+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75709+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062514; cv=none; d=zohomail.com; s=zohoarc; b=j5/7rezsu/jwrg4nekQYkb80h+xdQ9tM0s7dze+/egKBqmXSg+QoaPY71Xq4RvSnIhQ/6x3S1tiJ3Jiuu909gQYkpdCRMEb+llxUsEhSilic0jOT2mzngtSrGmVJ+r/dh/S/8KN2XCzGNPfEbAyvQqf/OqEBJJBMpGNyfU9NfyE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062514; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=bEmgkV9tNyEKAmCwT0I0c0THpcgNlz1lPqy5vPJF8XU=; b=dMT96jQBy6ekUBC45QdQ/DAN+Uy83fjeXOEqjLYxpy8+E16A1JotaNrkytwA66a8l2npcTvTjgz/bjOQ1ap25GjFuY+aE64AfdpK/EDOqb9+lk3Ru4XWEg3YMRu61ojI2HJq4CGVe/xAPOesMQsqhhlvml6O4uC4J0TqOUXislo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75709+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162206251437686.37681839448965; Wed, 26 May 2021 13:55:14 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PlUdYY1788612x3kYk8il102; Wed, 26 May 2021 13:55:14 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.3299.1622062513433635244 for ; Wed, 26 May 2021 13:55:13 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-340-Lxl3MDfRP7acAV6TM4SOKg-1; Wed, 26 May 2021 16:55:08 -0400 X-MC-Unique: Lxl3MDfRP7acAV6TM4SOKg-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D9A3880ED9B; Wed, 26 May 2021 20:55:07 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4C285D767; Wed, 26 May 2021 20:55:06 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 38/43] OvmfPkg/SmbiosPlatformDxe: locate SMBIOS protocol in InstallAllStructures() Date: Wed, 26 May 2021 22:14:41 +0200 Message-Id: <20210526201446.12554-39-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: Rxxu8kPGJnVi675qRqytc93cx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062514; bh=bEmgkV9tNyEKAmCwT0I0c0THpcgNlz1lPqy5vPJF8XU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=nRzXzbBcynRhs548RE5zsDge06PSZo/Es9AjpXDLOCLKCJvxjAjCbm9BEbhk+GJor2j RBCg+sA5sJ4TvRzDCNjNue2Z9t9pNF8aHPI78kE9rFaarzHFZI232gdlGti14BPx8OEIs S8y5zd7BBhTIjYTVJDQFNC0BTnT7G5wgpV4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Locate the SMBIOS protocol internally to the InstallAllStructures() function. This has no performance impact (InstallAllStructures() is only called once), but moving the code from the entry point function makes the latter smaller. And that will be useful when we split the entry point function to two versions. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 30 +++++++++----------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.c index 6d73173aa512..757bec879e4a 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -92,27 +92,38 @@ SmbiosTableLength ( } =20 =20 /** Install all structures from the given SMBIOS structures block =20 - @param Smbios SMBIOS protocol @param TableAddress SMBIOS tables starting address =20 **/ EFI_STATUS InstallAllStructures ( - IN EFI_SMBIOS_PROTOCOL *Smbios, IN UINT8 *TableAddress ) { + EFI_SMBIOS_PROTOCOL *Smbios; EFI_STATUS Status; SMBIOS_STRUCTURE_POINTER SmbiosTable; EFI_SMBIOS_HANDLE SmbiosHandle; BOOLEAN NeedSmbiosType0; =20 + // + // Find the SMBIOS protocol + // + Status =3D gBS->LocateProtocol ( + &gEfiSmbiosProtocolGuid, + NULL, + (VOID**)&Smbios + ); + if (EFI_ERROR (Status)) { + return Status; + } + SmbiosTable.Raw =3D TableAddress; if (SmbiosTable.Raw =3D=3D NULL) { return EFI_INVALID_PARAMETER; } =20 NeedSmbiosType0 =3D TRUE; @@ -173,41 +184,28 @@ EFIAPI SmbiosTablePublishEntry ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; - EFI_SMBIOS_PROTOCOL *Smbios; SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure; UINT8 *SmbiosTables; =20 - // - // Find the SMBIOS protocol - // - Status =3D gBS->LocateProtocol ( - &gEfiSmbiosProtocolGuid, - NULL, - (VOID**)&Smbios - ); - if (EFI_ERROR (Status)) { - return Status; - } - Status =3D EFI_NOT_FOUND; // // Add Xen or QEMU SMBIOS data if found // EntryPointStructure =3D GetXenSmbiosTables (); if (EntryPointStructure !=3D NULL) { SmbiosTables =3D (UINT8*)(UINTN)EntryPointStructure->TableAddress; } else { SmbiosTables =3D GetQemuSmbiosTables (); } =20 if (SmbiosTables !=3D NULL) { - Status =3D InstallAllStructures (Smbios, SmbiosTables); + Status =3D InstallAllStructures (SmbiosTables); =20 // // Free SmbiosTables if allocated by Qemu (i.e., NOT by Xen): // if (EntryPointStructure =3D=3D NULL) { FreePool (SmbiosTables); --=20 2.19.1.3.g30247aa5d201 -=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 (#75709): https://edk2.groups.io/g/devel/message/75709 Mute This Topic: https://groups.io/mt/83111142/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75710+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75710+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062575; cv=none; d=zohomail.com; s=zohoarc; b=h1ShDx+w9h7M7gjuu4jtkQaWx/A0UB8NDWm2BhC6OsNJjZWbsFOOz6BsS0IaVRMYgLA4z0ZAfuB9pQo7qN9YZmrbkEUBVSdTLbQQbAS+GcO3/MLqLHVesUDHa86NEYJdoFvYMhI/ManD+gmUaE0dBMLoFUcNS3ICauTmXGpLJVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062575; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=NuHSfv9AyaFgwxsPF5W85vhdRlxz/WLqiLswoAa/8og=; b=RMyEEc5bP/I/hk0uAeXo8lww6Ej2+TLHn75IxyagBoVac/TfNcxYCvKxO+BRfvL+7Wbh0b+JgunPRd7CPG0Vz02/EHZaXlUJI0to6H1+cgf6CSq1V4SheyVc+mNqahOX6nXxXySfPY0zzNkZvCFpQdJiHhdWIuHdMkGASK0ehgQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75710+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062575685639.6626374192421; Wed, 26 May 2021 13:56:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tvtnYY1788612xnaauPr1Kl3; Wed, 26 May 2021 13:56:15 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.3310.1622062574815381537 for ; Wed, 26 May 2021 13:56:15 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-453-IPxRBNY3OrK7XnoUL4_mhA-1; Wed, 26 May 2021 16:56:12 -0400 X-MC-Unique: IPxRBNY3OrK7XnoUL4_mhA-1 X-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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7913107ACE4; Wed, 26 May 2021 20:56:10 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF2997013C; Wed, 26 May 2021 20:56:08 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Andrew Fish , Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , Leif Lindholm , Michael D Kinney , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 39/43] OvmfPkg/SmbiosPlatformDxe: split GetXenSmbiosTables() decl. to new header Date: Wed, 26 May 2021 22:14:42 +0200 Message-Id: <20210526201446.12554-40-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: X6NUnUHISvte2yxDtemDpEJvx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062575; bh=NuHSfv9AyaFgwxsPF5W85vhdRlxz/WLqiLswoAa/8og=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=FMKbRpa7Z1EHXa0Qp234d4xbHOGpH+KXnOgsxqWnYxkY5zG2baG9KkP0kyjZsVN0Uh4 ZUC6TSsFFwNHm2UP08I0EDukyoA0mTtwZmWAZu7IBgMKLGiD9W1soidVGWaO5LT5qm2cM G/HDuLOleyAqpvCNgGMBnMCdVYjkXJOhFYs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Move the declaration of the GetXenSmbiosTables() function to a new header file called "XenSmbiosPlatformDxe.h". (The only declaration that remains in "SmbiosPlatformDxe.h" for now is that of GetQemuSmbiosTables().) Modify the pattern in "Maintainers.txt" so that the new file be covered in the "OvmfPkg: Xen-related modules" section. This patch is best viewed with "git show --no-renames". Cc: Andrew Fish Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Leif Lindholm Cc: Michael D Kinney Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 1 + Maintainers.txt | 2 +- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 14 ------= -------- OvmfPkg/SmbiosPlatformDxe/{ArmXen.c =3D> XenSmbiosPlatformDxe.h} | 20 ++++= ++++++---------- OvmfPkg/SmbiosPlatformDxe/ArmXen.c | 2 +- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 1 + OvmfPkg/SmbiosPlatformDxe/X86Xen.c | 2 +- 7 files changed, 15 insertions(+), 27 deletions(-) diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/Smbi= osPlatformDxe/SmbiosPlatformDxe.inf index 6063c0c9f609..140fa16ac135 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -24,12 +24,13 @@ [Defines] # =20 [Sources] Qemu.c SmbiosPlatformDxe.c SmbiosPlatformDxe.h + XenSmbiosPlatformDxe.h =20 [Sources.IA32, Sources.X64] X86Xen.c =20 [Sources.ARM, Sources.AARCH64] ArmXen.c diff --git a/Maintainers.txt b/Maintainers.txt index e5f419e67f0c..751477e8e62a 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -499,13 +499,13 @@ F: OvmfPkg/Library/XenConsoleSerialPortLib/ F: OvmfPkg/Library/XenHypercallLib/ F: OvmfPkg/Library/XenIoMmioLib/ F: OvmfPkg/Library/XenPlatformLib/ F: OvmfPkg/Library/XenRealTimeClockLib/ F: OvmfPkg/OvmfXen.* F: OvmfPkg/OvmfXenElfHeaderGenerator.c -F: OvmfPkg/SmbiosPlatformDxe/*Xen.c +F: OvmfPkg/SmbiosPlatformDxe/*Xen* F: OvmfPkg/XenAcpiPlatformDxe/ F: OvmfPkg/XenBusDxe/ F: OvmfPkg/XenIoPciDxe/ F: OvmfPkg/XenIoPvhDxe/ F: OvmfPkg/XenPlatformPei/ F: OvmfPkg/XenPvBlkDxe/ diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.h index ad42a326418c..7a0bdbb2911f 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -8,26 +8,12 @@ =20 **/ =20 #ifndef SMBIOS_PLATFORM_DXE_H_ #define SMBIOS_PLATFORM_DXE_H_ =20 -#include // SMBIOS_TABLE_ENTRY_POINT - -/** - Locates the Xen SMBIOS data if it exists - - @return SMBIOS_TABLE_ENTRY_POINT Address of Xen SMBIOS data - -**/ -SMBIOS_TABLE_ENTRY_POINT * -GetXenSmbiosTables ( - VOID - ); - - /** Locates and extracts the QEMU SMBIOS table data if present in fw_cfg =20 @return Address of extracted QEMU SMBIOS data =20 **/ diff --git a/OvmfPkg/SmbiosPlatformDxe/ArmXen.c b/OvmfPkg/SmbiosPlatformDxe= /XenSmbiosPlatformDxe.h similarity index 56% copy from OvmfPkg/SmbiosPlatformDxe/ArmXen.c copy to OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.h index c2847f905303..850a8b662cd5 100644 --- a/OvmfPkg/SmbiosPlatformDxe/ArmXen.c +++ b/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.h @@ -1,28 +1,28 @@ /** @file - Detect Xen SMBIOS data on ARM / AARCH64. + This driver installs SMBIOS information for OVMF on Xen =20 - Copyright (C) 2015, Red Hat, Inc. + Copyright (C) 2021, Red Hat, Inc. Copyright (c) 2011, Bei Guan Copyright (c) 2011, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent + **/ =20 -#include "SmbiosPlatformDxe.h" +#ifndef XEN_SMBIOS_PLATFORM_DXE_H_ +#define XEN_SMBIOS_PLATFORM_DXE_H_ + +#include // SMBIOS_TABLE_ENTRY_POINT =20 /** Locates the Xen SMBIOS data if it exists =20 @return SMBIOS_TABLE_ENTRY_POINT Address of Xen SMBIOS data =20 **/ SMBIOS_TABLE_ENTRY_POINT * GetXenSmbiosTables ( VOID - ) -{ - // - // Not implemented yet. - // - return NULL; -} + ); + +#endif diff --git a/OvmfPkg/SmbiosPlatformDxe/ArmXen.c b/OvmfPkg/SmbiosPlatformDxe= /ArmXen.c index c2847f905303..3dd849bbc0b4 100644 --- a/OvmfPkg/SmbiosPlatformDxe/ArmXen.c +++ b/OvmfPkg/SmbiosPlatformDxe/ArmXen.c @@ -5,13 +5,13 @@ Copyright (c) 2011, Bei Guan Copyright (c) 2011, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 -#include "SmbiosPlatformDxe.h" +#include "XenSmbiosPlatformDxe.h" =20 /** Locates the Xen SMBIOS data if it exists =20 @return SMBIOS_TABLE_ENTRY_POINT Address of Xen SMBIOS data =20 diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.c index 757bec879e4a..f280a1852ddd 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -12,12 +12,13 @@ #include // ASSERT_EFI_ERROR() #include // FreePool() #include // gBS #include // EFI_SMBIOS_PROTOCOL =20 #include "SmbiosPlatformDxe.h" +#include "XenSmbiosPlatformDxe.h" =20 #define TYPE0_STRINGS \ "EFI Development Kit II / OVMF\0" /* Vendor */ \ "0.0.0\0" /* BiosVersion */ \ "02/06/2015\0" /* BiosReleaseDate */ // diff --git a/OvmfPkg/SmbiosPlatformDxe/X86Xen.c b/OvmfPkg/SmbiosPlatformDxe= /X86Xen.c index e0b1b29f80db..0acedf8995da 100644 --- a/OvmfPkg/SmbiosPlatformDxe/X86Xen.c +++ b/OvmfPkg/SmbiosPlatformDxe/X86Xen.c @@ -9,13 +9,13 @@ **/ =20 #include // AsciiStrnCmp() #include // GetFirstGuidHob() #include // EFI_HOB_GUID_TYPE =20 -#include "SmbiosPlatformDxe.h" +#include "XenSmbiosPlatformDxe.h" =20 #define XEN_SMBIOS_PHYSICAL_ADDRESS 0x000EB000 #define XEN_SMBIOS_PHYSICAL_END 0x000F0000 =20 /** Validates the SMBIOS entry point structure --=20 2.19.1.3.g30247aa5d201 -=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 (#75710): https://edk2.groups.io/g/devel/message/75710 Mute This Topic: https://groups.io/mt/83111160/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75711+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75711+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062652; cv=none; d=zohomail.com; s=zohoarc; b=NPKaTLrWqNca+3NTVrk0ncm+MaGE5mdrsRJ4sjSOpck7glskaTTf8PuzAePydhOdzs3cIS2P4ted1W5ZxVHNsRZdTY3t3DL/+ezyv7gRRmx+9sFyb7qBexha7kr19WgFW1FncLCoHny2oh7SN9wXfCDHg0Ub+PJDnEA3lJjO4fQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062652; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=U9z4APL6ijjtpKwiDxD7dAcOFhfO+oz48dsCdC+QZpI=; b=XklzYKcMbT9rV/0HxGm2EDmQtFw4aZ1bFv28LfkM5mT8+FPmcZ54/0FHUwLaeJgFZa9M3VCHQNJJKcORkzHBdyQzLlb66LyWcozucMBDGd9DAYLfzMnIa0hTPIMq+iqrJ4BIJQzyFWhKBIHh+IyENXe6c6DbWklAjz9rpJCfVGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75711+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062652896964.4377884348515; Wed, 26 May 2021 13:57:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id mQ2UYY1788612xFrP0Aediuu; Wed, 26 May 2021 13:57:32 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web12.3348.1622062646911323636 for ; Wed, 26 May 2021 13:57:27 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-511-GNa7jqRrNrqts7Wb9xA2PQ-1; Wed, 26 May 2021 16:57:14 -0400 X-MC-Unique: GNa7jqRrNrqts7Wb9xA2PQ-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F514189C448; Wed, 26 May 2021 20:57:13 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06B25687E8; Wed, 26 May 2021 20:57:11 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 40/43] OvmfPkg/SmbiosPlatformDxe: declare InstallAllStructures() in header file Date: Wed, 26 May 2021 22:14:43 +0200 Message-Id: <20210526201446.12554-41-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: GusO1Bmco3whGVIh15Iyn6VWx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062652; bh=U9z4APL6ijjtpKwiDxD7dAcOFhfO+oz48dsCdC+QZpI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=XyqoE6oNRmknETJKDylfiIXh4NR36/roGs/1gAWgfqrC/tSKcIAW0ZS/JuQEfCExUlx vZ1+BXrA86pNPGDK+2064ChEWqv9nW1lxDTptc0Ab1+2cs0y56HuBrY2X50qgIKwt337R JL6xukaYmhBEjTpLmdfaaSaf/pHs5VCtdT0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add an extern declaration for the InstallAllStructures() function to the "SmbiosPlatformDxe.h" header file. (The leading comment block and the prototype are simply copied from "SmbiosPlatformDxe.c".) Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.h index 7a0bdbb2911f..0ae2556fe800 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -8,12 +8,23 @@ =20 **/ =20 #ifndef SMBIOS_PLATFORM_DXE_H_ #define SMBIOS_PLATFORM_DXE_H_ =20 +/** + Install all structures from the given SMBIOS structures block + + @param TableAddress SMBIOS tables starting address + +**/ +EFI_STATUS +InstallAllStructures ( + IN UINT8 *TableAddress + ); + /** Locates and extracts the QEMU SMBIOS table data if present in fw_cfg =20 @return Address of extracted QEMU SMBIOS data =20 **/ --=20 2.19.1.3.g30247aa5d201 -=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 (#75711): https://edk2.groups.io/g/devel/message/75711 Mute This Topic: https://groups.io/mt/83111182/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75712+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75712+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062700; cv=none; d=zohomail.com; s=zohoarc; b=UMVYTqWLst6H+DdSNUfXbnegz6YeAkvwRnV+/cop1oVqKbvN6W/7gQGVNHv6t2OyPhoININiFdVYH6eF1JjzskO/fpdLbPlZ21O1r9DFU0yNQo6eZ5pEOnOFjem0BYa+X87TV40NDniDu2lM5WulyF52FdU179HhmgbZ4kIztpg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062700; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=BpK4BPgG5LL/r8H1MYOzBYzqqC6V5Ige2W1zMaqzCkY=; b=mfeZDXZaN0oP2c2aigHu1nrmhdLCdoLon6X1UCKs5MjhkCNBRNpN79tLvNioxpRiO22WZ06d5Z+yxoNTMb5ep/3sEUhQJ980KJMrUgMHj732XW0+NBHqiLDfTEEAcsdWT3X0Sddz3Nj13kn4IYKYHPx+2hKUvfzzE0D56gDTI+w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75712+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062700694538.0725177868477; Wed, 26 May 2021 13:58:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id z3gAYY1788612x4sJ8CPGFj7; Wed, 26 May 2021 13:58:20 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web08.3407.1622062699661536053 for ; Wed, 26 May 2021 13:58:19 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-550-BB2rifhMNKWx4mZHHHaI4A-1; Wed, 26 May 2021 16:58:16 -0400 X-MC-Unique: BB2rifhMNKWx4mZHHHaI4A-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA2848042A3; Wed, 26 May 2021 20:58:15 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5059B19D9D; Wed, 26 May 2021 20:58:14 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 41/43] OvmfPkg/SmbiosPlatformDxe: create Xen-specific module INF file Date: Wed, 26 May 2021 22:14:44 +0200 Message-Id: <20210526201446.12554-42-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: Tp560fhWsXA3l3iBeG4iZXMzx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062700; bh=BpK4BPgG5LL/r8H1MYOzBYzqqC6V5Ige2W1zMaqzCkY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=tuzGpqYGf4/7u5GJ6aHBd3PBVbIqTSmXMjFCxbK6OUwcsTgKXUp+OsskOjMj9ycQQ79 CtvUoBOQFVYCKOQAmWNZ75VGbot/OQFlxC45eh68LxM+eG7Jt9F7MO4VB3JiRcmVxJOdU EDt6Srb7V/i0aOurorutVERHQDbEskUZNRM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" "OvmfPkg/SmbiosPlatformDxe" is structured somewhat differently from the drivers duplicated and trimmed thus far in this series. The final QEMU and Xen versions will share a relatively significant amount of code, therefore duplicating the whole driver is less useful, even temporarily. Instead, duplicate the INF file, in preparation for customizing the entry point function. Because ArmVirtXen doesn't actually include OvmfPkg/SmbiosPlatformDxe [*], there is only one platform that's supposed to consume the new driver: OvmfXen. Switch OvmfXen to the new driver at once. [*] See commit 164cf4038357 ("OvmfPkg: SmbiosPlatformDxe: restrict current Xen code to IA32/X64", 2015-07-26). This patch is best viewed with "git show --find-copies-harder". Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/OvmfXen.dsc = | 2 +- OvmfPkg/OvmfXen.fdf = | 2 +- OvmfPkg/SmbiosPlatformDxe/{SmbiosPlatformDxe.inf =3D> XenSmbiosPlatformDxe= .inf} | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 0986d9f5c356..3c1ca6bfd493 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -642,13 +642,13 @@ [Components] # SMBIOS Support # MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf { NULL|OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.inf } - OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf + OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf =20 # # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf diff --git a/OvmfPkg/OvmfXen.fdf b/OvmfPkg/OvmfXen.fdf index 9acc7c93b98b..aeb9336fd5b7 100644 --- a/OvmfPkg/OvmfXen.fdf +++ b/OvmfPkg/OvmfXen.fdf @@ -345,13 +345,13 @@ [FV.DXEFV] !if $(SOURCE_DEBUG_ENABLE) =3D=3D FALSE INF MdeModulePkg/Bus/Pci/PciSioSerialDxe/PciSioSerialDxe.inf !endif INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf =20 INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf -INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +INF OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf INF OvmfPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/Smbi= osPlatformDxe/XenSmbiosPlatformDxe.inf similarity index 80% copy from OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf copy to OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf index 140fa16ac135..5a093c69afd9 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf @@ -1,20 +1,21 @@ ## @file -# This driver installs SMBIOS information for OVMF +# This driver installs SMBIOS information for OVMF on Xen # +# Copyright (C) 2021, Red Hat, Inc. # Copyright (c) 2011, Bei Guan # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # ## =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D SmbiosPlatformDxe - FILE_GUID =3D 4110465d-5ff3-4f4b-b580-24ed0d06747a + BASE_NAME =3D XenSmbiosPlatformDxe + FILE_GUID =3D c41f0579-5598-40f1-95db-3983c8ebbe2a MODULE_TYPE =3D DXE_DRIVER VERSION_STRING =3D 1.0 =20 ENTRY_POINT =3D SmbiosTablePublishEntry =20 # --=20 2.19.1.3.g30247aa5d201 -=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 (#75712): https://edk2.groups.io/g/devel/message/75712 Mute This Topic: https://groups.io/mt/83111208/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75713+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75713+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062770; cv=none; d=zohomail.com; s=zohoarc; b=USxMnHS/X5O/XRtXbMXP7rZ2W616YZLJ6sIfAJ2RR2zIKvuo9zUeDw7uTTdpyBnnOBRJHJoOWatA29qZn6+3U2Qm8mdn4hd3ktYfTkzqi4Yr0OE9kkiFcb8ffGTjE6mrYhRo+yx8HWCmvLAXpbwrBcfKJom7pka7kBoMTeHKHZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062770; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Hi2DZOZF5wXDS3zuNHqniIFfYxIiS3poeGngZOzMTsk=; b=NqDQPFyAIvFs/BHnrD4jDIHMzt+9YcAYXqyRaq4lAIRC601os9wEjcQO4cVp6n1omHLuVLKq5ivnIiDJmGunUEhTaggiWuLhUtVkZsfCVbuSLdR5olBHJYXeewhaV43nkk69R3LWvIhKESPJm15yekiD3YNoRa3FxVqIpivfG60= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75713+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062770357845.9687612114543; Wed, 26 May 2021 13:59:30 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id KxlGYY1788612xnfqZdaJdHO; Wed, 26 May 2021 13:59:29 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web12.3368.1622062764302370797 for ; Wed, 26 May 2021 13:59:24 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-209-GLB6MP8UM_uF1VdJeydEww-1; Wed, 26 May 2021 16:59:19 -0400 X-MC-Unique: GLB6MP8UM_uF1VdJeydEww-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 88D7D10082E1; Wed, 26 May 2021 20:59:18 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF23F5D9CC; Wed, 26 May 2021 20:59:16 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 42/43] OvmfPkg/SmbiosPlatformDxe: split Xen entry point from QEMU entry point Date: Wed, 26 May 2021 22:14:45 +0200 Message-Id: <20210526201446.12554-43-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: OLVqClyWibIqqrbKpA1G5yxUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062769; bh=Hi2DZOZF5wXDS3zuNHqniIFfYxIiS3poeGngZOzMTsk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=wRUrHNF1ONV6N4+GduOoN8AO1WS0qpyx7PCg8r15r62ZSe28QnwBZHe/PcGxxgiGGqP ZzUAF06s64iNTRqYTCADu8V1iKT3eMiBJFxIe5RcZa2T+DtJG7ibdsjV534pnq/4pDNaG X8jYHJaWZNIoW33R5XpasMWaLAKVvBsJElk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Remove the SmbiosTablePublishEntry() function from "SmbiosPlatformDxe.c". "SmbiosPlatformDxe.c" becomes hypervisor-agnostic. Add SmbiosTablePublishEntry() back, simplified for QEMU, to the existent file "Qemu.c". The GetQemuSmbiosTables() function no longer needs to be declared in "SmbiosPlatformDxe.h"; "SmbiosPlatformDxe.h" becomes hypervisor-agnostic. Add SmbiosTablePublishEntry() back, renamed and simplified for Xen, to the new, arch-independent file "Xen.c". (The existent Xen-specific C files are arch-dependent.) Update both INF files; remove the dependencies that are now superfluous in each. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 14 ------ OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf | 12 ++--- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 11 ----- OvmfPkg/SmbiosPlatformDxe/Qemu.c | 33 +++++++++++++ OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 49 ------------------= -- OvmfPkg/SmbiosPlatformDxe/Xen.c | 49 ++++++++++++++++++= ++ 6 files changed, 86 insertions(+), 82 deletions(-) diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/Smbi= osPlatformDxe/SmbiosPlatformDxe.inf index 140fa16ac135..eaee73110d27 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -24,19 +24,12 @@ [Defines] # =20 [Sources] Qemu.c SmbiosPlatformDxe.c SmbiosPlatformDxe.h - XenSmbiosPlatformDxe.h - -[Sources.IA32, Sources.X64] - X86Xen.c - -[Sources.ARM, Sources.AARCH64] - ArmXen.c =20 [Packages] MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] @@ -44,22 +37,15 @@ [LibraryClasses] MemoryAllocationLib PcdLib QemuFwCfgLib UefiBootServicesTableLib UefiDriverEntryPoint =20 -[LibraryClasses.IA32, LibraryClasses.X64] - BaseLib - HobLib - [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated =20 [Protocols] gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED =20 -[Guids.IA32, Guids.X64] - gEfiXenInfoGuid - [Depex] gEfiSmbiosProtocolGuid =20 diff --git a/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf b/OvmfPkg/S= mbiosPlatformDxe/XenSmbiosPlatformDxe.inf index 5a093c69afd9..7f4588e33d1e 100644 --- a/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.inf @@ -13,51 +13,47 @@ [Defines] INF_VERSION =3D 0x00010005 BASE_NAME =3D XenSmbiosPlatformDxe FILE_GUID =3D c41f0579-5598-40f1-95db-3983c8ebbe2a MODULE_TYPE =3D DXE_DRIVER VERSION_STRING =3D 1.0 =20 - ENTRY_POINT =3D SmbiosTablePublishEntry + ENTRY_POINT =3D XenSmbiosTablePublishEntry =20 # # The following information is for reference only and not required by the = build tools. # # VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 # =20 [Sources] - Qemu.c SmbiosPlatformDxe.c SmbiosPlatformDxe.h + Xen.c XenSmbiosPlatformDxe.h =20 [Sources.IA32, Sources.X64] X86Xen.c =20 [Sources.ARM, Sources.AARCH64] ArmXen.c =20 [Packages] MdePkg/MdePkg.dec + +[Packages.IA32, Packages.X64] OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] DebugLib - MemoryAllocationLib - PcdLib - QemuFwCfgLib UefiBootServicesTableLib UefiDriverEntryPoint =20 [LibraryClasses.IA32, LibraryClasses.X64] BaseLib HobLib =20 -[Pcd] - gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated - [Protocols] gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED =20 [Guids.IA32, Guids.X64] gEfiXenInfoGuid =20 diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.h index 0ae2556fe800..213a7f39e91d 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -19,18 +19,7 @@ **/ EFI_STATUS InstallAllStructures ( IN UINT8 *TableAddress ); =20 -/** - Locates and extracts the QEMU SMBIOS table data if present in fw_cfg - - @return Address of extracted QEMU SMBIOS data - -**/ -UINT8 * -GetQemuSmbiosTables ( - VOID - ); - #endif diff --git a/OvmfPkg/SmbiosPlatformDxe/Qemu.c b/OvmfPkg/SmbiosPlatformDxe/Q= emu.c index fcfc3e33c28c..a668c6ac2123 100644 --- a/OvmfPkg/SmbiosPlatformDxe/Qemu.c +++ b/OvmfPkg/SmbiosPlatformDxe/Qemu.c @@ -45,6 +45,39 @@ GetQemuSmbiosTables ( =20 QemuFwCfgSelectItem (Tables); QemuFwCfgReadBytes (TablesSize, QemuTables); =20 return QemuTables; } + +/** + Installs SMBIOS information for OVMF + + @param ImageHandle Module's image handle + @param SystemTable Pointer of EFI_SYSTEM_TABLE + + @retval EFI_SUCCESS Smbios data successfully installed + @retval Other Smbios data was not installed + +**/ +EFI_STATUS +EFIAPI +SmbiosTablePublishEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + UINT8 *SmbiosTables; + + Status =3D EFI_NOT_FOUND; + // + // Add QEMU SMBIOS data if found + // + SmbiosTables =3D GetQemuSmbiosTables (); + if (SmbiosTables !=3D NULL) { + Status =3D InstallAllStructures (SmbiosTables); + FreePool (SmbiosTables); + } + + return Status; +} diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.c index f280a1852ddd..7bcf83762e9b 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -7,18 +7,16 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include // SMBIOS_TABLE_TYPE0 #include // ASSERT_EFI_ERROR() -#include // FreePool() #include // gBS #include // EFI_SMBIOS_PROTOCOL =20 #include "SmbiosPlatformDxe.h" -#include "XenSmbiosPlatformDxe.h" =20 #define TYPE0_STRINGS \ "EFI Development Kit II / OVMF\0" /* Vendor */ \ "0.0.0\0" /* BiosVersion */ \ "02/06/2015\0" /* BiosReleaseDate */ // @@ -165,53 +163,6 @@ InstallAllStructures ( ); ASSERT_EFI_ERROR (Status); } =20 return EFI_SUCCESS; } - - -/** - Installs SMBIOS information for OVMF - - @param ImageHandle Module's image handle - @param SystemTable Pointer of EFI_SYSTEM_TABLE - - @retval EFI_SUCCESS Smbios data successfully installed - @retval Other Smbios data was not installed - -**/ -EFI_STATUS -EFIAPI -SmbiosTablePublishEntry ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure; - UINT8 *SmbiosTables; - - Status =3D EFI_NOT_FOUND; - // - // Add Xen or QEMU SMBIOS data if found - // - EntryPointStructure =3D GetXenSmbiosTables (); - if (EntryPointStructure !=3D NULL) { - SmbiosTables =3D (UINT8*)(UINTN)EntryPointStructure->TableAddress; - } else { - SmbiosTables =3D GetQemuSmbiosTables (); - } - - if (SmbiosTables !=3D NULL) { - Status =3D InstallAllStructures (SmbiosTables); - - // - // Free SmbiosTables if allocated by Qemu (i.e., NOT by Xen): - // - if (EntryPointStructure =3D=3D NULL) { - FreePool (SmbiosTables); - } - } - - return Status; -} diff --git a/OvmfPkg/SmbiosPlatformDxe/Xen.c b/OvmfPkg/SmbiosPlatformDxe/Xe= n.c new file mode 100644 index 000000000000..75d9550913d1 --- /dev/null +++ b/OvmfPkg/SmbiosPlatformDxe/Xen.c @@ -0,0 +1,49 @@ +/** @file + This driver installs SMBIOS information for OVMF on Xen + + Copyright (C) 2021, Red Hat, Inc. + Copyright (c) 2011, Bei Guan + Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "SmbiosPlatformDxe.h" +#include "XenSmbiosPlatformDxe.h" + +/** + Installs SMBIOS information for OVMF on Xen + + @param ImageHandle Module's image handle + @param SystemTable Pointer of EFI_SYSTEM_TABLE + + @retval EFI_SUCCESS Smbios data successfully installed + @retval Other Smbios data was not installed + +**/ +EFI_STATUS +EFIAPI +XenSmbiosTablePublishEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure; + UINT8 *SmbiosTables; + + Status =3D EFI_NOT_FOUND; + // + // Add Xen SMBIOS data if found + // + EntryPointStructure =3D GetXenSmbiosTables (); + if (EntryPointStructure !=3D NULL) { + SmbiosTables =3D (UINT8*)(UINTN)EntryPointStructure->TableAddress; + if (SmbiosTables !=3D NULL) { + Status =3D InstallAllStructures (SmbiosTables); + } + } + + return Status; +} --=20 2.19.1.3.g30247aa5d201 -=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 (#75713): https://edk2.groups.io/g/devel/message/75713 Mute This Topic: https://groups.io/mt/83111228/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 Thu May 16 17:33:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75714+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75714+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062825; cv=none; d=zohomail.com; s=zohoarc; b=DAx3qItjrlUtOZLwRX0EA5H+xbpk0eOs/bwH4iwj07Owi0PP2Wl5F7CPgzqd9QDhXUCFmOOEvizMPuVOofp7UnAfUcg0tSGuWSWrlOgnwhV5tkYvL7LbdGPQ3G5dkPvAHRZ7hzMfj4cM+m6IGYSRHrhBiOOla6iYVXKa6rlKTTE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062825; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=YBL3R1iXoen5xAGEOdQExGfiVRE83GRT5qEfMq77w/s=; b=nA5F6Y6M9szZPcGs+AYe0duj11tGcCkk07RREgSganu2lL+6wFB9/t6KVil+Ecltm7eS7sN1uT8NoOfP+5lAoDdpYXExsxDedpL2+kcpcgIA1HR71JF18yZnqDj67SLUCvYQDXpJdzgCmd6QvouN61W0rTpeMBsOvODU1+qHFlo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75714+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062825880959.5832796073935; Wed, 26 May 2021 14:00:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id BSJpYY1788612xjZjWmOspaV; Wed, 26 May 2021 14:00:25 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web09.3447.1622062824861999370 for ; Wed, 26 May 2021 14:00:25 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-403-KfuL9jLVMj21HXgMmxOn3A-1; Wed, 26 May 2021 17:00:22 -0400 X-MC-Unique: KfuL9jLVMj21HXgMmxOn3A-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B21E38015F8; Wed, 26 May 2021 21:00:20 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9CE775D9CC; Wed, 26 May 2021 21:00:19 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 43/43] OvmfPkg: restrict XenPlatformLib to BdsDxe in the IA32, IA32X64, X64 DSCs Date: Wed, 26 May 2021 22:14:46 +0200 Message-Id: <20210526201446.12554-44-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,lersek@redhat.com X-Gm-Message-State: qMdhGDSlnyWbbpprEgSXpModx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062825; bh=YBL3R1iXoen5xAGEOdQExGfiVRE83GRT5qEfMq77w/s=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=PTVDZvwh7hNLx4c/AsEkAZhFsH4v2/mc2CLnQFr+IEGXkqW3lh7p2ToKcIY//azQyhR 4ThrfLt9edTqPZj3xhsng0J7a/BhsAS1Sgd9XL0wjTnNqk0bl7uk5eP9H6fQZ8eT8bkNd haljmVn2Pz4NS6EbBSYHXSUlNiqAlo8fueE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The "OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf" library instance is used in the following platform DSC files in edk2: OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgX64.dsc OvmfPkg/OvmfXen.dsc The Xen customizations are very light-weight in this PlatformBootManagerLib instance. Isolating them statically, for the sake of the first three DSC files, would save negligible binary code size, and would likely worsen code complexity (by way of introducing new internal interfaces) or blow up source code size (by duplicating almost the entire lib instance source code). So for now, keep this one bit of Xen dynamism even on QEMU. However, because it's only PlatformBootManagerLib now that uses XenPlatformLib (for the above-stated enlightenment), restrict the XenPlatformLib class resolution in the first three DSC files to the only DXE driver that consumes PlatformBootManagerLib (and therefore XenPlatformLib): BdsDxe. This will cause a build failure later if someone attempts to call a XenPlatformLib API (that is, tries to re-introduce Xen enlightenment) in a different module in these non-Xen DSC files. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/OvmfPkgIa32.dsc | 2 +- OvmfPkg/OvmfPkgIa32X64.dsc | 2 +- OvmfPkg/OvmfPkgX64.dsc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 7a37efd35664..f53efeae7986 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -223,13 +223,12 @@ [LibraryClasses] =20 ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScrip= tLib.inf SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib= /BaseOrderedCollectionRedBlackTreeLib.inf - XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibN= ull.inf @@ -767,12 +766,13 @@ [Components] MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf MdeModulePkg/Universal/Metronome/Metronome.inf PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.i= nf MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { + XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf !ifdef $(CSM_ENABLE) NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf NULL|OvmfPkg/Csm/LegacyBootManagerLib/LegacyBootManagerLib.inf !endif } MdeModulePkg/Logo/LogoDxe.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index d6cc58a261d9..b3662e17f256 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -227,13 +227,12 @@ [LibraryClasses] =20 ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScrip= tLib.inf SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib= /BaseOrderedCollectionRedBlackTreeLib.inf - XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibN= ull.inf @@ -781,12 +780,13 @@ [Components.X64] MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf MdeModulePkg/Universal/Metronome/Metronome.inf PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.i= nf MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { + XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf !ifdef $(CSM_ENABLE) NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf NULL|OvmfPkg/Csm/LegacyBootManagerLib/LegacyBootManagerLib.inf !endif } MdeModulePkg/Logo/LogoDxe.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index ab60c36eca27..0a237a905866 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -227,13 +227,12 @@ [LibraryClasses] =20 ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScrip= tLib.inf SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib= /BaseOrderedCollectionRedBlackTreeLib.inf - XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibN= ull.inf @@ -779,12 +778,13 @@ [Components] MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf MdeModulePkg/Universal/Metronome/Metronome.inf PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.i= nf MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { + XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf !ifdef $(CSM_ENABLE) NULL|OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf NULL|OvmfPkg/Csm/LegacyBootManagerLib/LegacyBootManagerLib.inf !endif } MdeModulePkg/Logo/LogoDxe.inf --=20 2.19.1.3.g30247aa5d201 -=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 (#75714): https://edk2.groups.io/g/devel/message/75714 Mute This Topic: https://groups.io/mt/83111260/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-