From nobody Sat May 18 21:16:14 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+95489+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+95489+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1666584326; cv=none; d=zohomail.com; s=zohoarc; b=n2S20Oumbz+fqYXFiq2nzP74qcjT5rNFJGI0Vm2rNXTdk+owYLZ7r6vxKJWSFpUomJdGwdnEW30T64EK4WO3zg4LmH3wVSx2snXdjT+UZgswx7VySzAaxDhKrS+AxEk7AWkpuEva5JNp/uJrZtpj7XpKjhppAboVmf9l5Tk+IFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666584326; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=0SIKT3jvEEqyvAIfzzaApvMtJbquBB5tc5aEbte0vmc=; b=UVEJjpGPiTEJg+zXbHm27Tnq/yt/LEWA9ruTut8+9aFn8DpPtWCHljV00k9Xc/S4Cy0nsYUfIyZUNDU2KkzdWsucy/mGnJZmUQfMJy04uOBjT9JxImpYicd0Q2lPwoSOuEbCN4CTS+O8zx2ByE3JDiz16+xr6LRDW7URXiJwHps= 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+95489+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1666584326204943.8884547845349; Sun, 23 Oct 2022 21:05:26 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6dvbYY1788612xvwCaVPjXTK; Sun, 23 Oct 2022 21:05:24 -0700 X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.15802.1666584323759694025 for ; Sun, 23 Oct 2022 21:05:24 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10509"; a="287052428" X-IronPort-AV: E=Sophos;i="5.95,207,1661842800"; d="scan'208";a="287052428" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2022 21:05:23 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10509"; a="633581945" X-IronPort-AV: E=Sophos;i="5.95,207,1661842800"; d="scan'208";a="633581945" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.212.195.33]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2022 21:05:22 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH] IntelFsp2Pkg: FSP should support input UPD as NULL. Date: Sun, 23 Oct 2022 21:05:11 -0700 Message-Id: <20221024040511.2081-1-chasel.chiu@intel.com> MIME-Version: 1.0 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,chasel.chiu@intel.com X-Gm-Message-State: x368FYPtNCiEXX2bjMGJbZDYx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1666584324; bh=T5zHCZaWCnAh43CS0liFV4oGFzb9PjEjGRFF0ijvcf4=; h=Cc:Date:From:Reply-To:Subject:To; b=nJ4ITd5JOQ8NEL8qe2qX6jQAm1o48NGXVa+y8hV20+5wRKzwXO3iVhgC0ysql3qLkE+ w2hGDkcUkCiilU8FNlqDfinKwkc/CPpH5CegN4hv5jYdlNyuYtU6Bytv+WE9nOiiMZUUW Edy/j+1Nl/YEXVyxwj4aWYhGaYLPTVnKmvU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1666584327173100001 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4114 FSP specification supports input UPD as NULL cases which FSP will use built-in UPD region instead. FSP should not return INVALID_PARAMETER in such cases. Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Chasel Chiu Reviewed-by: Nate DeSimone --- IntelFsp2Pkg/FspSecCore/SecFspApiChk.c | 11 +++++++++-- IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm | 8 -------- IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm | 7 ------- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c b/IntelFsp2Pkg/FspSecCo= re/SecFspApiChk.c index a44fbf2a50..bfbdf70083 100644 --- a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c +++ b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c @@ -44,6 +44,8 @@ FspApiCallingCheck ( // if (((UINTN)FspData !=3D MAX_ADDRESS) && ((UINTN)FspData !=3D MAX_UINT= 32)) { Status =3D EFI_UNSUPPORTED; + } else if (ApiParam =3D=3D NULL) { + Status =3D EFI_SUCCESS; } else if (EFI_ERROR (FspUpdSignatureCheck (ApiIdx, ApiParam))) { Status =3D EFI_INVALID_PARAMETER; } @@ -67,9 +69,12 @@ FspApiCallingCheck ( } else { if (FspData->Signature !=3D FSP_GLOBAL_DATA_SIGNATURE) { Status =3D EFI_UNSUPPORTED; - } else if (EFI_ERROR (FspUpdSignatureCheck (FspSiliconInitApiIndex, = ApiParam))) { - Status =3D EFI_INVALID_PARAMETER; } else if (ApiIdx =3D=3D FspSiliconInitApiIndex) { + if (ApiParam =3D=3D NULL) { + Status =3D EFI_SUCCESS; + } else if (EFI_ERROR (FspUpdSignatureCheck (FspSiliconInitApiIndex= , ApiParam))) { + Status =3D EFI_INVALID_PARAMETER; + } // // Reset MultiPhase NumberOfPhases to zero // @@ -89,6 +94,8 @@ FspApiCallingCheck ( } else { if (FspData->Signature !=3D FSP_GLOBAL_DATA_SIGNATURE) { Status =3D EFI_UNSUPPORTED; + } else if (ApiParam =3D=3D NULL) { + Status =3D EFI_SUCCESS; } else if (EFI_ERROR (FspUpdSignatureCheck (FspSmmInitApiIndex, ApiP= aram))) { Status =3D EFI_INVALID_PARAMETER; } diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm b/IntelFsp2Pkg/= FspSecCore/Ia32/FspApiEntryT.nasm index 61030a843b..52e1ff6f1f 100644 --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm @@ -555,14 +555,6 @@ ASM_PFX(TempRamInitApi): SAVE_EAX SAVE_EDX =20 - ; - ; Check Parameter - ; - mov eax, dword [esp + 4] - cmp eax, 0 - mov eax, 80000002h - jz TempRamInitExit - ; ; Sec Platform Init ; diff --git a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm b/IntelFsp2Pkg/F= spSecCore/X64/FspApiEntryT.nasm index 7dd89c531a..23bb2b0481 100644 --- a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm +++ b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm @@ -441,13 +441,6 @@ ASM_PFX(TempRamInitApi): or rax, rdx SAVE_TS rax =20 - ; - ; Check Parameter - ; - cmp rcx, 0 - mov rcx, 08000000000000002h - jz TempRamInitExit - ; ; Sec Platform Init ; --=20 2.35.0.windows.1 -=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 (#95489): https://edk2.groups.io/g/devel/message/95489 Mute This Topic: https://groups.io/mt/94527493/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-