From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.12280.1647966107767530502 for ; Tue, 22 Mar 2022 09:21:47 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=aWHh5cCY; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [47.202.59.224]) by linux.microsoft.com (Postfix) with ESMTPSA id 79FD020B4783; Tue, 22 Mar 2022 09:21:46 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 79FD020B4783 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1647966107; bh=Xj9h8t2xRtJrC2ACDKmtEVzjkdMxLYiApLqGdwG3Spo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aWHh5cCYF7T+5XeYSA7dtFZ1FA9tUPmF5GPmHMzht/mC3G7xBFklgQGHqpRrUZGsp xF4Wo6LyEm2bg44mkU2C5X2+ao3Uz3PXSYpURcwWq5iRUu1laaelQRZDxY3t1NXQ2s NWTnVzxMo1tbNk+oY/jjTDY6417APIwj2N3cxEFk= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Andrew Fish , Kang Gao , Michael D Kinney , Michael Kubacki , Leif Lindholm , Benjamin You , Liu Yun , Ankit Sinha , Nate DeSimone Subject: [PATCH v1 19/41] PrmPkg/PrmLoaderDxe: Add ACPI parameter buffer support Date: Tue, 22 Mar 2022 12:19:25 -0400 Message-Id: <20220322161947.9319-20-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20220322161947.9319-1-mikuback@linux.microsoft.com> References: <20220322161947.9319-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki Adds support to PrmLoaderDxe to move the ACPI parameter buffer address for a given PRM handler to the corresponding field in the PRM handler information structure (PRMT ACPI table). Cc: Andrew Fish Cc: Kang Gao Cc: Michael D Kinney Cc: Michael Kubacki Cc: Leif Lindholm Cc: Benjamin You Cc: Liu Yun Cc: Ankit Sinha Cc: Nate DeSimone Signed-off-by: Michael Kubacki --- PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c b/PrmPkg/PrmLoaderDxe/Prm= LoaderDxe.c index 433d81cf8009..6416e388a668 100644 --- a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c +++ b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c @@ -621,6 +621,7 @@ ProcessPrmModules ( PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY *TempListEntry; CONST CHAR8 *CurrentExportDescriptorHandle= rName; =20 + ACPI_PARAMETER_BUFFER_DESCRIPTOR *CurrentModuleAcpiParamDescrip= tors; PRM_CONTEXT_BUFFER *CurrentContextBuffer; PRM_MODULE_CONTEXT_BUFFERS *CurrentModuleContextBuffers; PRM_MODULE_INFORMATION_STRUCT *CurrentModuleInfoStruct; @@ -628,6 +629,7 @@ ProcessPrmModules ( =20 EFI_STATUS Status; EFI_PHYSICAL_ADDRESS CurrentImageAddress; + UINTN AcpiParamIndex; UINTN HandlerIndex; UINT32 PrmAcpiDescriptionTableBufferS= ize; =20 @@ -677,6 +679,7 @@ ProcessPrmModules ( CurrentImageAddress =3D TempListEntry->Context->PeCoffImageContext.I= mageAddress; CurrentImageExportDirectory =3D TempListEntry->Context->ExportDirect= ory; CurrentExportDescriptorStruct =3D TempListEntry->Context->ExportDesc= riptor; + CurrentModuleAcpiParamDescriptors =3D NULL; =20 DEBUG (( DEBUG_INFO, @@ -715,6 +718,7 @@ ProcessPrmModules ( ASSERT (!EFI_ERROR (Status) || Status =3D=3D EFI_NOT_FOUND); if (!EFI_ERROR (Status) && CurrentModuleContextBuffers !=3D NULL) { CurrentModuleInfoStruct->RuntimeMmioRanges =3D (UINT64) (UINTN) Cu= rrentModuleContextBuffers->RuntimeMmioRanges; + CurrentModuleAcpiParamDescriptors =3D CurrentModuleContextBuffers-= >AcpiParameterBufferDescriptors; } =20 // @@ -759,6 +763,19 @@ ProcessPrmModules ( CurrentHandlerInfoStruct->PhysicalAddress )); } + + // + // Update the handler ACPI parameter buffer address if applicable + // + if (CurrentModuleAcpiParamDescriptors !=3D NULL) { + for (AcpiParamIndex =3D 0; AcpiParamIndex < CurrentModuleContext= Buffers->AcpiParameterBufferDescriptorCount; AcpiParamIndex++) { + if (CompareGuid (&CurrentModuleAcpiParamDescriptors[AcpiParamI= ndex].HandlerGuid, &CurrentHandlerInfoStruct->Identifier)) { + CurrentHandlerInfoStruct->AcpiParameterBuffer =3D (UINT64) (= UINTN) ( + CurrentMod= uleAcpiParamDescriptors[AcpiParamIndex].AcpiParameterBufferAddress + ); + } + } + } } CurrentModuleInfoStruct =3D (PRM_MODULE_INFORMATION_STRUCT *) ((UINT= N) CurrentModuleInfoStruct + CurrentModuleInfoStruct->StructureLength); } --=20 2.28.0.windows.1