From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=JWG0RQBT; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: chasel.chiu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666584323; x=1698120323; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Nl1KXgI4CxsTytjbG3WuLsS6swDPYAm/0I0/dfB0DCY=; b=JWG0RQBTjAB7dFUHfvaoDeU5ardh6F95nd6d4DvVWShL+QFRvJNTP2qe skpZK05krM0GsjkV6qMfIH30/YDMvjbjjPDDFwH7a3axwrfzGsLm40vzX GbOIDTdJUIVEWuvf6PjDtzzN07pZbLvmbeKKlrWZQNV/NPKpIeSseTFvZ TD4wkHsWiF72tjMPW4z+fE/MkpXKvqWO9ziYYL65E383ZUI59VGfjqA1Q U/Ky2LiKLF5A320Uxti35Ns05qPAJ8LR1JznbhRj9B0xiDAVioj0IqZn5 AN9p5qIdEaiWtOpUnKKgYsC2spIbNIyOuuK2xdv9avvJUACmGfQGjC1uY w==; 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" 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" 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: [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> X-Mailer: git-send-email 2.35.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 --- 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 ( //=0D if (((UINTN)FspData !=3D MAX_ADDRESS) && ((UINTN)FspData !=3D MAX_UINT= 32)) {=0D Status =3D EFI_UNSUPPORTED;=0D + } else if (ApiParam =3D=3D NULL) {=0D + Status =3D EFI_SUCCESS;=0D } else if (EFI_ERROR (FspUpdSignatureCheck (ApiIdx, ApiParam))) {=0D Status =3D EFI_INVALID_PARAMETER;=0D }=0D @@ -67,9 +69,12 @@ FspApiCallingCheck ( } else {=0D if (FspData->Signature !=3D FSP_GLOBAL_DATA_SIGNATURE) {=0D Status =3D EFI_UNSUPPORTED;=0D - } else if (EFI_ERROR (FspUpdSignatureCheck (FspSiliconInitApiIndex, = ApiParam))) {=0D - Status =3D EFI_INVALID_PARAMETER;=0D } else if (ApiIdx =3D=3D FspSiliconInitApiIndex) {=0D + if (ApiParam =3D=3D NULL) {=0D + Status =3D EFI_SUCCESS;=0D + } else if (EFI_ERROR (FspUpdSignatureCheck (FspSiliconInitApiIndex= , ApiParam))) {=0D + Status =3D EFI_INVALID_PARAMETER;=0D + }=0D //=0D // Reset MultiPhase NumberOfPhases to zero=0D //=0D @@ -89,6 +94,8 @@ FspApiCallingCheck ( } else {=0D if (FspData->Signature !=3D FSP_GLOBAL_DATA_SIGNATURE) {=0D Status =3D EFI_UNSUPPORTED;=0D + } else if (ApiParam =3D=3D NULL) {=0D + Status =3D EFI_SUCCESS;=0D } else if (EFI_ERROR (FspUpdSignatureCheck (FspSmmInitApiIndex, ApiP= aram))) {=0D Status =3D EFI_INVALID_PARAMETER;=0D }=0D 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=0D SAVE_EDX=0D =0D - ;=0D - ; Check Parameter=0D - ;=0D - mov eax, dword [esp + 4]=0D - cmp eax, 0=0D - mov eax, 80000002h=0D - jz TempRamInitExit=0D -=0D ;=0D ; Sec Platform Init=0D ;=0D 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=0D SAVE_TS rax=0D =0D - ;=0D - ; Check Parameter=0D - ;=0D - cmp rcx, 0=0D - mov rcx, 08000000000000002h=0D - jz TempRamInitExit=0D -=0D ;=0D ; Sec Platform Init=0D ;=0D --=20 2.35.0.windows.1