← Documents Documentation/devicetree/bindings/virtio/pci-iommu.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / Virtio

Virtio-IOMMU Using the Virtio-PCI Transport

Virtio PCI IOMMU의 정적 DMA 관계, RID mapping과 endpoint ID를 설명합니다.

Source pathDocumentation/devicetree/bindings/virtio/pci-iommu.yaml
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

pci-iommu.yaml:1-99

Virtio PCI IOMMU의 정적 DMA 관계, RID mapping과 endpoint ID를 설명합니다. 접을 수 있는 영어 원문 전체와 한국어 전문 번역을 함께 제공하며, property, PCI BDF·RID, phandle, example, source path와 원문 줄 좌표를 원형대로 보존합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/virtio/pci-iommu.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: virtio-iommu device using the virtio-pci transport
8
9 maintainers:
10 - Jean-Philippe Brucker <[email protected]>
11
12 description: |
13 When virtio-iommu uses the PCI transport, its programming interface is
14 discovered dynamically by the PCI probing infrastructure. However the
15 device tree statically describes the relation between IOMMU and DMA
16 masters. Therefore, the PCI root complex that hosts the virtio-iommu
17 contains a child node representing the IOMMU device explicitly.
18
19 DMA from the IOMMU device isn't managed by another IOMMU. Therefore the
20 virtio-iommu node doesn't have an "iommus" property, and is omitted from
21 the iommu-map property of the root complex.
22
23 allOf:
24 - $ref: /schemas/pci/pci-device.yaml#
25
26 properties:
27 # If compatible is present, it should contain the vendor and device ID
28 # according to the PCI Bus Binding specification. Since PCI provides
29 # built-in identification methods, compatible is not actually required.
30 compatible:
31 oneOf:
32 - items:
33 - const: virtio,pci-iommu
34 - const: pci1af4,1057
35 - items:
36 - const: pci1af4,1057
37
38 reg:
39 maxItems: 1
40
41 '#iommu-cells':
42 const: 1
43
44 required:
45 - compatible
46 - reg
47 - '#iommu-cells'
48
49 additionalProperties: false
50
51 examples:
52 - |
53 bus {
54 #address-cells = <2>;
55 #size-cells = <2>;
56
57 pcie@40000000 {
58 device_type = "pci";
59 #address-cells = <3>;
60 #size-cells = <2>;
61 reg = <0x0 0x40000000 0x0 0x1000000>;
62 ranges = <0x02000000 0x0 0x41000000 0x0 0x41000000 0x0 0x0f000000>;
63
64 /*
65 * The IOMMU manages all functions in this PCI domain except
66 * itself. Omit BDF 00:01.0.
67 */
68 iommu-map = <0x0 &iommu0 0x0 0x8
69 0x9 &iommu0 0x9 0xfff7>;
70
71 /* The IOMMU programming interface uses slot 00:01.0 */
72 iommu0: iommu@1,0 {
73 compatible = "pci1af4,1057";
74 reg = <0x800 0 0 0 0>;
75 #iommu-cells = <1>;
76 };
77 };
78
79 pcie@50000000 {
80 device_type = "pci";
81 #address-cells = <3>;
82 #size-cells = <2>;
83 reg = <0x0 0x50000000 0x0 0x1000000>;
84 ranges = <0x02000000 0x0 0x51000000 0x0 0x51000000 0x0 0x0f000000>;
85
86 /*
87 * The IOMMU also manages all functions from this domain,
88 * with endpoint IDs 0x10000 - 0x1ffff
89 */
90 iommu-map = <0x0 &iommu0 0x10000 0x10000>;
91 };
92
93 ethernet {
94 /* The IOMMU manages this platform device with endpoint ID 0x20000 */
95 iommus = <&iommu0 0x20000>;
96 };
97 };
98
99 ...
100

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Virtio-PCI IOMMU

1-10

GPL-2.0-only 또는 BSD-2-Clause로 배포되는 이 스키마는 virtio-pci transport를 사용하는 virtio-iommu device를 정의합니다. 관리자는 Jean-Philippe Brucker입니다.

동적 PCI 탐색과 정적 DMA 관계

11-25

Virtio IOMMU의 programming interface는 PCI probing infrastructure가 동적으로 찾지만, Device Tree는 IOMMU와 DMA master의 관계를 정적으로 기술합니다. 따라서 Virtio IOMMU를 수용하는 PCI root complex에는 IOMMU device를 명시적으로 나타내는 child node가 있습니다.

IOMMU device 자체의 DMA는 다른 IOMMU가 관리하지 않습니다. 그러므로 Virtio IOMMU node에는 `iommus` property가 없고 root complex의 `iommu-map`에서도 자신을 제외합니다. 공통 PCI device 스키마를 상속합니다.


description: |
  When virtio-iommu uses the PCI transport, its programming interface is
  discovered dynamically by the PCI probing infrastructure. However the
  device tree statically describes the relation between IOMMU and DMA
  masters. Therefore, the PCI root complex that hosts the virtio-iommu
  contains a child node representing the IOMMU device explicitly.

  DMA from the IOMMU device isn't managed by another IOMMU. Therefore the
  virtio-iommu node doesn't have an "iommus" property, and is omitted from
  the iommu-map property of the root complex.

allOf:
  - $ref: /schemas/pci/pci-device.yaml#

PCI ID, register와 IOMMU cell

26-50

PCI 자체에 식별 기능이 있어 설명 주석상 compatible은 본질적으로 필요하지 않지만, 제공한다면 PCI Bus Binding에 따른 vendor·device ID를 포함해야 합니다. 허용 형식은 `virtio,pci-iommu`와 `pci1af4,1057`의 쌍 또는 PCI ID 단독입니다.

`reg`는 최대 한 항목이고 `#iommu-cells`는 1입니다. 스키마의 required 목록에는 compatible, reg, #iommu-cells가 있으며 추가 속성은 허용하지 않습니다.

properties:
  # If compatible is present, it should contain the vendor and device ID
  # according to the PCI Bus Binding specification. Since PCI provides
  # built-in identification methods, compatible is not actually required.
  compatible:
    oneOf:
      - items:
          - const: virtio,pci-iommu
          - const: pci1af4,1057
      - items:
          - const: pci1af4,1057

  reg:
    maxItems: 1

  '#iommu-cells':
    const: 1

required:
  - compatible
  - reg
  - '#iommu-cells'

additionalProperties: false

첫 PCI domain과 IOMMU 자체 제외

51-78

첫 PCI root complex의 `iommu-map`은 domain의 모든 function을 관리하되 Virtio IOMMU 자체가 사용하는 BDF `00:01.0`은 제외합니다. RID 0x0~0x7과 0x9부터 이어지는 범위를 IOMMU endpoint ID에 일대일 대응시킵니다.

IOMMU programming interface child는 slot `00:01.0`, PCI ID `pci1af4,1057`, encoded `reg = <0x800 0 0 0 0>`과 한 개의 IOMMU cell을 사용합니다.

examples:
  - |
    bus {
        #address-cells = <2>;
        #size-cells = <2>;

        pcie@40000000 {
            device_type = "pci";
            #address-cells = <3>;
            #size-cells = <2>;
            reg = <0x0 0x40000000  0x0 0x1000000>;
            ranges = <0x02000000 0x0 0x41000000  0x0 0x41000000  0x0 0x0f000000>;

            /*
             * The IOMMU manages all functions in this PCI domain except
             * itself. Omit BDF 00:01.0.
             */
            iommu-map = <0x0 &iommu0 0x0 0x8
                         0x9 &iommu0 0x9 0xfff7>;

            /* The IOMMU programming interface uses slot 00:01.0 */
            iommu0: iommu@1,0 {
                compatible = "pci1af4,1057";
                reg = <0x800 0 0 0 0>;
                #iommu-cells = <1>;
            };
        };

두 번째 PCI domain과 platform endpoint

79-99

두 번째 PCI domain의 모든 function은 endpoint ID `0x10000~0x1ffff`로 같은 IOMMU에 매핑됩니다. 별도의 platform Ethernet device는 `iommus = <&iommu0 0x20000>`으로 endpoint ID 0x20000을 사용합니다.

        pcie@50000000 {
            device_type = "pci";
            #address-cells = <3>;
            #size-cells = <2>;
            reg = <0x0 0x50000000  0x0 0x1000000>;
            ranges = <0x02000000 0x0 0x51000000  0x0 0x51000000  0x0 0x0f000000>;

            /*
             * The IOMMU also manages all functions from this domain,
             * with endpoint IDs 0x10000 - 0x1ffff
             */
            iommu-map = <0x0 &iommu0 0x10000 0x10000>;
        };

        ethernet {
            /* The IOMMU manages this platform device with endpoint ID 0x20000 */
            iommus = <&iommu0 0x20000>;
        };
    };

...