← Documents Documentation/ABI/testing/sysfs-kernel-iommu_groups GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

IOMMU groups sysfs ABI

IOMMU group ID·device links·optional name, reserved IOVA regions와 DMA·DMA-FQ·identity·auto default domain 전환 조건을 설명합니다.

Source pathDocumentation/ABI/testing/sysfs-kernel-iommu_groups
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

Group identity and reserved regions

sysfs-kernel-iommu_groups:1-32

Integer group ID별 member-device links와 optional name을 제공하고 reserved IOVA 범위를 base·end·type records로 나열합니다.

Default domain transitions

sysfs-kernel-iommu_groups:33-64

DMA, DMA-FQ, identity, auto domain의 translation·protection 차이와 privileged write, driver unbind 전제 및 root filesystem 위험을 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/kernel/iommu_groups/
2 Date: May 2012
3 KernelVersion: v3.5
4 Contact: Alex Williamson <alex.williamson@redhat.com>
5 Description: /sys/kernel/iommu_groups/ contains a number of sub-
6 directories, each representing an IOMMU group. The
7 name of the sub-directory matches the iommu_group_id()
8 for the group, which is an integer value. Within each
9 subdirectory is another directory named "devices" with
10 links to the sysfs devices contained in this group.
11 The group directory also optionally contains a "name"
12 file if the IOMMU driver has chosen to register a more
13 common name for the group.
14 Users:
15
16 What: /sys/kernel/iommu_groups/reserved_regions
17 Date: January 2017
18 KernelVersion: v4.11
19 Contact: Eric Auger <eric.auger@redhat.com>
20 Description: /sys/kernel/iommu_groups/reserved_regions list IOVA
21 regions that are reserved. Not necessarily all
22 reserved regions are listed. This is typically used to
23 output direct-mapped, MSI, non mappable regions. Each
24 region is described on a single line: the 1st field is
25 the base IOVA, the second is the end IOVA and the third
26 field describes the type of the region.
27
28 Since kernel 5.3, in case an RMRR is used only by graphics or
29 USB devices it is now exposed as "direct-relaxable" instead
30 of "direct". In device assignment use case, for instance,
31 those RMRR are considered to be relaxable and safe.
32
33 What: /sys/kernel/iommu_groups/<grp_id>/type
34 Date: November 2020
35 KernelVersion: v5.11
36 Contact: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
37 Description: /sys/kernel/iommu_groups/<grp_id>/type shows the type of default
38 domain in use by iommu for this group. See include/linux/iommu.h
39 for possible read values. A privileged user could request kernel to
40 change the group type by writing to this file. Valid write values:
41
42 ======== ======================================================
43 DMA All the DMA transactions from the device in this group
44 are translated by the iommu.
45 DMA-FQ As above, but using batched invalidation to lazily
46 remove translations after use. This may offer reduced
47 overhead at the cost of reduced memory protection.
48 identity All the DMA transactions from the device in this group
49 are not translated by the iommu. Maximum performance
50 but zero protection.
51 auto Change to the type the device was booted with.
52 ======== ======================================================
53
54 The default domain type of a group may be modified only when
55
56 - The device in the group is not bound to any device driver.
57 So, the users must unbind the appropriate driver before
58 changing the default domain type.
59
60 Unbinding a device driver will take away the driver's control
61 over the device and if done on devices that host root file
62 system could lead to catastrophic effects (the users might
63 need to reboot the machine to get it to normal state). So, it's
64 expected that the users understand what they're doing.
65

3. 한국어 전문 번역

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

IOMMU iommu groups

1-15
항목한국어 전문 번역
What/sys/kernel/iommu_groups/
Date2012년 5월
KernelVersionv3.5
ContactAlex Williamson <alex.williamson@redhat.com>
Description`/sys/kernel/iommu_groups/` 아래의 각 integer-named subdirectory는 하나의 IOMMU group을 나타내며 이름은 해당 group의 `iommu_group_id()`와 같습니다. 각 group에는 포함된 sysfs devices로 연결되는 links를 담은 `devices` directory가 있습니다. IOMMU driver가 일반적인 group name을 register했다면 optional `name` file도 포함합니다.
IOMMU group directory hierarchy
PathContent
<grp_id>/devices/Links to sysfs devices in the group
<grp_id>/nameOptional driver-registered common group name

Integer group ID 아래에서 member devices와 optional name을 제공합니다.

IOMMU reserved regions

16-32
항목한국어 전문 번역
What/sys/kernel/iommu_groups/reserved_regions
Date2017년 1월
KernelVersionv4.11
ContactEric Auger <eric.auger@redhat.com>
Description`/sys/kernel/iommu_groups/reserved_regions`는 reserved IOVA regions를 나열하지만 모든 reserved region이 반드시 포함되는 것은 아닙니다. 일반적으로 direct-mapped, MSI, non-mappable regions를 출력합니다. 각 line의 첫 field는 base IOVA, 둘째는 end IOVA, 셋째는 region type입니다. Kernel 5.3부터 graphics 또는 USB devices에서만 사용하는 RMRR은 `direct` 대신 `direct-relaxable`로 표시되며, device assignment에서 relaxable하고 safe한 것으로 간주됩니다.
Reserved IOVA region record
FieldMeaning
1Base IOVA
2End IOVA
3Region type
RMRR since kernel 5.3Graphics/USB-only RMRR은 direct-relaxable로 표시됩니다.

각 line은 세 fields로 region 범위와 type을 나타냅니다.

IOMMU type

33-64
항목한국어 전문 번역
What/sys/kernel/iommu_groups/<grp_id>/type
Date2020년 11월
KernelVersionv5.11
ContactSai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Description`/sys/kernel/iommu_groups/<grp_id>/type`은 group에 IOMMU가 사용하는 default domain type을 표시합니다. 읽을 수 있는 값은 `include/linux/iommu.h`를 참조하며 privileged user는 file에 값을 써서 type 변경을 요청할 수 있습니다. `DMA`는 모든 DMA transactions를 IOMMU로 translate합니다. `DMA-FQ`는 같은 translation을 사용하되 batched invalidation으로 사용 후 translation을 lazy removal하여 overhead를 줄일 수 있지만 memory protection도 약해질 수 있습니다. `identity`는 DMA를 translate하지 않아 maximum performance와 zero protection을 제공합니다. `auto`는 device가 boot된 type으로 되돌립니다. Group의 device가 어떤 device driver에도 bound되지 않았을 때만 변경할 수 있으므로 먼저 driver를 unbind해야 합니다. Root file system을 host하는 device에서 unbind하면 system을 정상화하려고 reboot해야 할 정도의 catastrophic effects가 생길 수 있으므로 사용자는 영향을 이해해야 합니다.
IOMMU default domain types
ValueDMA translationTradeoff
DMATranslatedImmediate invalidation and protection
DMA-FQTranslatedBatched lazy invalidation; lower overhead, less protection
identityNot translatedMaximum performance, zero protection
autoBoot-time typeRestore original domain type
Driver prerequisiteGroup device가 driver에 bound되지 않은 상태에서만 type을 바꿀 수 있습니다.
Root file system warningRoot file system device driver를 unbind하면 catastrophic effects가 발생할 수 있습니다.

Writable type 값과 translation·protection 특성을 비교합니다.