函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\common.c Create Date:2022-07-27 08:55:52
Last Modify:2020-03-16 20:28:31 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:pu_init() initializes state that is per-CPU. Some data is already* initialized (naturally) in the bootstrap process, such as the GDT* and IDT. We reload them nevertheless, this function acts as a* 'CPU state barrier', nothing should get across.

函数原型:void cpu_init(void)

返回类型:void

参数:

1857  tss等于this_cpu_ptr( & per-CPU TSS segments. Threads are completely 'soft' on Linux,* no more per-task TSS's. The TSS size is kept cacheline-aligned* so they are allowed to end up in the .data..cacheline_aligned* section. Since TSS's are completely CPU-local, we want them)
1858  cur等于当前进程
1859  cpu等于These macros fold the SMP functionality into a single CPU system()
1861  wait_for_master_cpu(cpu)
1863  ucode_cpu_init(cpu)
1866  如果Operations with implied preemption/interrupt protection. These* operations can be used without worrying about preemption or interrupt.(numa_node)恒等于0且取得CPU的NUMA节点不等于NUMA_NO_NODEset_numa_node(取得CPU的NUMA节点)
1870  setup_getcpu(cpu)
1872  pr_debug("Initializing CPU#%d\n", cpu)
1874  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_X86_64)或This macro is for detection of features which need kernel* infrastructure to be used(Virtual Mode Extensions )或boot_cpu_has(Time Stamp Counter )或boot_cpu_has(Debugging Extensions )则Clear in this cpu's CR4.
1882  Current gdt points %fs at the "master" per-cpu area: after this,* it's on the real one.
1883  The load_current_idt() must be called with interrupts disabled* to avoid races
1885  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_X86_64)则
1886  loadsegment(取寄存器值(fs), 0)
1887  memset( Cached TLS descriptors: , 0, GDT_ENTRY_TLS_ENTRIES * 8)
1888  May not be marked __init: used by software suspend
1890  wrmsrl(64bit FS base , 0)
1891  wrmsrl(SwapGS GS shadow , 0)
1892  The "volatile" is due to gcc bugs ()
1894  x2apic_setup()
1897  mmgrab() - Pin a &struct mm_struct
1898  活跃内存信息等于init_mm
1899  BUG_ON(内存信息)
1900  initialize_tlbstate_and_flush()
1901  通知底层不需要切换虚拟地址空间
1904  tss_setup_ist(tss)
1905  tss_setup_io_bitmap(tss)
1906  set_tss_desc(cpu, & x86_tss)
1908  load_TR_desc()
1913  load_sp0((unsignedlong)(cpu_entry_stack(cpu) + 1))
1915  load_mm_ldt( & init_mm)
1917  Clear all 6 debug registers:
1920  doublefault_init_cpu_tss()
1922  Enable all supported FPU features. Called when a CPU is brought online:
1924  如果is_uv_system()则uv_cpu_init()
1927  Load a fixmap remapping of the per-cpu GDT
调用者
名称描述
start_secondaryActivate a secondary processor.
trap_init设置异常处理程序