refactor: 문서 개선 중

This commit is contained in:
donghyeon-ka
2026-09-21 14:30:55 +09:00
parent c93cdea150
commit 805a18f486
1497 changed files with 525837 additions and 59152 deletions
@@ -10,16 +10,16 @@ Guest 에서 VM Exit 으로 KVM 에 닿은 뒤 커널 처리와 QEMU 처리 두
## Elements and evidence
- **Guest** (service): VM Exit 이 나기 직전까지 실행 중이던 Guest. Evidence: L498L501.
- **KVM** (service): VM Exit 을 받아 Exit Reason 을 확인하고 갈래를 고르는 자리. Evidence: L495L495, L502L504.
- **KVM 커널 처리** (service): 커널 안에서 끝낼 수 있는 Exit 을 처리하는 갈래. QEMU 까지 올라가지 않는다. Evidence: L508L510, L531L531.
- **QEMU** (service): userspace 처리가 필요한 Exit 에서만 개입하는 갈래. Evidence: L510L516, L533L533.
- **Guest 실행 재개** (service): 두 갈래가 다시 만나는 자리. VM Exit 은 VM 종료가 아니라 여기로 돌아온다. Evidence: L521L524, L529L529.
- **Guest** (service): VM Exit 이 나기 직전까지 실행 중이던 Guest. Evidence: L511L514.
- **KVM** (service): VM Exit 을 받아 Exit Reason 을 확인하고 갈래를 고르는 자리. Evidence: L508L508, L515L517.
- **KVM 커널 처리** (service): 커널 안에서 끝낼 수 있는 Exit 을 처리하는 갈래. QEMU 까지 올라가지 않는다. Evidence: L521L523, L544L544.
- **QEMU** (service): userspace 처리가 필요한 Exit 에서만 개입하는 갈래. Evidence: L523L529, L546L546.
- **Guest 실행 재개** (service): 두 갈래가 다시 만나는 자리. VM Exit 은 VM 종료가 아니라 여기로 돌아온다. Evidence: L534L537, L542L542.
## Relationships
- **Guest → KVM:** VM Exit. Evidence: L495L495, L498L502.
- **KVM → KVM 커널 처리:** 커널 처리 가능. Evidence: L504L510, L531L531.
- **KVM 커널 처리 → Guest 실행 재개:** VM Entry. Evidence: L518L524, L531L531.
- **KVM → QEMU:** KVM_RUN return. Evidence: L508L512, L533L533.
- **QEMU → Guest 실행 재개:** VM Entry. Evidence: L514L524, L533L533.
- **Guest → KVM:** VM Exit. Evidence: L508L508, L511L515.
- **KVM → KVM 커널 처리:** 커널 처리 가능. Evidence: L517L523, L544L544.
- **KVM 커널 처리 → Guest 실행 재개:** VM Entry. Evidence: L531L537, L544L544.
- **KVM → QEMU:** KVM_RUN return. Evidence: L521L525, L546L546.
- **QEMU → Guest 실행 재개:** VM Entry. Evidence: L527L537, L546L546.
@@ -0,0 +1,15 @@
digraph techviz {
graph [rankdir=LR, splines=ortho, nodesep=0.55, ranksep=0.85];
node [fontname=Helvetica, fontsize=11, margin="0.18,0.12", style="rounded,filled", fillcolor=white, color="#2d4357", penwidth=1.5];
edge [fontname=Helvetica, fontsize=10, color="#364b5f", penwidth=1.4, arrowsize=0.75];
n0 [label="Guest", shape=box, style="rounded,filled"];
n1 [label="KVM", shape=box, style="rounded,filled"];
n2 [label="KVM 커널 처리", shape=box, style="rounded,filled"];
n3 [label="QEMU", shape=box, style="rounded,filled"];
n4 [label="Guest 실행 재개", shape=box, style="rounded,filled"];
n0 -> n1 [label="VM Exit", style=solid];
n1 -> n2 [label="커널 처리 가능", style=solid];
n1 -> n3 [label="KVM_RUN return", style=solid];
n2 -> n4 [label="VM Entry", style=solid];
n3 -> n4 [label="VM Entry", style=solid];
}
@@ -5,19 +5,19 @@
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="n_guest" value="Guest" tooltip="VM Exit 이 나기 직전까지 실행 중이던 Guest. | Evidence: L498-L501" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;" vertex="1" parent="1">
<mxCell id="n_guest" value="Guest" tooltip="VM Exit 이 나기 직전까지 실행 중이던 Guest. | Evidence: L511-L514" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;" vertex="1" parent="1">
<mxGeometry x="70.0" y="152.0" width="150.0" height="64.0" as="geometry"/>
</mxCell>
<mxCell id="n_kvm" value="KVM&lt;br/&gt;Exit Reason" tooltip="VM Exit 을 받아 Exit Reason 을 확인하고 갈래를 고르는 자리. | Evidence: L495-L495, L502-L504" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;strokeColor=#2563eb;strokeWidth=2;" vertex="1" parent="1">
<mxCell id="n_kvm" value="KVM&lt;br/&gt;Exit Reason" tooltip="VM Exit 을 받아 Exit Reason 을 확인하고 갈래를 고르는 자리. | Evidence: L508-L508, L515-L517" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;strokeColor=#2563eb;strokeWidth=2;" vertex="1" parent="1">
<mxGeometry x="380.0" y="148.5" width="150.0" height="71.0" as="geometry"/>
</mxCell>
<mxCell id="n_kvm-kernel-handling" value="KVM 커널 처리&lt;br/&gt;Kernel" tooltip="커널 안에서 끝낼 수 있는 Exit 을 처리하는 갈래. QEMU 까지 올라가지 않는다. | Evidence: L508-L510, L531-L531" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;" vertex="1" parent="1">
<mxCell id="n_kvm-kernel-handling" value="KVM 커널 처리&lt;br/&gt;Kernel" tooltip="커널 안에서 끝낼 수 있는 Exit 을 처리하는 갈래. QEMU 까지 올라가지 않는다. | Evidence: L521-L523, L544-L544" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;" vertex="1" parent="1">
<mxGeometry x="690.0" y="60.0" width="150.0" height="71.0" as="geometry"/>
</mxCell>
<mxCell id="n_qemu" value="QEMU&lt;br/&gt;Userspace&lt;br/&gt;device emulation&lt;br/&gt;KVM_RUN 재호출" tooltip="userspace 처리가 필요한 Exit 에서만 개입하는 갈래. | Evidence: L510-L516, L533-L533" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;" vertex="1" parent="1">
<mxCell id="n_qemu" value="QEMU&lt;br/&gt;Userspace&lt;br/&gt;device emulation&lt;br/&gt;KVM_RUN 재호출" tooltip="userspace 처리가 필요한 Exit 에서만 개입하는 갈래. | Evidence: L523-L529, L546-L546" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;" vertex="1" parent="1">
<mxGeometry x="690.0" y="203.0" width="150.0" height="105.0" as="geometry"/>
</mxCell>
<mxCell id="n_guest-resume" value="Guest 실행 재개" tooltip="두 갈래가 다시 만나는 자리. VM Exit 은 VM 종료가 아니라 여기로 돌아온다. | Evidence: L521-L524, L529-L529" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;" vertex="1" parent="1">
<mxCell id="n_guest-resume" value="Guest 실행 재개" tooltip="두 갈래가 다시 만나는 자리. VM Exit 은 VM 종료가 아니라 여기로 돌아온다. | Evidence: L534-L537, L542-L542" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;" vertex="1" parent="1">
<mxGeometry x="1000.0" y="152.0" width="150.0" height="64.0" as="geometry"/>
</mxCell>
<mxCell id="e_exit-to-kvm" value="VM Exit" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_guest" target="n_kvm">
@@ -2,21 +2,22 @@
"harness_version": "0.2.0",
"spec_id": "vm-exit-handling-cycle",
"spec_version": "1.1",
"spec_sha256": "114180c059ff8c4be3e253da16d2d2f0e0fb44a2b87b03fcd2104f4e3fd6fa79",
"spec_sha256": "252e1217d5faf4d4dcbf10ccc3820cbc954a7f43a9c4936d9a6773742ce7751d",
"source_context": {
"document": "docs/virtualization/final/document.md",
"document_sha256": "181e2b3cc8a45bae81e7e8193d026937c4d586ae4495d3b2c323eb7e6abcfadd",
"document_sha256": "8c4ecc64c8cea9a4450ed7131fdd9cb2048dc092b66cd969f6346ed77887c210",
"anchor": {
"kind": "heading",
"value": "9. VM Exit 이후 처리",
"line": 493
"line": 506
}
},
"outputs": [
"vm-exit-handling-cycle.svg",
"vm-exit-handling-cycle.drawio",
"vm-exit-handling-cycle.mmd",
"vm-exit-handling-cycle.d2",
"vm-exit-handling-cycle.dot",
"vm-exit-handling-cycle.drawio",
"vm-exit-handling-cycle.excalidraw",
"vm-exit-handling-cycle.alt.md"
],
@@ -27,5 +28,15 @@
"reference_ids": [
"payment-event-flow"
],
"diagram_only": true
"diagram_only": true,
"source_spec_file_sha256": "e19ad5e4f10b63dcc8873b89824d7325d4e7d00da148111debc3982dde326ee4",
"output_sha256": {
"vm-exit-handling-cycle.svg": "ee31021001ee6c5ca4a7b6d7aef68fc22f985ed0ef043d77e4f1e729c88879e1",
"vm-exit-handling-cycle.mmd": "7ae0eea6854928cf6485483ed2f477293d8674f880e55400c1b49aed2267448e",
"vm-exit-handling-cycle.d2": "ea19922bd0d4227c52959c504544cd38bb9fc812b6074610b304bf1275249c4f",
"vm-exit-handling-cycle.dot": "66ab3013183f0a8cb835e485765cc3b338f80fc90854c4c00d03cd721768f470",
"vm-exit-handling-cycle.drawio": "bcddde755cb94de69b7ff6b9a6c58abcfe83439b941136f34b181b18a65cc737",
"vm-exit-handling-cycle.excalidraw": "e9f0e13cb801c4fa1872dfb102a377372940306569a97730ad9cdd6d4efcdbe8",
"vm-exit-handling-cycle.alt.md": "a74241dbbba9e86b671f6cd6163d1a159de7815c66ad0bb01787d75568f4c5b3"
}
}
@@ -2,7 +2,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1195" height="353" viewBox="0 0 1195 353" role="img" aria-labelledby="diagram-title diagram-description">
<title id="diagram-title">VM Exit 은 KVM 에서 끝나기도 하고 QEMU userspace 까지 가기도 한다</title>
<desc id="diagram-description">왼쪽에서 오른쪽으로 읽는다. 왼쪽 끝에 Guest 가 있고 VM Exit 이 KVM 으로 제어권을 넘긴다. KVM 은 Exit Reason 을 확인해 두 갈래 중 하나를 고른다. 커널 안에서 처리할 수 있는 Exit 은 Kernel 쪽 KVM 커널 처리로 가고, userspace 처리가 필요한 Exit 만 KVM_RUN 이 반환되면서 Userspace 쪽 QEMU 로 간다. QEMU 는 필요한 장치 동작을 처리한 뒤 KVM_RUN 을 다시 호출한다. 두 갈래는 오른쪽 끝에서 다시 만나며 어느 쪽이든 VM Entry 를 지나 Guest 실행 재개로 돌아온다. 무엇이 Exit 을 부르는지와 Exit 이 잦을 때 무엇을 함께 보는지는 본문의 표와 문단이 맡는다.</desc>
<metadata>{&quot;techviz&quot;:{&quot;spec_version&quot;:&quot;1.1&quot;,&quot;id&quot;:&quot;vm-exit-handling-cycle&quot;,&quot;profile&quot;:&quot;component-flow&quot;},&quot;source_context&quot;:{&quot;document&quot;:&quot;docs/virtualization/final/document.md&quot;,&quot;document_sha256&quot;:&quot;181e2b3cc8a45bae81e7e8193d026937c4d586ae4495d3b2c323eb7e6abcfadd&quot;,&quot;anchor&quot;:{&quot;kind&quot;:&quot;heading&quot;,&quot;value&quot;:&quot;9. VM Exit 이후 처리&quot;,&quot;line&quot;:493}},&quot;evidence_policy&quot;:&quot;Each factual element cites source lines or is marked assumption.&quot;,&quot;diagram_only&quot;:true}</metadata>
<metadata>{&quot;techviz&quot;:{&quot;spec_version&quot;:&quot;1.1&quot;,&quot;id&quot;:&quot;vm-exit-handling-cycle&quot;,&quot;profile&quot;:&quot;component-flow&quot;},&quot;source_context&quot;:{&quot;document&quot;:&quot;docs/virtualization/final/document.md&quot;,&quot;document_sha256&quot;:&quot;8c4ecc64c8cea9a4450ed7131fdd9cb2048dc092b66cd969f6346ed77887c210&quot;,&quot;anchor&quot;:{&quot;kind&quot;:&quot;heading&quot;,&quot;value&quot;:&quot;9. VM Exit 이후 처리&quot;,&quot;line&quot;:506}},&quot;evidence_policy&quot;:&quot;Each factual element cites source lines or is marked assumption.&quot;,&quot;diagram_only&quot;:true}</metadata>
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" />
@@ -50,39 +50,39 @@
</style>
</defs>
<rect class="canvas" width="1195" height="353" />
<polyline class="edge kind-control style-solid emphasis-normal" points="220.0,184.0 300.0,184.0 300.0,184.0 380.0,184.0" data-evidence="495-495,498-502" />
<polyline class="edge kind-control style-solid emphasis-normal" points="220.0,184.0 300.0,184.0 300.0,184.0 380.0,184.0" data-evidence="508-508,511-515" />
<rect class="edge-label-bg" x="267.6" y="142.0" width="64.9" height="22" rx="3" />
<text class="edge-label" x="300.0" y="157.0">VM Exit</text>
<polyline class="edge kind-control style-solid emphasis-normal" points="530.0,175.0 610.0,175.0 610.0,95.5 690.0,95.5" data-evidence="504-510,531-531" />
<polyline class="edge kind-control style-solid emphasis-normal" points="530.0,175.0 610.0,175.0 610.0,95.5 690.0,95.5" data-evidence="517-523,544-544" />
<rect class="edge-label-bg" x="598.2" y="121.2" width="71.6" height="22" rx="3" />
<text class="edge-label" x="634.0" y="136.2">커널 처리 가능</text>
<polyline class="edge kind-control style-solid emphasis-normal" points="840.0,95.5 920.0,95.5 920.0,175.0 1000.0,175.0" data-evidence="518-524,531-531" />
<polyline class="edge kind-control style-solid emphasis-normal" points="840.0,95.5 920.0,95.5 920.0,175.0 1000.0,175.0" data-evidence="531-537,544-544" />
<rect class="edge-label-bg" x="908.2" y="121.2" width="71.6" height="22" rx="3" />
<text class="edge-label" x="944.0" y="136.2">VM Entry</text>
<polyline class="edge kind-control style-solid emphasis-normal" points="530.0,193.0 610.0,193.0 610.0,255.5 690.0,255.5" data-evidence="508-512,533-533" />
<polyline class="edge kind-control style-solid emphasis-normal" points="530.0,193.0 610.0,193.0 610.0,255.5 690.0,255.5" data-evidence="521-525,546-546" />
<rect class="edge-label-bg" x="578.1" y="210.2" width="111.8" height="22" rx="3" />
<text class="edge-label" x="634.0" y="225.2">KVM_RUN return</text>
<polyline class="edge kind-control style-solid emphasis-normal" points="840.0,255.5 920.0,255.5 920.0,193.0 1000.0,193.0" data-evidence="514-524,533-533" />
<polyline class="edge kind-control style-solid emphasis-normal" points="840.0,255.5 920.0,255.5 920.0,193.0 1000.0,193.0" data-evidence="527-537,546-546" />
<rect class="edge-label-bg" x="908.2" y="210.2" width="71.6" height="22" rx="3" />
<text class="edge-label" x="944.0" y="225.2">VM Entry</text>
<g id="node-guest">
<rect class="node-shape kind-service emphasis-normal role-source" data-evidence="498-501" x="70.0" y="152.0" width="150.0" height="64.0" rx="7" />
<rect class="node-shape kind-service emphasis-normal role-source" data-evidence="511-514" x="70.0" y="152.0" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="145.0" y="182.0">Guest</text>
</g>
<g id="node-kvm">
<rect class="node-shape kind-service emphasis-primary role-service" data-evidence="495-495,502-504" x="380.0" y="148.5" width="150.0" height="71.0" rx="7" />
<rect class="node-shape kind-service emphasis-primary role-service" data-evidence="508-508,515-517" x="380.0" y="148.5" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="455.0" y="175.5">KVM</text>
<line class="node-detail-divider" x1="394.0" y1="196.5" x2="516.0" y2="196.5" />
<text class="node-detail" x="396.0" y="213.5">Exit Reason</text>
</g>
<g id="node-kvm-kernel-handling">
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="508-510,531-531" x="690.0" y="60.0" width="150.0" height="71.0" rx="7" />
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="521-523,544-544" x="690.0" y="60.0" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="765.0" y="87.0">KVM 커널 처리</text>
<line class="node-detail-divider" x1="704.0" y1="108.0" x2="826.0" y2="108.0" />
<text class="node-detail" x="706.0" y="125.0">Kernel</text>
</g>
<g id="node-qemu">
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="510-516,533-533" x="690.0" y="203.0" width="150.0" height="105.0" rx="7" />
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="523-529,546-546" x="690.0" y="203.0" width="150.0" height="105.0" rx="7" />
<text class="node-label" x="765.0" y="230.0">QEMU</text>
<line class="node-detail-divider" x1="704.0" y1="251.0" x2="826.0" y2="251.0" />
<text class="node-detail" x="706.0" y="268.0">Userspace</text>
@@ -90,7 +90,7 @@
<text class="node-detail" x="706.0" y="300.0">KVM_RUN 재호출</text>
</g>
<g id="node-guest-resume">
<rect class="node-shape kind-service emphasis-normal role-sink" data-evidence="521-524,529-529" x="1000.0" y="152.0" width="150.0" height="64.0" rx="7" />
<rect class="node-shape kind-service emphasis-normal role-sink" data-evidence="534-537,542-542" x="1000.0" y="152.0" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="1075.0" y="182.0">Guest 실행 재개</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB