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 Page Table 과 EPT, QEMU 의 Guest RAM Backing 에서 각각 fault 가 갈
## Elements and evidence
- **Guest Page Table** (component): 첫 번째 translation 단계. 여기서 접근을 완료할 수 없으면 Guest Page Fault 가 난다. Evidence: L2443L2445, L2484L2485.
- **Guest Kernel** (service): Guest Page Fault 를 받는 계층. Evidence: L2487L2487, L2493L2494.
- **EPT** (component): 두 번째 translation 단계. Guest translation 이 성공한 뒤 여기서 막히면 EPT Violation 이 난다. Evidence: L2465L2469, L2484L2485.
- **KVM** (service): EPT Violation 을 VM Exit 뒤에 받는 계층. Evidence: L2471L2473, L2487L2487.
- **QEMU · Guest RAM Backing** (store): Host 의 일반 userspace 메모리로 관리되는 자리. demand allocation 이나 reclaim, swap 때문에 여기서 fault 가 난다. Evidence: L2504L2504, L2514L2519.
- **Host Kernel** (service): Host Page Fault 를 받아 필요한 Host page 를 처리하는 계층. Evidence: L2521L2525.
- **Guest Page Table** (component): 첫 번째 translation 단계. 여기서 접근을 완료할 수 없으면 Guest Page Fault 가 난다. Evidence: L2456L2458, L2497L2498.
- **Guest Kernel** (service): Guest Page Fault 를 받는 계층. Evidence: L2500L2500, L2506L2507.
- **EPT** (component): 두 번째 translation 단계. Guest translation 이 성공한 뒤 여기서 막히면 EPT Violation 이 난다. Evidence: L2478L2482, L2497L2498.
- **KVM** (service): EPT Violation 을 VM Exit 뒤에 받는 계층. Evidence: L2484L2486, L2500L2500.
- **QEMU · Guest RAM Backing** (store): Host 의 일반 userspace 메모리로 관리되는 자리. demand allocation 이나 reclaim, swap 때문에 여기서 fault 가 난다. Evidence: L2517L2517, L2527L2532.
- **Host Kernel** (service): Host Page Fault 를 받아 필요한 Host page 를 처리하는 계층. Evidence: L2534L2538.
## Relationships
- **EPT → KVM:** EPT Violation · VM Exit. Evidence: L2467L2473, L2487L2487.
- **Guest Page Table → Guest Kernel:** Guest Page Fault. Evidence: L2484L2487, L2493L2494.
- **QEMU · Guest RAM Backing → Host Kernel:** Host Page Fault. Evidence: L2517L2525.
- **Guest Page Table → EPT:** GPA. Evidence: L2461L2467.
- **EPT → KVM:** EPT Violation · VM Exit. Evidence: L2480L2486, L2500L2500.
- **Guest Page Table → Guest Kernel:** Guest #PF. Evidence: L2497L2500, L2506L2507.
- **QEMU · Guest RAM Backing → Host Kernel:** Host #PF. Evidence: L2530L2538.
- **Guest Page Table → EPT:** GPA. Evidence: L2474L2480.
@@ -1,6 +1,6 @@
# 세 fault 는 변환 사슬의 서로 다른 단계에서 갈라져 나가 서로 다른 계층이 받는다
# Question: Guest Page Fault · EPT Violation · Host Page Fault 는 각각 어느 단계에서 갈라지고 누가 받는가
direction: down
direction: right
n0: "Guest Page Table" {
shape: rectangle
}
@@ -19,7 +19,7 @@ n4: "QEMU · Guest RAM Backing" {
n5: "Host Kernel" {
shape: rectangle
}
n0 -> n1: "Guest Page Fault" { style.stroke-dash: 4 }
n0 -> n1: "Guest #PF" { style.stroke-dash: 4 }
n0 -> n2: "GPA"
n2 -> n3: "EPT Violation · VM Exit" { style.stroke-dash: 4 }
n4 -> n5: "Host Page Fault" { style.stroke-dash: 4 }
n4 -> n5: "Host #PF" { style.stroke-dash: 4 }
@@ -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 Page Table", shape=box, style="rounded,filled"];
n1 [label="Guest Kernel", shape=box, style="rounded,filled"];
n2 [label="EPT", shape=box, style="rounded,filled"];
n3 [label="KVM", shape=box, style="rounded,filled"];
n4 [label="QEMU · Guest RAM Backing", shape=box, style="rounded,filled"];
n5 [label="Host Kernel", shape=box, style="rounded,filled"];
n0 -> n1 [label="Guest #PF", style=dashed];
n0 -> n2 [label="GPA", style=solid];
n2 -> n3 [label="EPT Violation · VM Exit", style=dashed];
n4 -> n5 [label="Host #PF", style=dashed];
}
@@ -1,46 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net" modified="2026-07-23T00:00:00.000Z" agent="techviz-harness" version="24.7.17" type="device">
<diagram id="page-fault-layers-in-a-vm" name="세 fault 는 변환 사슬의 서로 다른 단계에서 갈라져 나가 서로 다른 계층이 받는다">
<mxGraphModel dx="685" dy="523" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<mxGraphModel dx="902" dy="448" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="902" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="n_guest-page-table" value="Guest Page Table&lt;br/&gt;GVA → GPA" tooltip="첫 번째 translation 단계. 여기서 접근을 완료할 수 없으면 Guest Page Fault 가 난다. | Evidence: L2443-L2445, L2484-L2485" 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="166.5" y="70.0" width="150.0" height="71.0" as="geometry"/>
<mxCell id="n_guest-page-table" value="Guest Page Table&lt;br/&gt;GVA → GPA" tooltip="첫 번째 translation 단계. 여기서 접근을 완료할 수 없으면 Guest Page Fault 가 난다. | Evidence: L2456-L2458, L2497-L2498" 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="78.5" y="114.5" width="150.0" height="71.0" as="geometry"/>
</mxCell>
<mxCell id="n_qemu-backing" value="QEMU · Guest RAM Backing&lt;br/&gt;Host Virtual Memory" tooltip="Host 의 일반 userspace 메모리로 관리되는 자리. demand allocation 이나 reclaim, swap 때문에 여기서 fault 가 난다. | Evidence: L2504-L2504, L2514-L2519" 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="376.5" y="60.0" width="167.0" height="91.0" as="geometry"/>
<mxCell id="n_qemu-backing" value="QEMU · Guest RAM Backing&lt;br/&gt;Host Virtual Memory" tooltip="Host 의 일반 userspace 메모리로 관리되는 자리. demand allocation 이나 reclaim, swap 때문에 여기서 fault 가 난다. | Evidence: L2517-L2517, L2527-L2532" 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="257.5" width="167.0" height="91.0" as="geometry"/>
</mxCell>
<mxCell id="n_ept" value="EPT&lt;br/&gt;GPA → HPA" tooltip="두 번째 translation 단계. Guest translation 이 성공한 뒤 여기서 막히면 EPT Violation 이 난다. | Evidence: L2465-L2469, L2484-L2485" 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="70.0" y="247.0" width="150.0" height="71.0" as="geometry"/>
<mxCell id="n_ept" value="EPT&lt;br/&gt;GPA → HPA" tooltip="두 번째 translation 단계. Guest translation 이 성공한 뒤 여기서 막히면 EPT Violation 이 난다. | Evidence: L2478-L2482, L2497-L2498" 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="397.0" y="60.0" width="150.0" height="71.0" as="geometry"/>
</mxCell>
<mxCell id="n_guest-kernel" value="Guest Kernel" tooltip="Guest Page Fault 를 받는 계층. | Evidence: L2487-L2487, L2493-L2494" 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="280.0" y="250.5" width="150.0" height="64.0" as="geometry"/>
<mxCell id="n_guest-kernel" value="Guest Kernel" tooltip="Guest Page Fault 를 받는 계층. | Evidence: L2500-L2500, L2506-L2507" 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="397.0" y="203.0" width="150.0" height="64.0" as="geometry"/>
</mxCell>
<mxCell id="n_host-kernel" value="Host Kernel" tooltip="Host Page Fault 를 받아 필요한 Host page 를 처리하는 계층. | Evidence: L2521-L2525" 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="490.0" y="250.5" width="150.0" height="64.0" as="geometry"/>
<mxCell id="n_host-kernel" value="Host Kernel" tooltip="Host Page Fault 를 받아 필요한 Host page 를 처리하는 계층. | Evidence: L2534-L2538" 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="397.0" y="339.0" width="150.0" height="64.0" as="geometry"/>
</mxCell>
<mxCell id="n_kvm" value="KVM" tooltip="EPT Violation 을 VM Exit 뒤에 받는 계층. | Evidence: L2471-L2473, L2487-L2487" 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="280.0" y="414.0" width="150.0" height="64.0" as="geometry"/>
<mxCell id="n_kvm" value="KVM" tooltip="EPT Violation 을 VM Exit 뒤에 받는 계층. | Evidence: L2484-L2486, L2500-L2500" 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="707.0" y="199.5" width="150.0" height="64.0" as="geometry"/>
</mxCell>
<mxCell id="e_ept-violation-branch" value="EPT Violation · VM Exit" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;dashed=1;" edge="1" parent="1" source="n_ept" target="n_kvm">
<mxGeometry relative="1" as="geometry">
<mxPoint x="250.0" y="338.0" as="offset"/>
<mxPoint x="651.0" y="163.5" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_guest-fault-branch" value="Guest Page Fault" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;dashed=1;" edge="1" parent="1" source="n_guest-page-table" target="n_guest-kernel">
<mxCell id="e_guest-fault-branch" value="Guest #PF" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;dashed=1;" edge="1" parent="1" source="n_guest-page-table" target="n_guest-kernel">
<mxGeometry relative="1" as="geometry">
<mxPoint x="302.8" y="167.8" as="offset"/>
<mxPoint x="336.8" y="197.0" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_host-fault-branch" value="Host Page Fault" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;dashed=1;" edge="1" parent="1" source="n_qemu-backing" target="n_host-kernel">
<mxCell id="e_host-fault-branch" value="Host #PF" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;dashed=1;" edge="1" parent="1" source="n_qemu-backing" target="n_host-kernel">
<mxGeometry relative="1" as="geometry">
<mxPoint x="512.5" y="172.8" as="offset"/>
<mxPoint x="341.0" y="337.0" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_translation-continues" value="GPA" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_guest-page-table" target="n_ept">
<mxGeometry relative="1" as="geometry">
<mxPoint x="188.8" y="166.0" as="offset"/>
<mxPoint x="336.8" y="118.2" as="offset"/>
</mxGeometry>
</mxCell>
</root>
@@ -6,10 +6,10 @@
{
"id": "edge-ept-violation-branch",
"type": "arrow",
"x": 145.0,
"y": 318.0,
"width": 210.0,
"height": 96.0,
"x": 547.0,
"y": 95.5,
"width": 160.0,
"height": 136.0,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
@@ -36,16 +36,16 @@
0.0
],
[
0.0,
48.0
80.0,
0.0
],
[
210.0,
48.0
80.0,
136.0
],
[
210.0,
96.0
160.0,
136.0
]
],
"lastCommittedPoint": null,
@@ -66,8 +66,8 @@
{
"id": "edge-label-ept-violation-branch",
"type": "text",
"x": 158.0,
"y": 326.0,
"x": 559.0,
"y": 151.5,
"width": 184,
"height": 24,
"angle": 0,
@@ -105,10 +105,10 @@
{
"id": "edge-guest-fault-branch",
"type": "arrow",
"x": 250.5,
"y": 141.0,
"width": 104.5,
"height": 109.5,
"x": 228.5,
"y": 159.0,
"width": 168.5,
"height": 76.0,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
@@ -135,16 +135,16 @@
0.0
],
[
0.0,
54.75
84.25,
0.0
],
[
104.5,
54.75
84.25,
76.0
],
[
104.5,
109.5
168.5,
76.0
]
],
"lastCommittedPoint": null,
@@ -165,9 +165,9 @@
{
"id": "edge-label-guest-fault-branch",
"type": "text",
"x": 238.75,
"y": 155.75,
"width": 128,
"x": 291.75,
"y": 185.0,
"width": 90,
"height": 24,
"angle": 0,
"strokeColor": "#1e1e1e",
@@ -193,21 +193,21 @@
"locked": false,
"fontSize": 13,
"fontFamily": 5,
"text": "Guest Page Fault",
"text": "Guest #PF",
"textAlign": "center",
"verticalAlign": "middle",
"containerId": null,
"originalText": "Guest Page Fault",
"originalText": "Guest #PF",
"autoResize": true,
"lineHeight": 1.25
},
{
"id": "edge-host-fault-branch",
"type": "arrow",
"x": 460.0,
"y": 151.0,
"width": 105.0,
"height": 99.5,
"x": 237.0,
"y": 303.0,
"width": 160.0,
"height": 68.0,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
@@ -234,16 +234,16 @@
0.0
],
[
0.0,
49.75
80.0,
0.0
],
[
105.0,
49.75
80.0,
68.0
],
[
105.0,
99.5
160.0,
68.0
]
],
"lastCommittedPoint": null,
@@ -264,9 +264,9 @@
{
"id": "edge-label-host-fault-branch",
"type": "text",
"x": 452.5,
"y": 160.75,
"width": 120,
"x": 296.0,
"y": 325.0,
"width": 90,
"height": 24,
"angle": 0,
"strokeColor": "#1e1e1e",
@@ -292,21 +292,21 @@
"locked": false,
"fontSize": 13,
"fontFamily": 5,
"text": "Host Page Fault",
"text": "Host #PF",
"textAlign": "center",
"verticalAlign": "middle",
"containerId": null,
"originalText": "Host Page Fault",
"originalText": "Host #PF",
"autoResize": true,
"lineHeight": 1.25
},
{
"id": "edge-translation-continues",
"type": "arrow",
"x": 145.0,
"y": 141.0,
"width": 87.5,
"height": 106.0,
"x": 228.5,
"y": 95.5,
"width": 168.5,
"height": 45.5,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
@@ -329,20 +329,20 @@
"locked": false,
"points": [
[
87.5,
0.0,
45.5
],
[
84.25,
45.5
],
[
84.25,
0.0
],
[
87.5,
53.0
],
[
0.0,
53.0
],
[
0.0,
106.0
168.5,
0.0
]
],
"lastCommittedPoint": null,
@@ -363,8 +363,8 @@
{
"id": "edge-label-translation-continues",
"type": "text",
"x": 143.75,
"y": 154.0,
"x": 291.75,
"y": 106.25,
"width": 90,
"height": 24,
"angle": 0,
@@ -402,8 +402,8 @@
{
"id": "node-guest-page-table",
"type": "rectangle",
"x": 166.5,
"y": 70.0,
"x": 78.5,
"y": 114.5,
"width": 150.0,
"height": 71.0,
"angle": 0,
@@ -432,8 +432,8 @@
{
"id": "node-label-guest-page-table",
"type": "text",
"x": 176.5,
"y": 80.0,
"x": 88.5,
"y": 124.5,
"width": 130.0,
"height": 51.0,
"angle": 0,
@@ -471,8 +471,8 @@
{
"id": "node-qemu-backing",
"type": "rectangle",
"x": 376.5,
"y": 60.0,
"x": 70.0,
"y": 257.5,
"width": 167.0,
"height": 91.0,
"angle": 0,
@@ -501,8 +501,8 @@
{
"id": "node-label-qemu-backing",
"type": "text",
"x": 386.5,
"y": 70.0,
"x": 80.0,
"y": 267.5,
"width": 147.0,
"height": 71.0,
"angle": 0,
@@ -540,8 +540,8 @@
{
"id": "node-ept",
"type": "rectangle",
"x": 70.0,
"y": 247.0,
"x": 397.0,
"y": 60.0,
"width": 150.0,
"height": 71.0,
"angle": 0,
@@ -570,8 +570,8 @@
{
"id": "node-label-ept",
"type": "text",
"x": 80.0,
"y": 257.0,
"x": 407.0,
"y": 70.0,
"width": 130.0,
"height": 51.0,
"angle": 0,
@@ -609,8 +609,8 @@
{
"id": "node-guest-kernel",
"type": "rectangle",
"x": 280.0,
"y": 250.5,
"x": 397.0,
"y": 203.0,
"width": 150.0,
"height": 64.0,
"angle": 0,
@@ -639,8 +639,8 @@
{
"id": "node-label-guest-kernel",
"type": "text",
"x": 290.0,
"y": 260.5,
"x": 407.0,
"y": 213.0,
"width": 130.0,
"height": 44.0,
"angle": 0,
@@ -678,8 +678,8 @@
{
"id": "node-host-kernel",
"type": "rectangle",
"x": 490.0,
"y": 250.5,
"x": 397.0,
"y": 339.0,
"width": 150.0,
"height": 64.0,
"angle": 0,
@@ -708,8 +708,8 @@
{
"id": "node-label-host-kernel",
"type": "text",
"x": 500.0,
"y": 260.5,
"x": 407.0,
"y": 349.0,
"width": 130.0,
"height": 44.0,
"angle": 0,
@@ -747,8 +747,8 @@
{
"id": "node-kvm",
"type": "rectangle",
"x": 280.0,
"y": 414.0,
"x": 707.0,
"y": 199.5,
"width": 150.0,
"height": 64.0,
"angle": 0,
@@ -777,8 +777,8 @@
{
"id": "node-label-kvm",
"type": "text",
"x": 290.0,
"y": 424.0,
"x": 717.0,
"y": 209.5,
"width": 130.0,
"height": 44.0,
"angle": 0,
@@ -2,21 +2,22 @@
"harness_version": "0.2.0",
"spec_id": "page-fault-layers-in-a-vm",
"spec_version": "1.1",
"spec_sha256": "1db9b8029b08c8d4c61b3f01119f121b394b7d0efb9818cb63793d65b858d667",
"spec_sha256": "25421b9911ae384dcdb8d986608e8b727aea1345c48d19210e608b4d9ebbd026",
"source_context": {
"document": "docs/virtualization/final/document.md",
"document_sha256": "181e2b3cc8a45bae81e7e8193d026937c4d586ae4495d3b2c323eb7e6abcfadd",
"document_sha256": "8c4ecc64c8cea9a4450ed7131fdd9cb2048dc092b66cd969f6346ed77887c210",
"anchor": {
"kind": "heading",
"value": "48. Guest Page Fault와 EPT Violation 비교",
"line": 2480
"line": 2493
}
},
"outputs": [
"page-fault-layers-in-a-vm.svg",
"page-fault-layers-in-a-vm.drawio",
"page-fault-layers-in-a-vm.mmd",
"page-fault-layers-in-a-vm.d2",
"page-fault-layers-in-a-vm.dot",
"page-fault-layers-in-a-vm.drawio",
"page-fault-layers-in-a-vm.excalidraw",
"page-fault-layers-in-a-vm.alt.md"
],
@@ -27,5 +28,15 @@
"reference_ids": [
"payment-event-flow"
],
"diagram_only": true
"diagram_only": true,
"source_spec_file_sha256": "403c7a8d1ab23e8e8a21ff940845a1a99bbf97b95535c2598ce37b4ddfb34851",
"output_sha256": {
"page-fault-layers-in-a-vm.svg": "ddd294b5abeceb1ad8a7df1e8b14568ca5b4ac4f6aa94267e99b281fc2c0305e",
"page-fault-layers-in-a-vm.mmd": "613bc7653e5896cd279d8a4a0cf497f08abd800433b42722f223a80dbfd4b8d4",
"page-fault-layers-in-a-vm.d2": "5ea7f0d37257545af1b8f7930e5a3cc28559d2b7dee034f7bc39d848faa3f36e",
"page-fault-layers-in-a-vm.dot": "75410f40e76c82baf0f1d4e52453e7714c4b5cee25efb75c476db31afef78f90",
"page-fault-layers-in-a-vm.drawio": "70e07a8e69ad81634599b05cf24cd7b083f819799c1084c5e48a6c225ad29702",
"page-fault-layers-in-a-vm.excalidraw": "a817ec26ba3159c9dff9276556375f72846b65a34c2098ea6fe05eeaf20657c9",
"page-fault-layers-in-a-vm.alt.md": "4d703b128f2c6fdf3b17393433e349330b6c392cf1b056a240e349a850a2527e"
}
}
@@ -1,13 +1,13 @@
%% 세 fault 는 변환 사슬의 서로 다른 단계에서 갈라져 나가 서로 다른 계층이 받는다
%% question: Guest Page Fault · EPT Violation · Host Page Fault 는 각각 어느 단계에서 갈라지고 누가 받는가
flowchart TB
flowchart LR
n0["Guest Page Table"]
n1["Guest Kernel"]
n2["EPT"]
n3["KVM"]
n4["QEMU · Guest RAM Backing"]
n5["Host Kernel"]
n0 -.->|"Guest Page Fault"| n1
n0 -.->|"Guest #PF"| n1
n0 -->|"GPA"| n2
n2 -.->|"EPT Violation · VM Exit"| n3
n4 -.->|"Host Page Fault"| n5
n4 -.->|"Host #PF"| n5
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="685" height="523" viewBox="0 0 685 523" role="img" aria-labelledby="diagram-title diagram-description">
<svg xmlns="http://www.w3.org/2000/svg" width="902" height="448" viewBox="0 0 902 448" role="img" aria-labelledby="diagram-title diagram-description">
<title id="diagram-title">세 fault 는 변환 사슬의 서로 다른 단계에서 갈라져 나가 서로 다른 계층이 받는다</title>
<desc id="diagram-description">위에서 아래로 읽는다. 맨 위 왼쪽에 Guest Page Table 이 있고 거기서 갈래가 둘이다. 하나는 Guest Page Fault 로 Guest Kernel 에 빠지고, 다른 하나는 GPA 를 들고 아래 EPT 로 내려간다. EPT 에서도 갈래가 나뉘어 EPT Violation 은 VM Exit 을 거쳐 KVM 으로 간다. 맨 위 오른쪽에는 QEMU 의 Guest RAM Backing 이 따로 있고 그쪽 갈래인 Host Page Fault 는 Host Kernel 로 간다. 받는 자리의 이름이 그대로 계층 이름이다 — Guest Kernel · KVM · Host Kernel. QEMU 갈래가 EPT 갈래와 선으로 이어져 있지 않은 것은 근거 문서가 둘을 잇는 문장을 두지 않았기 때문이다. 다섯 원인이 무엇인지와 두 사건을 항목별로 견주는 것은 본문의 표가 맡는다.</desc>
<metadata>{&quot;techviz&quot;:{&quot;spec_version&quot;:&quot;1.1&quot;,&quot;id&quot;:&quot;page-fault-layers-in-a-vm&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;48. Guest Page Fault와 EPT Violation 비교&quot;,&quot;line&quot;:2480}},&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;page-fault-layers-in-a-vm&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;48. Guest Page Fault와 EPT Violation 비교&quot;,&quot;line&quot;:2493}},&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" />
@@ -49,48 +49,48 @@
.timeline-detail { font-size: 11px; fill: #4b5563; text-anchor: middle; }
</style>
</defs>
<rect class="canvas" width="685" height="523" />
<polyline class="edge kind-event style-solid emphasis-normal semantic-dashed" points="145.0,318.0 145.0,366.0 355.0,366.0 355.0,414.0" data-evidence="2467-2473,2487-2487" />
<rect class="edge-label-bg" x="163.9" y="324.0" width="172.1" height="22" rx="3" />
<text class="edge-label" x="250.0" y="339.0">EPT Violation · VM Exit</text>
<polyline class="edge kind-event style-solid emphasis-normal semantic-dashed" points="250.5,141.0 250.5,195.8 355.0,195.8 355.0,250.5" data-evidence="2484-2487,2493-2494" />
<rect class="edge-label-bg" x="240.2" y="153.8" width="125.2" height="22" rx="3" />
<text class="edge-label" x="302.8" y="168.8">Guest Page Fault</text>
<polyline class="edge kind-event style-solid emphasis-normal semantic-dashed" points="460.0,151.0 460.0,200.8 565.0,200.8 565.0,250.5" data-evidence="2517-2525" />
<rect class="edge-label-bg" x="453.2" y="158.8" width="118.5" height="22" rx="3" />
<text class="edge-label" x="512.5" y="173.8">Host Page Fault</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="232.5,141.0 232.5,194.0 145.0,194.0 145.0,247.0" data-evidence="2461-2467" />
<rect class="edge-label-bg" x="166.8" y="152.0" width="44.0" height="22" rx="3" />
<text class="edge-label" x="188.8" y="167.0">GPA</text>
<rect class="canvas" width="902" height="448" />
<polyline class="edge kind-event style-solid emphasis-normal semantic-dashed" points="547.0,95.5 627.0,95.5 627.0,231.5 707.0,231.5" data-evidence="2480-2486,2500-2500" />
<rect class="edge-label-bg" x="565.0" y="149.5" width="172.1" height="22" rx="3" />
<text class="edge-label" x="651.0" y="164.5">EPT Violation · VM Exit</text>
<polyline class="edge kind-event style-solid emphasis-normal semantic-dashed" points="228.5,159.0 312.8,159.0 312.8,235.0 397.0,235.0" data-evidence="2497-2500,2506-2507" />
<rect class="edge-label-bg" x="297.6" y="183.0" width="78.3" height="22" rx="3" />
<text class="edge-label" x="336.8" y="198.0">Guest #PF</text>
<polyline class="edge kind-event style-solid emphasis-normal semantic-dashed" points="237.0,303.0 317.0,303.0 317.0,371.0 397.0,371.0" data-evidence="2530-2538" />
<rect class="edge-label-bg" x="305.2" y="323.0" width="71.6" height="22" rx="3" />
<text class="edge-label" x="341.0" y="338.0">Host #PF</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="228.5,141.0 312.8,141.0 312.8,95.5 397.0,95.5" data-evidence="2474-2480" />
<rect class="edge-label-bg" x="314.8" y="104.2" width="44.0" height="22" rx="3" />
<text class="edge-label" x="336.8" y="119.2">GPA</text>
<g id="node-guest-page-table">
<rect class="node-shape kind-component emphasis-normal role-source" data-evidence="2443-2445,2484-2485" x="166.5" y="70.0" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="241.5" y="97.0">Guest Page Table</text>
<line class="node-detail-divider" x1="180.5" y1="118.0" x2="302.5" y2="118.0" />
<text class="node-detail" x="182.5" y="135.0">GVA → GPA</text>
<rect class="node-shape kind-component emphasis-normal role-source" data-evidence="2456-2458,2497-2498" x="78.5" y="114.5" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="153.5" y="141.5">Guest Page Table</text>
<line class="node-detail-divider" x1="92.5" y1="162.5" x2="214.5" y2="162.5" />
<text class="node-detail" x="94.5" y="179.5">GVA → GPA</text>
</g>
<g id="node-qemu-backing">
<rect class="node-shape kind-store emphasis-normal role-source" data-evidence="2504-2504,2514-2519" x="376.5" y="60.0" width="167.0" height="91.0" rx="7" />
<text class="node-label" x="460.0" y="87.0">QEMU · Guest RAM</text>
<text class="node-label" x="460.0" y="105.0">Backing</text>
<line class="node-detail-divider" x1="390.5" y1="126.0" x2="529.5" y2="126.0" />
<text class="node-detail" x="392.5" y="143.0">Host Virtual Memory</text>
<rect class="node-shape kind-store emphasis-normal role-source" data-evidence="2517-2517,2527-2532" x="70.0" y="257.5" width="167.0" height="91.0" rx="7" />
<text class="node-label" x="153.5" y="284.5">QEMU · Guest RAM</text>
<text class="node-label" x="153.5" y="302.5">Backing</text>
<line class="node-detail-divider" x1="84.0" y1="323.5" x2="223.0" y2="323.5" />
<text class="node-detail" x="86.0" y="340.5">Host Virtual Memory</text>
</g>
<g id="node-ept">
<rect class="node-shape kind-component emphasis-primary role-service" data-evidence="2465-2469,2484-2485" x="70.0" y="247.0" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="145.0" y="274.0">EPT</text>
<line class="node-detail-divider" x1="84.0" y1="295.0" x2="206.0" y2="295.0" />
<text class="node-detail" x="86.0" y="312.0">GPA → HPA</text>
<rect class="node-shape kind-component emphasis-primary role-service" data-evidence="2478-2482,2497-2498" x="397.0" y="60.0" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="472.0" y="87.0">EPT</text>
<line class="node-detail-divider" x1="411.0" y1="108.0" x2="533.0" y2="108.0" />
<text class="node-detail" x="413.0" y="125.0">GPA → HPA</text>
</g>
<g id="node-guest-kernel">
<rect class="node-shape kind-service emphasis-normal role-sink" data-evidence="2487-2487,2493-2494" x="280.0" y="250.5" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="355.0" y="280.5">Guest Kernel</text>
<rect class="node-shape kind-service emphasis-normal role-sink" data-evidence="2500-2500,2506-2507" x="397.0" y="203.0" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="472.0" y="233.0">Guest Kernel</text>
</g>
<g id="node-host-kernel">
<rect class="node-shape kind-service emphasis-normal role-sink" data-evidence="2521-2525" x="490.0" y="250.5" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="565.0" y="280.5">Host Kernel</text>
<rect class="node-shape kind-service emphasis-normal role-sink" data-evidence="2534-2538" x="397.0" y="339.0" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="472.0" y="369.0">Host Kernel</text>
</g>
<g id="node-kvm">
<rect class="node-shape kind-service emphasis-normal role-sink" data-evidence="2471-2473,2487-2487" x="280.0" y="414.0" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="355.0" y="444.0">KVM</text>
<rect class="node-shape kind-service emphasis-normal role-sink" data-evidence="2484-2486,2500-2500" x="707.0" y="199.5" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="782.0" y="229.5">KVM</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB