Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Apply per-object alternatives. Based on x86 module_finalize()

Proto:void arch_klp_init_object_loaded(struct klp_patch *patch, struct klp_object *obj)

Type:void

Parameter:

TypeParameterName
struct klp_patch *patch
struct klp_object *obj
17  Elf_Shdr * s, * alt = NULL, * para = NULL
23  info = klp_info
24  objname = If external Then external Else "vmlinux"
27  BUILD_BUG_ON - break compile if a condition is true(MODULE_NAME_LEN < 56 || KSYM_NAME_LEN != 128)
29  When s < sechdrs + e_shnum cycle
31  cnt = sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments
34  If cnt != 2 Then Continue
36  If strcmp(sec_objname, objname) Then Continue
38  If Not strcmp(".altinstructions", secname) Then alt = s
40  If Not strcmp(".parainstructions", secname) Then para = s
44  If alt Then
45  aseg = sh_addr
46  Replace instructions with better alternatives for this CPU type. This runs* before SMP is initialized to avoid SMP problems with self modifying code.* This implies that asymmetric systems where APs have less capabilities than
49  If para Then
50  pseg = sh_addr
51  apply_paravirt(pseg, pseg + sh_size)