Lines Matching +full:cs +full:- +full:0

15 #define IPI_VECTOR 0x20
50 apic_write(APIC_EOI, 0); in ipi()
56 apic_write(APIC_EOI, 0); in ipi()
107 ipi_done = 0; in __on_cpu()
125 __on_cpu(cpu, function, data, 0); in on_cpu_async()
132 for (cpu = cpu_count() - 1; cpu >= 0; --cpu) in on_cpus()
150 set_idt_entry(IPI_VECTOR, ipi_entry, 0); in smp_init()
152 setup_smp_id(0); in smp_init()
154 on_cpu(i, setup_smp_id, 0); in smp_init()
170 on_cpu(i, do_reset_apic, 0); in smp_reset_apic()
179 (struct descriptor_table_ptr *) (&ap_rm_gdt_descr - &rm_trampoline); in setup_rm_gdt()
195 * | <GDT used for 16-bit -> 32-bit trasition> in setup_rm_gdt()
207 (struct descriptor_table_ptr *) (&ap_rm_gdt_descr - &rm_trampoline); in setup_rm_gdt()
208 rm_gdt_descr->base = (ulong) ((u32) (&ap_rm_gdt - &rm_trampoline)); in setup_rm_gdt()
209 rm_gdt_descr->limit = (u16) (&ap_rm_gdt_end - &ap_rm_gdt - 1); in setup_rm_gdt()
213 * building with -shared, and 2. rip-relative addressing is not supported in in setup_rm_gdt()
214 * 16-bit mode, the relocated address of ap_rm_gdt_descr needs to be stored at in setup_rm_gdt()
225 * Set up a call gate to the 32-bit entrypoint (ap_start32) within GDT, since in setup_rm_gdt()
226 * EFI may not load the 32-bit AP entrypoint (ap_start32) low enough in setup_rm_gdt()
229 * Since kvm-unit-tests builds with -shared, this location needs to be fetched in setup_rm_gdt()
230 * at runtime, and rip-relative addressing is not supported in 16-bit mode. This in setup_rm_gdt()
231 * prevents using a long jump to ap_start32 (`ljmpl $cs, $ap_start32`). in setup_rm_gdt()
233 * As an alternative, a far return via `push $cs; push $label; lret` would require in setup_rm_gdt()
234 * an intermediate trampoline since $label must still be within 0 - 0xFFFF for in setup_rm_gdt()
235 * 16-bit far return to work. in setup_rm_gdt()
237 * Using a call gate allows for an easier 16-bit -> 32-bit transition via `lcall`. in setup_rm_gdt()
242 * 0 | NULL descr in setup_rm_gdt()
247 * This layout is only used for reaching 32-bit mode. APs load a 64-bit GDT in setup_rm_gdt()
250 gate_descr = ((void *)(&ap_rm_gdt - &rm_trampoline) + 3 * sizeof(gdt_entry_t)); in setup_rm_gdt()
252 0x8 /* sel */, 0xc /* type */, 0 /* dpl */); in setup_rm_gdt()
259 size_t rm_trampoline_size = (&rm_trampoline_end - &rm_trampoline) + 1; in bringup_aps()
265 * Fill the trampoline page with with INT3 (0xcc) so that any AP in bringup_aps()
268 memset(rm_trampoline_dst, 0xcc /* INT3 */, PAGE_SIZE); in bringup_aps()
275 smp_stacktop = ((u64) (&stacktop)) - PER_CPU_SIZE; in bringup_aps()
279 apic_icr_write(APIC_DEST_ALLBUT | APIC_DEST_PHYSICAL | APIC_DM_INIT | APIC_INT_ASSERT, 0); in bringup_aps()
282 apic_icr_write(APIC_DEST_ALLBUT | APIC_DEST_PHYSICAL | APIC_DM_STARTUP, 0); in bringup_aps()
286 printf("smp: waiting for %d APs\n", _cpu_count - 1); in bringup_aps()