函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:init_espfix_ap

函数原型:void init_espfix_ap(int cpu)

返回类型:void

参数:

类型参数名称
intcpu
143  如果此条件成立可能性大(为编译器优化)(per_cpu(This contains the *bottom* address of the espfix stack , cpu))则返回
146  addr等于This returns the bottom address of the espfix stack for a specific CPU.* The math allows for a non-power-of-two ESPFIX_STACK_SIZE, in which case* we have to account for some amount of padding at the end of each page.
147  page等于cpuESPFIX_STACKS_PER_PAGE
150  stack_page等于READ_ONCE(espfix_pages[page])
151  如果此条件成立可能性大(为编译器优化)(stack_page)则转到:done
154  mutex_lock( & Initialization mutex - should this be a spinlock? )
157  stack_page等于READ_ONCE(espfix_pages[page])
158  如果stack_page则转到:unlock_done
161  node等于cpu_to_node(cpu)
162  ptemask等于__supported_pte_mask
164  pud_p等于espfix_pud_page[pud_index(addr)]
165  pud等于pud_p
166  如果非pud_present(pud)则
167  page等于Allocate pages, preferring the node given as nid. When nid == NUMA_NO_NODE,* prefer the current CPU's closest node. Otherwise node must be valid and* online.
169  pmd_p等于page_address(page)
170  pud等于__pud(__pa(pmd_p) | (PGTABLE_PROT & ptemask))
171  paravirt_alloc_pmd( & init_mm, __pa(pmd_p) >> PAGE_SHIFT determines the page size )
172 n小于ESPFIX_PUD_CLONES循环(pmds are folded into puds so this doesn't get actually called,* but the define is needed for a generic inline function.)( & pud_p[n], pud)
176  pmd_p等于pmd_offset( & pud, addr)
177  pmd等于pmd_p
178  如果非pmd_present(pmd)则
179  page等于Allocate pages, preferring the node given as nid. When nid == NUMA_NO_NODE,* prefer the current CPU's closest node. Otherwise node must be valid and* online.
181  pte_p等于page_address(page)
182  pmd等于__pmd(__pa(pte_p) | (PGTABLE_PROT & ptemask))
183  paravirt_alloc_pte( & init_mm, __pa(pte_p) >> PAGE_SHIFT determines the page size )
184 n小于ESPFIX_PMD_CLONES循环set_pmd( & pmd_p[n], pmd)
188  pte_p等于pte_offset_kernel( & pmd, addr)
189  stack_page等于page_address(Allocate pages, preferring the node given as nid. When nid == NUMA_NO_NODE,* prefer the current CPU's closest node. Otherwise node must be valid and* online.)
194  pte等于__pte(__pa(stack_page) | ((__PAGE_KERNEL_RO | _PAGE_ENC) & ptemask))
195 n小于ESPFIX_PTE_CLONES循环set_pte( & pte_p[n * PTE_STRIDE], pte)
199  WRITE_ONCE(espfix_pages[page], stack_page)
201  unlock_done :
202  mutex_unlock( & Initialization mutex - should this be a spinlock? )
203  done :
204  per_cpu(This contains the *bottom* address of the espfix stack , cpu)等于addr
205  per_cpu(espfix_waddr, cpu)等于stack_pageaddr按位与PAGE_MASK的反的值
调用者
名称描述
init_espfix_bsp
do_boot_cpuNOTE - on most systems this is a PHYSICAL apic ID, but on multiquad* (ie clustered apic addressing mode), this is a LOGICAL apic ID.* Returns zero if CPU booted OK, else error code from* ->wakeup_secondary_cpu.