Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\microcode\intel.c Create Date:2022-07-28 08:08:20
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:microcode_sanity_check

Proto:static int microcode_sanity_check(void *mc, int print_err)

Type:int

Parameter:

TypeParameterName
void *mc
intprint_err
227  mc_header = mc
228  struct extended_sigtable * ext_header = NULL
229  ext_sigcount = 0
232  total_size = get_totalsize(mc_header)
233  data_size = get_datasize(mc_header)
235  If data_size + MC_HEADER_SIZE > total_size Then
236  If print_err Then pr_err("Error: bad microcode data file size.\n")
238  Return -EINVAL
241  If ldrver != 1 || hdrver != 1 Then
242  If print_err Then pr_err("Error: invalid/unknown microcode update format.\n")
244  Return -EINVAL
247  ext_table_size = total_size - MC_HEADER_SIZE + data_size
248  If ext_table_size Then
249  ext_table_sum = 0
254  If print_err Then pr_err("Error: truncated extended signature table.\n")
256  Return -EINVAL
259  ext_header = mc + MC_HEADER_SIZE + data_size
261  If print_err Then pr_err("Error: extended signature table size mismatch.\n")
263  Return -EFAULT
266  ext_sigcount = count
272  ext_tablep = ext_header
274  i = ext_table_size / sizeof(u32)
275  When i-- cycle
276  ext_table_sum += ext_tablep[i]
278  If ext_table_sum Then
279  If print_err Then pr_warn("Bad extended signature table checksum, aborting.\n")
281  Return -EINVAL
290  orig_sum = 0
291  i = (MC_HEADER_SIZE + data_size) / sizeof(u32)
292  When i-- cycle
293  orig_sum += )
295  If orig_sum Then
296  If print_err Then pr_err("Bad microcode data checksum, aborting.\n")
298  Return -EINVAL
301  If Not ext_table_size Then Return 0
307  When i < ext_sigcount cycle
308  ext_sig = ext_header + EXT_HEADER_SIZE + EXT_SIGNATURE_SIZE * i
311  sum = sig + pf + cksum - sig + pf + cksum
313  If sum Then
314  If print_err Then pr_err("Bad extended signature checksum, aborting.\n")
316  Return -EINVAL
319  Return 0
Caller
NameDescribe
scan_microcodeGet microcode matching with BSP's model. Only CPUs with the same model as* BSP can stay in the platform.
generic_load_microcode