Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\smpboot.c Create Date:2022-07-28 08:24:36
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:wakeup_secondary_cpu_via_init

Proto:static int wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)

Type:int

Parameter:

TypeParameterName
intphys_apicid
unsigned longstart_eip
782  send_status = 0 , accept_status = 0
785  maxlvt = lapic_get_maxlvt - get the maximum number of local vector table entries
790  If APIC_INTEGRATED(boot_cpu_apic_version) Then
791  If maxlvt > 3 Then apic_write(APIC_ESR, 0)
793  apic_read(APIC_ESR)
796  pr_debug("Asserting INIT\n")
804  apic_icr_write(APIC_INT_LEVELTRIG | APIC_INT_ASSERT | APIC_DM_INIT, phys_apicid)
807  pr_debug("Waiting for send to finish...\n")
808  send_status = safe_apic_wait_icr_idle()
810  0x10c7 is 2**32 / 1000000 (rounded up) (init_udelay)
812  pr_debug("Deasserting INIT\n")
816  apic_icr_write(APIC_INT_LEVELTRIG | APIC_DM_INIT, phys_apicid)
818  pr_debug("Waiting for send to finish...\n")
819  send_status = safe_apic_wait_icr_idle()
821  Force strict CPU ordering.* And yes, this might be required on UP too when we're talking* to devices.()
829  If APIC_INTEGRATED(boot_cpu_apic_version) Then num_starts = 2
831  Else num_starts = 0
837  pr_debug("#startup loops: %d\n", num_starts)
839  When j <= num_starts cycle
840  pr_debug("Sending STARTUP #%d\n", j)
841  If maxlvt > 3 Then apic_write(APIC_ESR, 0)
843  apic_read(APIC_ESR)
844  pr_debug("After apic_write\n")
853  apic_icr_write(APIC_DM_STARTUP | (start_eip >> 12), phys_apicid)
859  If init_udelay == 0 Then 0x10c7 is 2**32 / 1000000 (rounded up) (10)
861  Else 0x10c7 is 2**32 / 1000000 (rounded up) (300)
864  pr_debug("Startup point 1\n")
866  pr_debug("Waiting for send to finish...\n")
867  send_status = safe_apic_wait_icr_idle()
872  If init_udelay == 0 Then 0x10c7 is 2**32 / 1000000 (rounded up) (10)
874  Else 0x10c7 is 2**32 / 1000000 (rounded up) (200)
877  If maxlvt > 3 Then apic_write(APIC_ESR, 0)
879  accept_status = apic_read(APIC_ESR) & 0xEF
880  If send_status || accept_status Then Break
883  pr_debug("After Startup\n")
885  If send_status Then pr_err("APIC never delivered???\n")
887  If accept_status Then pr_err("APIC delivery error (%lx)\n", accept_status)
890  Return send_status | accept_status
Caller
NameDescribe
wakeup_cpu_via_init_nmiWake up AP by INIT, INIT, STARTUP sequence.* Instead of waiting for STARTUP after INITs, BSP will execute the BIOS* boot-strap code which is not a desired behavior for waking up BSP. To* void the boot-strap code, wake up CPU0 by NMI instead.