| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761 |
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <svg
- width="1600"
- height="1200"
- viewBox="0 0 1600 1200"
- version="1.1"
- id="svg69"
- sodipodi:docname="smp_boot_overview.svg"
- inkscape:version="1.4.2 (f4327f4, 2025-05-13)"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:svg="http://www.w3.org/2000/svg">
- <sodipodi:namedview
- id="namedview69"
- pagecolor="#ffffff"
- bordercolor="#000000"
- borderopacity="0.25"
- inkscape:showpageshadow="2"
- inkscape:pageopacity="0.0"
- inkscape:pagecheckerboard="0"
- inkscape:deskcolor="#d1d1d1"
- inkscape:zoom="0.48833333"
- inkscape:cx="870.30717"
- inkscape:cy="499.65871"
- inkscape:window-width="1440"
- inkscape:window-height="830"
- inkscape:window-x="2553"
- inkscape:window-y="-6"
- inkscape:window-maximized="1"
- inkscape:current-layer="svg69"
- showgrid="false" />
- <defs
- id="defs3">
- <style
- id="style1">
- .canvas { fill: #f8fafc; }
- .title { font-family: 'Segoe UI', Arial, sans-serif; font-size: 30px; font-weight: 700; fill: #0f172a; }
- .subtitle { font-family: 'Segoe UI', Arial, sans-serif; font-size: 16px; fill: #475569; }
- .group-boot { fill: #fff7ed; stroke: #f59e0b; stroke-width: 2.5; }
- .group-secondary { fill: #ecfdf5; stroke: #22c55e; stroke-width: 2.5; }
- .group-shared { fill: #f5f3ff; stroke: #7c3aed; stroke-width: 2.5; }
- .group-title { font-family: 'Segoe UI', Arial, sans-serif; font-size: 18px; font-weight: 700; fill: #0f172a; }
- .legend-text { font-family: 'Segoe UI', Arial, sans-serif; font-size: 13px; fill: #334155; }
- .chip-boot { fill: #f59e0b; }
- .chip-secondary { fill: #22c55e; }
- .chip-shared { fill: #7c3aed; }
- .box { fill: #ffffff; stroke: #cbd5e1; stroke-width: 1.8; }
- .box-title { font-family: 'Segoe UI', Arial, sans-serif; font-size: 16px; font-weight: 700; fill: #0f172a; }
- .box-file { font-family: 'Segoe UI', Arial, sans-serif; font-size: 12px; font-style: italic; fill: #64748b; }
- .box-note { font-family: 'Segoe UI', Arial, sans-serif; font-size: 12px; fill: #334155; }
- .step { fill: #0f172a; }
- .step-text { font-family: 'Segoe UI', Arial, sans-serif; font-size: 12px; font-weight: 700; fill: #ffffff; }
- .arrow { stroke: #475569; stroke-width: 2.5; fill: none; }
- .arrow-dashed { stroke: #0f766e; stroke-width: 2.5; stroke-dasharray: 8 6; fill: none; }
- .join-arrow { stroke: #7c3aed; stroke-width: 2.5; fill: none; }
- .arrow-label { font-family: 'Segoe UI', Arial, sans-serif; font-size: 12px; font-weight: 600; fill: #334155; }
- .label-bg { fill: #f8fafc; stroke: #e2e8f0; stroke-width: 1; }
- .footer { font-family: 'Segoe UI', Arial, sans-serif; font-size: 12px; fill: #64748b; }
- </style>
- <marker
- id="arrowhead"
- markerWidth="10"
- markerHeight="10"
- refX="8"
- refY="5"
- orient="auto">
- <path
- d="M 0 0 L 10 5 L 0 10 z"
- fill="#475569"
- id="path1" />
- </marker>
- <marker
- id="arrowhead-dashed"
- markerWidth="10"
- markerHeight="10"
- refX="8"
- refY="5"
- orient="auto">
- <path
- d="M 0 0 L 10 5 L 0 10 z"
- fill="#0f766e"
- id="path2" />
- </marker>
- <marker
- id="arrowhead-join"
- markerWidth="10"
- markerHeight="10"
- refX="8"
- refY="5"
- orient="auto">
- <path
- d="M 0 0 L 10 5 L 0 10 z"
- fill="#7c3aed"
- id="path3" />
- </marker>
- </defs>
- <rect
- class="canvas"
- x="0"
- y="0"
- width="1600"
- height="1200"
- id="rect3" />
- <text
- class="title"
- x="60"
- y="58"
- id="text3">QEMU virt64 AArch64 SMP Boot Overview</text>
- <text
- class="subtitle"
- x="60"
- y="88"
- id="text4">CPU0 completes the shared platform bring-up first, then wakes the remaining CPUs and all cores join the same scheduler.</text>
- <circle
- class="chip-boot"
- cx="1180"
- cy="54"
- r="9"
- id="circle4" />
- <text
- class="legend-text"
- x="1198"
- y="59"
- id="text5">Boot CPU path</text>
- <circle
- class="chip-secondary"
- cx="1325"
- cy="54"
- r="9"
- id="circle5" />
- <text
- class="legend-text"
- x="1343"
- y="59"
- id="text6">Secondary CPU path</text>
- <circle
- class="chip-shared"
- cx="1180"
- cy="84"
- r="9"
- id="circle6" />
- <text
- class="legend-text"
- x="1198"
- y="89"
- id="text7">Shared runtime state</text>
- <rect
- class="group-boot"
- x="40"
- y="118"
- width="1520"
- height="470"
- rx="24"
- ry="24"
- id="rect7" />
- <text
- class="group-title"
- x="66"
- y="150"
- id="text8">Boot CPU</text>
- <rect
- class="box"
- x="70"
- y="180"
- width="210"
- height="120"
- rx="18"
- ry="18"
- id="rect8" />
- <circle
- class="step"
- cx="94"
- cy="200"
- r="15"
- id="circle8" />
- <text
- class="step-text"
- x="94"
- y="204"
- text-anchor="middle"
- id="text9">1</text>
- <text
- class="box-title"
- x="175"
- y="220"
- text-anchor="middle"
- id="text10">BootROM / BL1</text>
- <text
- class="box-file"
- x="175"
- y="244"
- text-anchor="middle"
- id="text11">QEMU firmware handoff</text>
- <text
- class="box-note"
- x="175"
- y="266"
- text-anchor="middle"
- id="text12">Load the image and jump to _start.</text>
- <text
- class="box-note"
- x="175"
- y="284"
- text-anchor="middle"
- id="text13">x0 carries the DTB physical address.</text>
- <rect
- class="box"
- x="330"
- y="180"
- width="200"
- height="120"
- rx="18"
- ry="18"
- id="rect13" />
- <circle
- class="step"
- cx="354"
- cy="200"
- r="15"
- id="circle13" />
- <text
- class="step-text"
- x="354"
- y="204"
- text-anchor="middle"
- id="text14">2</text>
- <text
- class="box-title"
- x="430"
- y="220"
- text-anchor="middle"
- id="text15">_start</text>
- <text
- class="box-file"
- x="430"
- y="244"
- text-anchor="middle"
- id="text16">entry_point.S</text>
- <text
- class="box-note"
- x="430"
- y="266"
- text-anchor="middle"
- id="text17">Kernel entry for CPU0.</text>
- <text
- class="box-note"
- x="430"
- y="284"
- text-anchor="middle"
- id="text18">Sets up the first control flow.</text>
- <rect
- class="box"
- x="580"
- y="180"
- width="310"
- height="120"
- rx="18"
- ry="18"
- id="rect18" />
- <circle
- class="step"
- cx="604"
- cy="200"
- r="15"
- id="circle18" />
- <text
- class="step-text"
- x="604"
- y="204"
- text-anchor="middle"
- id="text19">3</text>
- <text
- class="box-title"
- x="735"
- y="218"
- text-anchor="middle"
- id="text20">Early assembly setup</text>
- <text
- class="box-file"
- x="735"
- y="242"
- text-anchor="middle"
- id="text21">init_cpu_el / init_kernel_bss / init_cpu_stack_early</text>
- <text
- class="box-note"
- x="735"
- y="266"
- text-anchor="middle"
- id="text22">Synchronize to EL1h, clear BSS, set SP_EL1.</text>
- <text
- class="box-note"
- x="735"
- y="284"
- text-anchor="middle"
- id="text23">Save the FDT and enable the early MMU map.</text>
- <rect
- class="box"
- x="940"
- y="180"
- width="240"
- height="120"
- rx="18"
- ry="18"
- id="rect23" />
- <circle
- class="step"
- cx="964"
- cy="200"
- r="15"
- id="circle23" />
- <text
- class="step-text"
- x="964"
- y="204"
- text-anchor="middle"
- id="text24">4</text>
- <text
- class="box-title"
- x="1060"
- y="220"
- text-anchor="middle"
- id="text25">rtthread_startup</text>
- <text
- class="box-file"
- x="1060"
- y="244"
- text-anchor="middle"
- id="text26">src/components.c</text>
- <text
- class="box-note"
- x="1060"
- y="266"
- text-anchor="middle"
- id="text27">Disable local IRQs and start the</text>
- <text
- class="box-note"
- x="1060"
- y="284"
- text-anchor="middle"
- id="text28">kernel initialization backbone.</text>
- <rect
- class="box"
- x="1230"
- y="180"
- width="280"
- height="120"
- rx="18"
- ry="18"
- id="rect28" />
- <circle
- class="step"
- cx="1254"
- cy="200"
- r="15"
- id="circle28" />
- <text
- class="step-text"
- x="1254"
- y="204"
- text-anchor="middle"
- id="text29">5</text>
- <text
- class="box-title"
- x="1370"
- y="220"
- text-anchor="middle"
- id="text30">rt_hw_common_setup</text>
- <text
- class="box-file"
- x="1370"
- y="244"
- text-anchor="middle"
- id="text31">libcpu/aarch64/common/setup.c</text>
- <text
- class="box-note"
- x="1370"
- y="266"
- text-anchor="middle"
- id="text32">Build the full MMU map, memblock, and heap.</text>
- <text
- class="box-note"
- x="1370"
- y="284"
- text-anchor="middle"
- id="text33">Initialize GIC, UART, GTIMER, and SMP IPIs.</text>
- <rect
- class="box"
- x="600"
- y="370"
- width="280"
- height="120"
- rx="18"
- ry="18"
- id="rect33" />
- <circle
- class="step"
- cx="624"
- cy="390"
- r="15"
- id="circle33" />
- <text
- class="step-text"
- x="624"
- y="394"
- text-anchor="middle"
- id="text34">6</text>
- <text
- class="box-title"
- x="740"
- y="410"
- text-anchor="middle"
- id="text35">rt_system_scheduler_start</text>
- <text
- class="box-file"
- x="740"
- y="434"
- text-anchor="middle"
- id="text36">CPU0 starts scheduling</text>
- <text
- class="box-note"
- x="740"
- y="456"
- text-anchor="middle"
- id="text37">The main thread becomes the first runnable task.</text>
- <rect
- class="box"
- x="940"
- y="370"
- width="240"
- height="120"
- rx="18"
- ry="18"
- id="rect37" />
- <circle
- class="step"
- cx="964"
- cy="390"
- r="15"
- id="circle37" />
- <text
- class="step-text"
- x="964"
- y="394"
- text-anchor="middle"
- id="text38">7</text>
- <text
- class="box-title"
- x="1060"
- y="410"
- text-anchor="middle"
- id="text39">main_thread_entry</text>
- <text
- class="box-file"
- x="1060"
- y="434"
- text-anchor="middle"
- id="text40">Before user main()</text>
- <text
- class="box-note"
- x="1060"
- y="456"
- text-anchor="middle"
- id="text41">Wake the remaining CPUs before</text>
- <text
- class="box-note"
- x="1060"
- y="474"
- text-anchor="middle"
- id="text42">the application starts running.</text>
- <rect
- class="box"
- x="1240"
- y="370"
- width="270"
- height="120"
- rx="18"
- ry="18"
- id="rect42" />
- <circle
- class="step"
- cx="1264"
- cy="390"
- r="15"
- id="circle42" />
- <text
- class="step-text"
- x="1264"
- y="394"
- text-anchor="middle"
- id="text43">8</text>
- <text
- class="box-title"
- x="1375"
- y="410"
- text-anchor="middle"
- id="text44">rt_hw_secondary_cpu_up</text>
- <text
- class="box-file"
- x="1375"
- y="434"
- text-anchor="middle"
- id="text45">entry PA plus enable-method</text>
- <text
- class="box-note"
- x="1375"
- y="456"
- text-anchor="middle"
- id="text46">Resolve PA(_secondary_cpu_entry).</text>
- <text
- class="box-note"
- x="1375"
- y="474"
- text-anchor="middle"
- id="text47">Issue PSCI CPU_ON or spin-table wakeup.</text>
- <line
- class="arrow"
- x1="280"
- y1="240"
- x2="330"
- y2="240"
- marker-end="url(#arrowhead)"
- id="line47" />
- <line
- class="arrow"
- x1="530"
- y1="240"
- x2="580"
- y2="240"
- marker-end="url(#arrowhead)"
- id="line48" />
- <line
- class="arrow"
- x1="890"
- y1="240"
- x2="940"
- y2="240"
- marker-end="url(#arrowhead)"
- id="line49" />
- <line
- class="arrow"
- x1="1180"
- y1="240"
- x2="1230"
- y2="240"
- marker-end="url(#arrowhead)"
- id="line50" />
- <path
- class="arrow"
- d="M 1370 300 L 1370 335 L 740 335 L 740 370"
- marker-end="url(#arrowhead)"
- id="path50" />
- <line
- class="arrow"
- x1="880"
- y1="430"
- x2="940"
- y2="430"
- marker-end="url(#arrowhead)"
- id="line51" />
- <line
- class="arrow"
- x1="1180"
- y1="430"
- x2="1240"
- y2="430"
- marker-end="url(#arrowhead)"
- id="line52" />
- <rect
- class="group-secondary"
- x="829.52216"
- y="652.52563"
- width="690"
- height="210"
- rx="24"
- ry="24"
- id="rect52" />
- <text
- class="group-title"
- x="876"
- y="682.47784"
- id="text52">Secondary CPU</text>
- <rect
- class="box"
- x="890"
- y="715.47784"
- width="280"
- height="115"
- rx="18"
- ry="18"
- id="rect53" />
- <circle
- class="step"
- cx="914"
- cy="735.47784"
- r="15"
- id="circle53" />
- <text
- class="step-text"
- x="914"
- y="739.47784"
- text-anchor="middle"
- id="text53">9</text>
- <text
- class="box-title"
- x="1030"
- y="755.47784"
- text-anchor="middle"
- id="text54">_secondary_cpu_entry</text>
- <text
- class="box-file"
- x="1030"
- y="779.47784"
- text-anchor="middle"
- id="text55">entry_point.S</text>
- <text
- class="box-note"
- x="1030"
- y="801.47784"
- text-anchor="middle"
- id="text56">Read MPIDR, find the logical CPU id,</text>
- <text
- class="box-note"
- x="1030"
- y="819.47784"
- text-anchor="middle"
- id="text57">set TPIDR and the private stack.</text>
- <rect
- class="box"
- x="1210"
- y="715.47784"
- width="290"
- height="115"
- rx="18"
- ry="18"
- id="rect57" />
- <circle
- class="step"
- cx="1234"
- cy="735.47784"
- r="15"
- id="circle57" />
- <text
- class="step-text"
- x="1234"
- y="739.47784"
- text-anchor="middle"
- id="text58">10</text>
- <text
- class="box-title"
- x="1367.0004"
- y="755.47784"
- text-anchor="middle"
- id="text59">rt_hw_secondary_cpu_bsp_start</text>
- <text
- class="box-file"
- x="1355"
- y="779.47784"
- text-anchor="middle"
- id="text60">libcpu/aarch64/common/setup.c</text>
- <text
- class="box-note"
- x="1355"
- y="801.47784"
- text-anchor="middle"
- id="text61">Bind the shared MMU table, initialize</text>
- <text
- class="box-note"
- x="1355"
- y="819.47784"
- text-anchor="middle"
- id="text62">local GIC, GTIMER, SMP IPI, and CPU device.</text>
- <path
- class="arrow-dashed"
- d="M 1375,490 V 628 H 1030 V 715.47784"
- marker-end="url(#arrowhead-dashed)"
- id="path62"
- sodipodi:nodetypes="cccc"
- style="display:inline" />
- <text
- class="arrow-label"
- x="1250.752"
- y="616.58801"
- text-anchor="middle"
- id="text63"
- style="font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;font-size:14.6667px;font-family:'Segoe UI', Arial, sans-serif;-inkscape-font-specification:'Segoe UI, Arial, sans-serif, Semi-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-anchor:middle;fill:#334155">PSCI CPU_ON wakes the target CPU</text>
- <line
- class="arrow"
- x1="1170"
- y1="772.47784"
- x2="1210"
- y2="772.47784"
- marker-end="url(#arrowhead)"
- id="line63" />
- <rect
- class="group-shared"
- x="360"
- y="930"
- width="880"
- height="180"
- rx="24"
- ry="24"
- id="rect63" />
- <text
- class="group-title"
- x="386"
- y="962"
- id="text64">Shared scheduler state</text>
- <rect
- class="box"
- x="525"
- y="995"
- width="550"
- height="78"
- rx="18"
- ry="18"
- id="rect64" />
- <text
- class="box-title"
- x="800"
- y="1029"
- text-anchor="middle"
- id="text65">rt_system_scheduler_start on all CPUs</text>
- <text
- class="box-note"
- x="800"
- y="1051"
- text-anchor="middle"
- id="text66">CPU0 continues from main(); CPU1..N-1 join after local BSP bring-up.</text>
- <path
- class="join-arrow"
- d="M 1060,490 V 596 H 660 V 995"
- marker-end="url(#arrowhead-join)"
- id="path66"
- sodipodi:nodetypes="cccc" />
- <text
- class="arrow-label"
- x="979.15204"
- y="577.34796"
- text-anchor="middle"
- id="text67"
- style="-inkscape-font-specification:'Segoe UI, Arial, sans-serif, Semi-Bold';font-family:'Segoe UI', Arial, sans-serif;font-weight:600;font-style:normal;font-stretch:normal;font-variant:normal;font-size:14.6667px;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-anchor:middle;fill:#334155">CPU0 keeps running</text>
- <path
- class="join-arrow"
- d="M 1355,830 V 898 H 945 V 995"
- marker-end="url(#arrowhead-join)"
- id="path67"
- sodipodi:nodetypes="cccc" />
- <text
- class="arrow-label"
- x="1196.652"
- y="887.31201"
- text-anchor="middle"
- id="text68"
- style="font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;font-size:14.6667px;font-family:'Segoe UI', Arial, sans-serif;-inkscape-font-specification:'Segoe UI, Arial, sans-serif, Semi-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-anchor:middle;fill:#334155">Secondary CPUs join after local BSP bring-up</text>
- <text
- class="footer"
- x="60"
- y="1180"
- id="text69">Key source files: libcpu/aarch64/cortex-a/entry_point.S, libcpu/aarch64/common/setup.c, src/components.c</text>
- </svg>
|