函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\microcode\amd.c Create Date:2022-07-27 09:09:07
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Verify the patch in @buf.* Returns:* negative: on error* positive: patch is not for this family, skip it* 0: success

函数原型:static int verify_patch(u8 family, const u8 *buf, size_t buf_size, unsigned int *patch_size, bool early)

返回类型:int

参数:

类型参数名称
u8family
const u8 *buf
size_tbuf_size
unsigned int *patch_size
boolearly
244  如果非Check whether there is a valid, non-truncated microcode patch section at the* beginning of @buf of size @buf_size. Set @early to use this function in the* early path.* On success, @sh_psize returns the patch size according to the section header,则返回:负1
252  buf_size减等于SECTION_HDR_SIZE
258  如果buf_size小于sh_psize
259  如果非earlypr_debug("Patch of size %u truncated.\n", sh_psize)
262  返回:负1
265  ret等于Check whether the passed remaining file @buf_size is large enough to contain* a patch of the indicated @sh_psize (and also whether this size does not* exceed the per-family maximum). @sh_psize is the size read from the section* header.
266  如果非ret
267  如果非earlypr_debug("Per-family patch size mismatch.\n")
269  返回:负1
272  patch_size等于sh_psize
274  mc_hdr等于bufSECTION_HDR_SIZE
275  如果nb_dev_idsb_dev_id
276  如果非early打印错误信息("Patch-ID 0x%08x: chipset-specific code unsupported.\n", patch_id)
278  返回:负1
281  proc_id等于processor_rev_id
282  patch_fam等于0xf加proc_id右移12位的值
283  如果patch_fam不等于family则返回:1
286  返回:0
调用者
名称描述
parse_containerThis 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
verify_and_add_patchReturn a non-negative value even if some of the checks failed so that* we can skip over the next patch. If we return a negative value, we* signal a grave error like a memory allocation has failed and the* driver cannot continue functioning normally