From nobody Mon Feb 9 09:33:48 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+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: 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-