From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.4712.1603335108993561604 for ; Wed, 21 Oct 2020 19:51:49 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: cosmo.lai@intel.com) IronPort-SDR: OTSuyCgt5mwa4BPDLIX9AtVzNxME6lyXsAOv2VjC4SpdRXMpbF+sT1lc7zDjfR0LM26BVj+pip KH6QcI5OHuAA== X-IronPort-AV: E=McAfee;i="6000,8403,9781"; a="185137188" X-IronPort-AV: E=Sophos;i="5.77,403,1596524400"; d="scan'208";a="185137188" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2020 19:51:48 -0700 IronPort-SDR: zkFLwPBf7NWpp631zNtU01mHYYrVCtkYL7Jr/fRiYQcq70iixJsgjjzJ/q7XbCMwrwi1XRUuZk rPUoHRmWcC1g== X-IronPort-AV: E=Sophos;i="5.77,403,1596524400"; d="scan'208";a="321222921" Received: from dangpham-mobl.ccr.corp.intel.com (HELO cosmolai-MOBL.gar.corp.intel.com) ([10.252.190.168]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2020 19:51:46 -0700 From: Cosmo Lai To: devel@edk2.groups.io Cc: Cosmo Lai , Maurice Ma , Nate DeSimone , Star Zeng , Chasel Chiu Subject: [PATCH] IntelFsp2Pkg/FspSecCore: LoadMicrocodeDefault() failed with padding in FV. Date: Thu, 22 Oct 2020 10:51:27 +0800 Message-Id: <20201022025127.1136-1-cosmo.lai@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3017 Platform microcode FV may have padding between each version of microcode binary, and current FSP-T/LoadMicrocodeDefault() cannot handle this case and return not_found unexpectedly. Cc: Maurice Ma Cc: Nate DeSimone Cc: Star Zeng Cc: Chasel Chiu Signed-off-by: Cosmo Lai --- IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm index 7934eab6d7..7fd3d6d843 100644 --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm @@ -307,10 +307,6 @@ AdvanceFixedSize: add esi, dword 1024 CheckAddress: - ; Is valid Microcode start point ? - cmp dword [esi + MicrocodeHdr.MicrocodeHdrVersion], 0ffffffffh - jz Done - ; Check UPD header revision cmp byte [esp + LoadMicrocodeParamsFsp22.FspUpdHeaderRevision], 2 jae Fsp22UpdHeader1 @@ -341,6 +337,10 @@ Fsp22UpdHeader1: jmp CheckMainHeader LoadMicrocodeDefault4: + ; Is valid Microcode start point ? + cmp dword [esi + MicrocodeHdr.MicrocodeHdrVersion], 0ffffffffh + jz Done + LoadCheck: ; Get the revision of the current microcode update loaded mov ecx, MSR_IA32_BIOS_SIGN_ID -- 2.16.2.windows.1