Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\apic\apic.c Create Date:2022-07-28 08:27:24
Last Modify:2020-03-16 21:21:31 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:generic_processor_info

Proto:int generic_processor_info(int apicid, int version)

Type:int

Parameter:

TypeParameterName
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  If 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_APICID && 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. != 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 Then
2424  thiscpu = num_processors + disabled_cpus
2426  pr_warn("APIC: Disabling requested cpu. Processor %d/0x%x ignored.\n", thiscpu, apicid)
2429  disabled_cpus++
2430  Return -ENODEV
2437  If Not boot_cpu_detected && num_processors >= nr_cpu_ids - 1 && apicid != Processor that is doing the boot up Then
2439  thiscpu = max + disabled_cpus - 1
2441  pr_warn("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  Return -ENODEV
2449  If num_processors >= nr_cpu_ids Then
2450  thiscpu = max + disabled_cpus
2452  pr_warn("APIC: NR_CPUS/possible_cpus limit of %i reached. Processor %d/0x%x ignored.\n", max, thiscpu, apicid)
2455  disabled_cpus++
2456  Return -EINVAL
2459  If apicid == Processor that is doing the boot up Then
2467  cpu = 0
2470  Used to store mapping between logical CPU IDs and APIC IDs.[0] = apicid
2471  Else
2472  cpu = Should use this API to allocate logical CPU IDs to keep nr_logical_cpuids* and cpuid_to_apicid[] synchronized.
2473  If cpu < 0 Then
2474  disabled_cpus++
2475  Return -EINVAL
2482  If version == 0x0 Then
2483  pr_warn("BIOS bug: APIC version is 0 for CPU %d/0x%x, fixing up to 0x10\n", cpu, apicid)
2485  version = 0x10
2488  If version != boot_cpu_apic_version Then
2489  pr_warn("BIOS bug: APIC version mismatch, boot CPU: %x, CPU %d: version %x\n", boot_cpu_apic_version, cpu, version)
2493  If apicid > The highest APIC ID seen during enumeration. Then 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  Return cpu
Caller
NameDescribe
MP_processor_info
jailhouse_get_smp_config