@@ -1340,17 +1340,6 @@ USTATUS FfsParser::parseVolumeHeader(const UByteArray & volume, const UINT32 loc
13401340bool FfsParser::microcodeHeaderValid (const INTEL_MICROCODE_HEADER* ucodeHeader)
13411341{
13421342 bool reservedBytesValid = true ;
1343-
1344- // Check CpuFlags reserved bytes to be zero
1345- for (UINT32 i = 0 ; i < sizeof (ucodeHeader->ProcessorFlagsReserved ); i++) {
1346- if (ucodeHeader->ProcessorFlagsReserved [i] != 0x00 ) {
1347- reservedBytesValid = false ;
1348- break ;
1349- }
1350- }
1351- if (!reservedBytesValid) {
1352- return false ;
1353- }
13541343
13551344 // Check data size to be multiple of 4 and less than 0x1000000
13561345 if (ucodeHeader->DataSize % 4 != 0 ||
@@ -1389,8 +1378,8 @@ bool FfsParser::microcodeHeaderValid(const INTEL_MICROCODE_HEADER* ucodeHeader)
13891378 ucodeHeader->DateYear > 0x2049 ) {
13901379 return FALSE ;
13911380 }
1392- // Check HeaderVersion to be 1.
1393- if (ucodeHeader->HeaderVersion != 1 ) {
1381+ // Check HeaderType to be 1.
1382+ if (ucodeHeader->HeaderType != 1 ) {
13941383 return FALSE ;
13951384 }
13961385 // Check LoaderRevision to be 1.
@@ -4268,13 +4257,13 @@ USTATUS FfsParser::parseIntelMicrocodeHeader(const UByteArray & microcode, const
42684257
42694258 // Recalculate checksum after patching
42704259 tempUcodeHeader->Checksum = 0 ;
4271- tempUcodeHeader->ProcessorFlags = entry->ProcessorFlags ;
4260+ tempUcodeHeader->PlatformIds = entry->PlatformIds ;
42724261 tempUcodeHeader->ProcessorSignature = entry->ProcessorSignature ;
42734262 UINT32 entryCalculated = calculateChecksum32 ((const UINT32*)tempMicrocode.constData (), sizeof (INTEL_MICROCODE_HEADER) + dataSize);
42744263
4275- extendedHeaderInfo += usprintf (" \n CPU signature #%u: %08Xh\n CPU flags #%u: %02Xh \n Checksum #%u: %08Xh, " ,
4264+ extendedHeaderInfo += usprintf (" \n CPU signature #%u: %08Xh\n CPU platform Id #%u: %08Xh \n Checksum #%u: %08Xh, " ,
42764265 i + 1 , entry->ProcessorSignature ,
4277- i + 1 , entry->ProcessorFlags ,
4266+ i + 1 , entry->PlatformIds ,
42784267 i + 1 , entry->Checksum )
42794268 + (entry->Checksum == entryCalculated ? UString (" valid" ) : usprintf (" invalid, should be %08Xh" , entryCalculated));
42804269 }
@@ -4293,15 +4282,16 @@ USTATUS FfsParser::parseIntelMicrocodeHeader(const UByteArray & microcode, const
42934282 // Add info
42944283 UString name (" Intel microcode" );
42954284 UString info = usprintf (" Full size: %Xh (%u)\n Header size: 0h (0u)\n Body size: %Xh (%u)\n Tail size: 0h (0u)\n "
4296- " Date: %02X.%02X.%04x\n CPU signature: %08Xh\n Revision: %08Xh\n CPU flags : %02Xh \n Checksum: %08Xh, " ,
4285+ " Date: %02X.%02X.%04x\n CPU signature: %08Xh\n Revision: %08Xh\n Minimal update revision: %08Xh \ n CPU platform Id : %08Xh \n Checksum: %08Xh, " ,
42974286 (UINT32)microcodeBinary.size (), (UINT32)microcodeBinary.size (),
42984287 (UINT32)microcodeBinary.size (), (UINT32)microcodeBinary.size (),
42994288 ucodeHeader->DateDay ,
43004289 ucodeHeader->DateMonth ,
43014290 ucodeHeader->DateYear ,
43024291 ucodeHeader->ProcessorSignature ,
43034292 ucodeHeader->UpdateRevision ,
4304- ucodeHeader->ProcessorFlags ,
4293+ ucodeHeader->UpdateRevisionMin ,
4294+ ucodeHeader->PlatformIds ,
43054295 ucodeHeader->Checksum )
43064296 + (ucodeHeader->Checksum == calculated ? UString (" valid" ) : usprintf (" invalid, should be %08Xh" , calculated))
43074297 + extendedHeaderInfo;
0 commit comments