函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\panic.c Create Date:2022-07-27 09:59:12
Last Modify:2022-05-22 10:57:01 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.

函数原型:void panic(const char *fmt, ...)

返回类型:void

参数:

类型参数名称
const char *fmt
171  i_next等于0
172  state等于0
174  _crash_kexec_post_notifiers等于crash_kexec_post_notifiers
182  禁止中断()
183  preempt_disable_notrace()
200  this_cpu等于These macros fold the SMP functionality into a single CPU system()
201  old_cpu等于atomic_cmpxchg( & panic_cpu, PANIC_CPU_INVALID, this_cpu)
203  如果old_cpu不等于PANIC_CPU_INVALIDold_cpu不等于this_cpuStop ourself in panic -- architecture code may override this
206  console_verbose()
207  bust_spinlocks(1)
208  va_start(args, fmt)
209  len等于格式化输出字符串
210  va_end(args)
212  如果lenbuf[len - 1]恒等于'\n'则buf[len - 1]等于'\0'
215  These can be used to print at the various log levels.* All of these will print unconditionally, although note that pr_debug()* and other debug macros are compiled out unless either DEBUG is defined* or CONFIG_DYNAMIC_DEBUG is set.("Kernel panic - not syncing: %s\n", buf)
229  kgdb_panic(buf)
239  如果非_crash_kexec_post_notifiers
240  printk_safe_flush_on_panic()
241  __crash_kexec(NULL)
248  smp_send_stop()
249  否则
255  Stop other CPUs in panic. Architecture dependent code may override this* with more suitable version. For example, if the architecture supports* crash dump, it should save registers of each stopped CPU and disable
262  atomic_notifier_call_chain( & panic_notifier_list, 0, buf)
265  printk_safe_flush_on_panic()
266  kmsg_dump(KMSG_DUMP_PANIC)
277  如果_crash_kexec_post_notifiers__crash_kexec(NULL)
283  console_unblank()
293  Generic 'turn off all lock debugging' function:
294  console_flush_on_panic(CONSOLE_FLUSH_PENDING)
296  panic_print_sys_info()
298  如果非panic_blinkpanic_blink等于no_blink
301  如果panic_timeout大于0则
306  These can be used to print at the various log levels.* All of these will print unconditionally, although note that pr_debug()* and other debug macros are compiled out unless either DEBUG is defined* or CONFIG_DYNAMIC_DEBUG is set.("Rebooting in %d seconds..\n", panic_timeout)
308 i小于panic_timeout乘1000循环
310  如果i大于等于i_next
311  i加等于panic_blink(state ^= 1)
312  i_next等于i加3600除PANIC_BLINK_SPD
317  如果panic_timeout不等于0则
323  如果panic_reboot_mode不等于REBOOT_UNDEFINEDreboot_mode = panic_reboot_mode
325  Emergency restart, callable from an interrupt handler.
339  These can be used to print at the various log levels.* All of these will print unconditionally, although note that pr_debug()* and other debug macros are compiled out unless either DEBUG is defined* or CONFIG_DYNAMIC_DEBUG is set.("---[ end Kernel panic - not syncing: %s ]---\n", buf)
342  suppress_printk等于1
343  开中断()
344  循环
345  touch_softlockup_watchdog()
346  如果i大于等于i_next
347  i加等于panic_blink(state ^= 1)
348  i_next等于i加3600除PANIC_BLINK_SPD
350  mdelay(PANIC_TIMER_STEP)
调用者
名称描述
oops_end
early_panic
e820__reserve_resources
tboot_create_trampoline
check_bugs检查CPU配置是否非法使用不具备的功能
wait_for_panicPanic in progress. Enable interrupts and wait for final IPI
mce_panic
__reload_lateReturns:* < 0 - on error* 0 - no update done* 1 - microcode was updated
setup_per_cpu_areasSMP体系CPU分配内存
validate_x2apic
mp_save_irqWill be called in mpparse/acpi/sfi codes for saving IRQ info
add_pin_to_irq_node
setup_ioapic_ids_from_mpc_nocheck to set the IO-APIC physical IDs based on the* values stored in the MPC table.* by Matt Domsch Tue Dec 21 12:25:05 CST 1999
check_timerThis code may look a bit paranoid, but it's supposed to cooperate with* a wide range of boards and BIOS bugs. Fortunately only the timer IRQ* is so screwy. Thanks to Brian Perkins for testing/hacking this beast* fanatically on his truly buggy board.
io_apic_get_unique_id
ioapic_setup_resources
io_apic_init_mappings
uv_undefined
generic_apic_probe
doublefault_shimCalled by double_fault with CR0.TS and EFLAGS.NT cleared. The CPU thinks* we're running the doublefault task. Cannot return.
apbt_set_mapping
apbt_clocksource_register
apbt_time_initEarly setup the APBT timer, only use timer 0 for booting then switch to* per CPU timer if possible.* returns 1 if per cpu apbt is setup* returns 0 if no per cpu apbt is chosen* panic if set up failed, this is the only platform timer on Moorestown.
jailhouse_init_platform
dma_map_areaMap a single continuous physical area into the IOMMU.* Caller needs to check if the iommu is needed and flush.
gart_map_sgDMA map all entries in a scatterlist.* Merge chunks that have page aligned sizes into a continuous mapping.
init_amd_gattPrivate Northbridge GATT initialization in case we cannot use the* AGP driver for some reason.
gart_iommu_init
gart_iommu_hole_init
nmi_panicA variant of panic() called from NMI context. We return if we've already* panicked on this CPU. If another CPU already panicked, loop in* nmi_panic_self_stop() which can provide architecture dependent code such* as saving register state for crash dump.
__warn
do_exit
abort
put_cred_rcuThe RCU callback to actually dispose of a set of credentials
SYSCALL_DEFINE4Reboot system call: for obvious reasons only root may call it,* and even root needs to set up some magic numbers in the registers* so that some mistake won't make this reboot the whole machine.* You can also set the meaning of the ctrl-alt-del-key here.
__schedule_bugPrint scheduling while atomic bug:
__register_nosave_regiongister_nosave_region - Register a region of unsaveable memory.* Register a range of page frames the contents of which should not be saved* during hibernation (to be used in the early initialization code).
swsusp_header_init
rcu_init_oneHelper function for rcu_init() that initializes the rcu_state structure.
swiotlb_init_with_tbl
swiotlb_tbl_map_single
audit_panic
audit_initInitialize audit support at boot time.
kgdb_reenter_check
check_hung_uninterruptible_tasksCheck whether a TASK_UNINTERRUPTIBLE does not get woken up for* a really long time (120 seconds). If that happens, print out* a warning.
setup_command_line保存未改变的comand_line到字符数组static_command_line中
start_kernel启动内核
kernel_init
find_link
dir_add
unpack_to_rootfs
populate_rootfs
mount_block_root
crd_load
out_of_memory_of_memory - kill the "best" process when we run out of memory*@oc: pointer to struct oom_control* If we run out of memory, we have the choice between either* killing a random task (bad), letting the system crash (worse)
pcpu_alloc_first_chunkpcpu_alloc_first_chunk - creates chunks that serve the first chunk*@tmp_addr: the start of the region served*@map_size: size of the region served* This is responsible for creating the chunks that serve the first chunk
pcpu_setup_first_chunkpcpu_setup_first_chunk - initialize the first percpu chunk*@ai: pcpu_alloc_info describing how to percpu area is shaped*@base_addr: mapped address* Initialize the first percpu chunk which contains the kernel static* percpu area
setup_per_cpu_areasUP percpu area setup.* UP always uses km-based percpu allocator with identity mapping.* Static percpu variables are indistinguishable from the usual static* variables and don't require any special preparation.
kmem_cache_create_usercopykmem_cache_create_usercopy - Create a cache with a region suitable* for copying to userspace*@name: A string which is used in /proc/slabinfo to identify this cache.*@size: The size of objects to be created in this cache.
setup_usemap
alloc_large_system_hashallocate a large system hash table from bootmem* - it is assumed that the hash table must contain an exact power-of-2* quantity of entries* - limit is the number of hash buckets, not the total allocation size
early_alloc
end_report
memory_failurememory_failure - Handle memory failure of a page.*@pfn: Page Number of the corrupted page*@flags: fine tune action taken* This function is called by the low level machine check code* of an architecture when it detects hardware memory corruption* of a page
page_ext_init_flatmem设置虚拟内存
init_bio
blk_dev_init
throtl_init
bio_integrity_init
key_proc_initDeclare the /proc files.
security_add_hookssecurity_add_hooks - Add a modules hooks to the hook lists.*@hooks: the hooks to add*@count: the number of hooks to add*@lsm: the name of the security module* Each LSM has to register its hooks with the infrastructure.
lsm_early_cred
lsm_early_task
selinux_init
selnl_init
smk_cipso_doismk_cipso_doi - initialize the CIPSO domain
tomoyo_check_profilemoyo_check_profile - Check all profiles currently assigned to domains are defined.
tomoyo_warn_oommoyo_warn_oom - Print out of memory warning message.*@function: Function's name.
aa_create_aafsaa_create_aafs - create the apparmor security filesystem* dentries created here are released by aa_destroy_aafs* Returns: error on failure
yama_init_sysctl
ima_mok_initAllocate the IMA blacklist keyring
init_mount_tree
mnt_init
nsfs_init
bdev_cache_init
fsnotify_init
dnotify_init
anon_inode_init
aio_setupaio_setup* Creates the slab caches used by the aio routines, panic on* failure as this is done early during the boot sequence.
dquot_init
__ubsan_handle_builtin_unreachable
do_double_faultRuns on an IST stack for x86_64 and on a special task stack for x86_32.* On x86_64, this is more or less a normal kernel entry. Notwithstanding the* SDM's warnings about double faults being unrecoverable, returning works as* expected
check_panic_on_oomDetermines whether the kernel must panic because of the panic_on_oom sysctl.
panic_on_rcu_stallIf so specified via sysctl, panic, yielding cleaner stall-warning output.