Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\common.c Create Date:2022-07-28 07:55:34
Last Modify:2020-03-16 20:28:31 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto:void cpu_init(void)

Type:void

Parameter:Nothing

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 = current process
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  If Operations with implied preemption/interrupt protection. These* operations can be used without worrying about preemption or interrupt.(numa_node) == 0 && Same function but used if called before per_cpu areas are setup != NUMA_NO_NODE Then set_numa_node(Same function but used if called before per_cpu areas are setup )
1870  setup_getcpu(cpu)
1872  pr_debug("Initializing CPU#%d\n", cpu)
1874  If 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 ) Then 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  If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_X86_64) Then
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  active_mm = init_mm
1899  BUG_ON(mm)
1900  initialize_tlbstate_and_flush()
1901  enter_lazy_tlb( & init_mm, cur)
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  If is_uv_system() Then uv_cpu_init()
1927  Load a fixmap remapping of the per-cpu GDT
Caller
NameDescribe
start_secondaryActivate a secondary processor.
trap_init