函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\livepatch\transition.c Create Date:2022-07-27 11:31:59
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Initialize the global target patch state and all tasks to the initial patch* state, and initialize all function transition states to true in preparation* for patching or unpatching.

函数原型:void klp_init_transition(struct klp_patch *patch, int state)

返回类型:void

参数:

类型参数名称
struct klp_patch *patch
intstate
510  initial_state等于非state
512  WARN_ON_ONCE(klp_target_state != ask patch states )
514  klp_transition_patch等于patch
520  klp_target_state等于state
522  pr_debug("'%s': initializing %s transition\n", Unique handle for this module , klp_target_state == KLP_PATCHED ? "patching" : "unpatching")
529  read_lock( & tasklist_lock)
530  Careful: this is a double loop, 'break' won't work as expected. (g, task)
531  WARN_ON_ONCE(patch_state != ask patch states )
532  patch_state等于initial_state
534  read_unlock( & tasklist_lock)
539  遍历可用CPU(cpu)
540  task等于dle_task - return the idle task for a given CPU.*@cpu: the processor in question.* Return: The idle task for the CPU @cpu.
541  WARN_ON_ONCE(patch_state != ask patch states )
542  patch_state等于initial_state
554  smp_wmb()
567  klp_for_each_object(patch, obj)
568  klp_for_each_func(obj, func)
569  transition = true
调用者
名称描述
__klp_enable_patch
__klp_disable_patchSysfs Interface* /sys/kernel/livepatch* /sys/kernel/livepatch/* /sys/kernel/livepatch//enabled* /sys/kernel/livepatch//transition* /sys/kernel/livepatch//force* /sys/kernel/livepatch//*