Re: [patch V2 03/37] x86/microcode/intel: Move microcode functions out of cpu/intel.c

From: Thomas Gleixner
Date: Wed Aug 23 2023 - 13:46:26 EST


On Wed, Aug 23 2023 at 20:51, Qiuxu Zhuo wrote:
>> -#define get_totalsize(mc) \
>> - (((struct microcode_intel *)mc)->hdr.datasize ? \
>> - ((struct microcode_intel *)mc)->hdr.totalsize : \
>> - DEFAULT_UCODE_TOTALSIZE)
>> +#define DEFAULT_UCODE_DATASIZE (2000)
>>
>> ...
>> +
>> +static inline unsigned int get_totalsize(struct microcode_header_intel *hdr)
>> +{
>> + return hdr->datasize ? : DEFAULT_UCODE_TOTALSIZE;
>
> I tested this patch series and observed that the inline code above failed
> the late microcode loading with the error message:
>
> [ 117.100299] microcode: Error: bad microcode data file size.
>
> According to the original get_totalsize() macro, seems like it should be:
>
> return hdr->datasize ? hdr->totalsize : DEFAULT_UCODE_TOTALSIZE;
>
> With this minor change, the late microcode loading was successful, and the
> expected message was displayed:

Yes. I messed that up. Borislav already fixed it up when applying the
first 9 patches.