Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This scans the ucode blob for the proper container as we can have multiple* containers glued together. Returns the equivalence ID from the equivalence* table or 0 if none found.* Returns the amount of bytes consumed while scanning. @desc contains all the

Proto:static size_t parse_container(u8 *ucode, size_t size, struct cont_desc *desc)

Type:size_t

Parameter:

TypeParameterName
u8 *ucode
size_tsize
struct cont_desc *desc
299  orig_size = size
300  hdr = ucode
304  If Not Check whether there is a valid, non-truncated CPU equivalence table at the* beginning of @buf of size @buf_size. Set @early to use this function in the* early path. Then Return 0
307  buf = ucode
309  entry = buf + CONTAINER_HDR_SZ
310  num_entries = hdr[2] / sizeof(structequiv_cpu_entry)
317  eq_id = find_equiv_id( & table, cpuid_1_eax)
319  buf += hdr[2] + CONTAINER_HDR_SZ
320  size -= hdr[2] + CONTAINER_HDR_SZ
326  When size > 0 cycle
331  ret = Verify the patch in @buf.* Returns:* negative: on error* positive: patch is not for this family, skip it* 0: success
332  If ret < 0 Then
337  Go to out
338  Else if ret > 0 Then
339  Go to skip
342  mc = buf + SECTION_HDR_SIZE
343  If eq_id == processor_rev_id Then
344  psize = patch_size
345  mc = mc
348  :
350  buf += patch_size + SECTION_HDR_SIZE
351  size -= patch_size + SECTION_HDR_SIZE
361  If mc Then
362  data = ucode
363  size = orig_size - size
365  Return 0
368  out :
369  Return orig_size - size
Caller
NameDescribe
scan_containersScan the ucode blob for the proper container as we can have multiple* containers glued together.