函数逻辑报告

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:05
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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,

函数原型:static bool __verify_patch_section(const u8 *buf, size_t buf_size, unsigned int *sh_psize, bool early)

返回类型:bool

参数:

类型参数名称
const u8 *buf
size_tbuf_size
unsigned int *sh_psize
boolearly
161  如果buf_size小于SECTION_HDR_SIZE
162  如果非earlypr_debug("Truncated patch section.\n")
165  返回:false
168  hdr等于buf
169  p_type等于hdr[0]
170  p_size等于hdr[1]
172  如果p_type不等于UCODE_UCODE_TYPE
173  如果非earlypr_debug("Invalid type field (0x%x) in container file section header.\n", p_type)
177  返回:false
180  如果p_size小于sizeof(structmicrocode_header_amd)则
181  如果非earlypr_debug("Patch of size %u too short.\n", p_size)
184  返回:false
187  sh_psize等于p_size
189  返回:true
调用者
名称描述
verify_patchVerify the patch in @buf.* Returns:* negative: on error* positive: patch is not for this family, skip it* 0: success