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:08:59
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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,

Proto:static bool __verify_patch_section(const u8 *buf, size_t buf_size, unsigned int *sh_psize, bool early)

Type:bool

Parameter:

TypeParameterName
const u8 *buf
size_tbuf_size
unsigned int *sh_psize
boolearly
161  If buf_size < SECTION_HDR_SIZE Then
162  If Not early Then pr_debug("Truncated patch section.\n")
165  Return false
168  hdr = buf
169  p_type = hdr[0]
170  p_size = hdr[1]
172  If p_type != UCODE_UCODE_TYPE Then
173  If Not early Then pr_debug("Invalid type field (0x%x) in container file section header.\n", p_type)
177  Return false
180  If p_size < sizeof(structmicrocode_header_amd) Then
181  If Not early Then pr_debug("Patch of size %u too short.\n", p_size)
184  Return false
187  sh_psize = p_size
189  Return true
Caller
NameDescribe
verify_patchVerify the patch in @buf.* Returns:* negative: on error* positive: patch is not for this family, skip it* 0: success