Files
document-haness/docs/keycloak-session-store/final/assets/cpu-io-passthrough-paths/cpu-io-passthrough-paths.drawio
T

79 lines
8.1 KiB
XML

<?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="cpu-io-passthrough-paths" name="게스트가 하드웨어에 닿는 갈래는 셋이고 깊이가 다르다">
<mxGraphModel dx="985" dy="762" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="985" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="n_qemu" value="QEMU&lt;br/&gt;/dev/kvm&lt;br/&gt;KVM_CREATE_VM · KVM_CREATE_VCPU" tooltip="KVM 핸들을 열고 VM 과 vCPU 를 만드는 유저공간 프로세스. vcpu ioctl 은 그 vcpu 를 만든 스레드에서 낸다. | Evidence: L1102-L1108" 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="379.5" y="60.0" width="251.0" height="88.0" as="geometry"/>
</mxCell>
<mxCell id="n_kvm" value="KVM&lt;br/&gt;struct kvm_run&lt;br/&gt;KVM_GET_VCPU_MMAP_SIZE" tooltip="mmap 한 공유 메모리로 나온 이유를 유저공간에 알리는 커널 쪽. | Evidence: L1105-L1108" 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="252.5" width="188.0" height="88.0" as="geometry"/>
</mxCell>
<mxCell id="n_vfio" value="VFIO&lt;br/&gt;vfio-pci&lt;br/&gt;IOMMU 그룹&lt;br/&gt;/dev/vfio/vfio" tooltip="IOMMU 보호 아래 장치 접근을 유저공간에 여는 프레임워크. 소유 단위가 IOMMU 그룹이다. | Evidence: L1131-L1146" 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="318.0" y="244.0" width="150.0" height="105.0" as="geometry"/>
</mxCell>
<mxCell id="n_vhost" value="vhost&lt;br/&gt;리눅스 커널 구현&lt;br/&gt;virtqueue 공유" tooltip="virtqueue 를 QEMU 밖과 나누는 커널 구현. vhost-user 규약이 이것을 제어하는 ioctl 인터페이스를 보완한다. | Evidence: L1125-L1129" 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="528.0" y="252.5" width="150.0" height="88.0" as="geometry"/>
</mxCell>
<mxCell id="n_virtio-driver" value="게스트 virtio 드라이버&lt;br/&gt;virtio-pci · virtio-mmio&lt;br/&gt;virtqueue" tooltip="게스트가 보는 반가상화 장치의 드라이버. 주고받는 통로가 virtqueue 다. | Evidence: L1116-L1118" 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="738.0" y="252.5" width="202.0" height="88.0" as="geometry"/>
</mxCell>
<mxCell id="n_physical-cpu" value="물리 CPU&lt;br/&gt;VMX root · VMX non-root&lt;br/&gt;VM entry · VM exit&lt;br/&gt;guest-state 영역" tooltip="VM entry 때 guest-state 영역에서 상태를 싣고 VM exit 때 그리로 저장하는 프로세서. | Evidence: L1111-L1113" 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="302.5" y="445.0" width="195.0" height="105.0" as="geometry"/>
</mxCell>
<mxCell id="n_pci-device" value="물리 PCI 장치&lt;br/&gt;게스트 직접 할당" tooltip="호스트 드라이버에서 떼어 vfio-pci 에 묶은 장치. | Evidence: L1131-L1133, L1144-L1146" 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="557.5" y="462.0" width="150.0" height="71.0" as="geometry"/>
</mxCell>
<mxCell id="n_guest-code" value="게스트 코드&lt;br/&gt;vCPU" tooltip="VMX non-root 로 물리 CPU 에서 도는 게스트 명령. | Evidence: L1111-L1113" 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="325.0" y="646.0" width="150.0" height="71.0" as="geometry"/>
</mxCell>
<mxCell id="n_iommu" value="IOMMU&lt;br/&gt;DMA · 인터럽트 리매핑" tooltip="장치가 아무 메모리나 건드리지 못하게 막는 리매핑 장치. | Evidence: L1144-L1146" 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="535.0" y="646.0" width="150.0" height="71.0" as="geometry"/>
</mxCell>
<mxCell id="e_cpu-runs-guest" value="VMX non-root" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_physical-cpu" target="n_guest-code">
<mxGeometry relative="1" as="geometry">
<mxPoint x="424.0" y="598.0" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_device-dma" value="DMA" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_pci-device" target="n_iommu">
<mxGeometry relative="1" as="geometry">
<mxPoint x="621.2" y="561.5" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_kvm-vm-entry" value="VM entry" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_kvm" target="n_physical-cpu">
<mxGeometry relative="1" as="geometry">
<mxPoint x="282.0" y="364.8" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_qemu-device-fd" value="장치 fd" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_qemu" target="n_vfio">
<mxGeometry relative="1" as="geometry">
<mxPoint x="444.5" y="168.0" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_qemu-kvm-run" value="KVM_RUN" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_qemu" target="n_kvm">
<mxGeometry relative="1" as="geometry">
<mxPoint x="321.0" y="172.2" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_qemu-vhost-ioctl" value="제어 ioctl" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_qemu" target="n_vhost">
<mxGeometry relative="1" as="geometry">
<mxPoint x="558.5" y="172.2" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_qemu-virtqueue" value="virtqueue" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_qemu" target="n_virtio-driver">
<mxGeometry relative="1" as="geometry">
<mxPoint x="685.5" y="172.2" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_vfio-binds-device" value="vfio-pci 결합" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_vfio" target="n_pci-device">
<mxGeometry relative="1" as="geometry">
<mxPoint x="512.8" y="377.5" as="offset"/>
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>