Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:void klp_init_transition(struct klp_patch *patch, int state)

Type:void

Parameter:

TypeParameterName
struct klp_patch *patch
intstate
510  initial_state = Not 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  for_each_possible_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
Caller
NameDescribe
__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//*