From nobody Mon Feb 9 07:05:54 2026 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: 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-