函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\apic\apic.c Create Date:2022-07-27 09:27:06
Last Modify:2020-03-16 21:21:31 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:generic_processor_info

函数原型:int generic_processor_info(int apicid, int version)

返回类型:int

参数:

类型参数名称
intapicid
intversion
2398  max等于nr_cpu_ids
2399  boot_cpu_detected等于physid_isset(Processor that is doing the boot up , Bitmask of physically existing CPUs:)
2421  如果Processor to be disabled specified by kernel parameter* disable_cpu_apicid=, mostly used for the kdump 2nd kernel to* avoid undefined behaviour caused by sending INIT from AP to BSP.不等于BAD_APICIDProcessor to be disabled specified by kernel parameter* disable_cpu_apicid=, mostly used for the kdump 2nd kernel to* avoid undefined behaviour caused by sending INIT from AP to BSP.不等于read_apic_id()且Processor to be disabled specified by kernel parameter* disable_cpu_apicid=, mostly used for the kdump 2nd kernel to* avoid undefined behaviour caused by sending INIT from AP to BSP.恒等于apicid
2424  thiscpu等于num_processorsdisabled_cpus
2426  打印警告信息("APIC: Disabling requested cpu. Processor %d/0x%x ignored.\n", thiscpu, apicid)
2429  disabled_cpus自加
2430  返回:负ENODEV
2437  如果非boot_cpu_detectednum_processors大于等于nr_cpu_ids减1且apicid不等于Processor that is doing the boot up
2439  thiscpu等于maxdisabled_cpus减1
2441  打印警告信息("APIC: NR_CPUS/possible_cpus limit of %i almost reached. Keeping one slot for boot cpu. Processor %d/0x%x ignored.\n", max, thiscpu, apicid)
2445  disabled_cpus自加
2446  返回:负ENODEV
2449  如果num_processors大于等于nr_cpu_ids
2450  thiscpu等于maxdisabled_cpus
2452  打印警告信息("APIC: NR_CPUS/possible_cpus limit of %i reached. Processor %d/0x%x ignored.\n", max, thiscpu, apicid)
2455  disabled_cpus自加
2456  返回:负EINVAL
2459  如果apicid恒等于Processor that is doing the boot up
2467  cpu等于0
2470  Used to store mapping between logical CPU IDs and APIC IDs.[0]等于apicid
2471  否则
2472  cpu等于Should use this API to allocate logical CPU IDs to keep nr_logical_cpuids* and cpuid_to_apicid[] synchronized.
2473  如果cpu小于0则
2474  disabled_cpus自加
2475  返回:负EINVAL
2482  如果version恒等于0x0则
2483  打印警告信息("BIOS bug: APIC version is 0 for CPU %d/0x%x, fixing up to 0x10\n", cpu, apicid)
2485  version等于0x10
2488  如果version不等于boot_cpu_apic_version
2489  打印警告信息("BIOS bug: APIC version mismatch, boot CPU: %x, CPU %d: version %x\n", boot_cpu_apic_version, cpu, version)
2493  如果apicid大于The highest APIC ID seen during enumeration.The highest APIC ID seen during enumeration.等于apicid
2497  early_per_cpu(Map cpu index to physical APIC ID, cpu)等于apicid
2498  early_per_cpu(x86_bios_cpu_apicid, cpu)等于apicid
2501  early_per_cpu(On x86_32, the mapping between cpu and logical apicid may vary* depending on apic in use. The following early percpu variable is* used for the mapping. This is where the behaviors of x86_64 and 32* actually diverge. Let's keep it ugly for now., cpu)等于x86_32_early_logical_apicid(cpu)
2504  set_cpu_possible(cpu, true)
2505  physid_set(apicid, Bitmask of physically existing CPUs:)
2506  set_cpu_present(cpu, true)
2507  num_processors自加
2509  返回:cpu
调用者
名称描述
MP_processor_info
jailhouse_get_smp_config
prefill_possible_mappu_possible_mask should be static, it cannot change as cpu's* are onlined, or offlined. The reason is per-cpu data-structures* are allocated by some modules at init time, and dont expect to* do this dynamically on cpu arrival/departure.