multicore.md (1301B)
1 +++ 2 title = 'Multicore' 3 +++ 4 # Multicore 5 Multicores: 6 - explicit parallel execution in processor chip 7 - share some resources (cache, mem, IO, ...) 8 - kernel needs to: 9 - start/stop cores when needed 10 deal with consistency/scalability 11 - schedule work on cores 12 13 ## Turning on x86 cores: 14 BIOS starts one core (the bootstrapping processor, "BSP") 15 16 BSP starts other cores via special interrupt. 17 18 PIC: programmable interrupt controller, raises interrupt on CPU 19 20 APIC: interrupt reporting, thermal management, performance monitoring, inter-processor interrupts 21 22 Starting other processors: 23 - go to ACPI (set up in predefined memory region by BIOS) 24 - ACPI contains info also about APIC 25 - root system descriptor table (RSD) contains pointer to MADT (multiple APIC descriptor table) 26 - RSDP → RSDT → MADT → LAPIC 27 28 Enabling APIC: 29 - find where memory mapped: stored in MADT, same between cores 30 - set up spurious interrupt vector 31 - disable master & slave 8259 PIC: mask all interrupts, remap IRQs to above vector 32 32 33 Sending IPIs: 34 - need to know destination core APIC ID (list of IDs is in MADT) 35 - write to LAPIC interrupt command register 36 37 Starting APs (application processors) 38 - send INIT IPI 39 - send start-up IPI, starts at given entry point 40 - think about what this means for the kernel (e.g. stack) 41