← Documents Documentation/devicetree/bindings/powerpc/ibm,powerpc-cpu-features.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

IBM PowerPC CPU Features

OPAL이 제공하는 PowerPC CPU feature의 ISA, privilege, enable bit, HWCAP와 dependency binding입니다.

Source pathDocumentation/devicetree/bindings/powerpc/ibm,powerpc-cpu-features.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

ibm,powerpc-cpu-features.txt:1-248

Feature node 존재 여부와 ISA level을 HV·OS enable method 및 userspace HWCAP 광고에 연결합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 *** NOTE ***
2 This document is copied from OPAL firmware
3 (skiboot/doc/device-tree/ibm,powerpc-cpu-features/binding.txt)
4
5 There is more complete overview and documentation of features in that
6 source tree. All patches and modifications should go there.
7 ************
8
9 ibm,powerpc-cpu-features binding
10 ================================
11
12 This device tree binding describes CPU features available to software, with
13 enablement, privilege, and compatibility metadata.
14
15 More general description of design and implementation of this binding is
16 found in design.txt, which also points to documentation of specific features.
17
18
19 /cpus/ibm,powerpc-cpu-features node binding
20 -------------------------------------------
21
22 Node: ibm,powerpc-cpu-features
23
24 Description: Container of CPU feature nodes.
25
26 The node name must be "ibm,powerpc-cpu-features".
27
28 It is implemented as a child of the node "/cpus", but this must not be
29 assumed by parsers.
30
31 The node is optional but should be provided by new OPAL firmware.
32
33 Properties:
34
35 - compatible
36 Usage: required
37 Value type: string
38 Definition: "ibm,powerpc-cpu-features"
39
40 This compatibility refers to backwards compatibility of the overall
41 design with parsers that behave according to these guidelines. This can
42 be extended in a backward compatible manner which would not warrant a
43 revision of the compatible property.
44
45 - isa
46 Usage: required
47 Value type: <u32>
48 Definition:
49
50 isa that the CPU is currently running in. This provides instruction set
51 compatibility, less the individual feature nodes. For example, an ISA v3.0
52 implementation that lacks the "transactional-memory" cpufeature node
53 should not use transactional memory facilities.
54
55 Value corresponds to the "Power ISA Version" multiplied by 1000.
56 For example, <3000> corresponds to Version 3.0, <2070> to Version 2.07.
57 The minor digit is available for revisions.
58
59 - display-name
60 Usage: optional
61 Value type: string
62 Definition:
63
64 A human readable name for the CPU.
65
66 /cpus/ibm,powerpc-cpu-features/example-feature node bindings
67 ----------------------------------------------------------------
68
69 Each child node of cpu-features represents a CPU feature / capability.
70
71 Node: A string describing an architected CPU feature, e.g., "floating-point".
72
73 Description: A feature or capability supported by the CPUs.
74
75 The name of the node is a human readable string that forms the interface
76 used to describe features to software. Features are currently documented
77 in the code where they are implemented in skiboot/core/cpufeatures.c
78
79 Presence of the node indicates the feature is available.
80
81 Properties:
82
83 - isa
84 Usage: required
85 Value type: <u32>
86 Definition:
87
88 First level of the Power ISA that the feature appears in.
89 Software should filter out features when constraining the
90 environment to a particular ISA version.
91
92 Value is defined similarly to /cpus/features/isa
93
94 - usable-privilege
95 Usage: required
96 Value type: <u32> bit mask
97 Definition:
98 Bit numbers are LSB0
99 bit 0 - PR (problem state / user mode)
100 bit 1 - OS (privileged state)
101 bit 2 - HV (hypervisor state)
102 All other bits reserved and should be zero.
103
104 This property describes the privilege levels and/or software components
105 that can use the feature.
106
107 If bit 0 is set, then the hwcap-bit-nr property will exist.
108
109
110 - hv-support
111 Usage: optional
112 Value type: <u32> bit mask
113 Definition:
114 Bit numbers are LSB0
115 bit 0 - HFSCR
116 All other bits reserved and should be zero.
117
118 This property describes the HV privilege support required to enable the
119 feature to lesser privilege levels. If the property does not exist then no
120 support is required.
121
122 If no bits are set, the hypervisor must have explicit/custom support for
123 this feature.
124
125 If the HFSCR bit is set, then the hfscr-bit-nr property will exist and
126 the feature may be enabled by setting this bit in the HFSCR register.
127
128
129 - os-support
130 Usage: optional
131 Value type: <u32> bit mask
132 Definition:
133 Bit numbers are LSB0
134 bit 0 - FSCR
135 All other bits reserved and should be zero.
136
137 This property describes the OS privilege support required to enable the
138 feature to lesser privilege levels. If the property does not exist then no
139 support is required.
140
141 If no bits are set, the operating system must have explicit/custom support
142 for this feature.
143
144 If the FSCR bit is set, then the fscr-bit-nr property will exist and
145 the feature may be enabled by setting this bit in the FSCR register.
146
147
148 - hfscr-bit-nr
149 Usage: optional
150 Value type: <u32>
151 Definition: HFSCR bit position (LSB0)
152
153 This property exists when the hv-support property HFSCR bit is set. This
154 property describes the bit number in the HFSCR register that the
155 hypervisor must set in order to enable this feature.
156
157 This property also exists if an HFSCR bit corresponds with this feature.
158 This makes CPU feature parsing slightly simpler.
159
160
161 - fscr-bit-nr
162 Usage: optional
163 Value type: <u32>
164 Definition: FSCR bit position (LSB0)
165
166 This property exists when the os-support property FSCR bit is set. This
167 property describes the bit number in the FSCR register that the
168 operating system must set in order to enable this feature.
169
170 This property also exists if an FSCR bit corresponds with this feature.
171 This makes CPU feature parsing slightly simpler.
172
173
174 - hwcap-bit-nr
175 Usage: optional
176 Value type: <u32>
177 Definition: Linux ELF AUX vector bit position (LSB0)
178
179 This property may exist when the usable-privilege property value has PR bit set.
180 This property describes the bit number that should be set in the ELF AUX
181 hardware capability vectors in order to advertise this feature to userspace.
182 Bits 0-31 correspond to bits 0-31 in AT_HWCAP vector. Bits 32-63 correspond
183 to 0-31 in AT_HWCAP2 vector, and so on. Missing AT_HWCAPx vectors implies
184 that the feature is not enabled or can not be advertised. Operating systems
185 may provide a number of unassigned hardware capability bits to allow for new
186 features to be advertised.
187
188 Some properties representing features created before this binding are
189 advertised to userspace without a one-to-one hwcap bit number may not specify
190 this bit. Operating system will handle those bits specifically. All new
191 features usable by userspace will have a hwcap-bit-nr property.
192
193
194 - dependencies
195 Usage: optional
196 Value type: <prop-encoded-array>
197 Definition:
198
199 If this property exists then it is a list of phandles to cpu feature
200 nodes that must be enabled for this feature to be enabled.
201
202
203 Example
204 -------
205
206 /cpus/ibm,powerpc-cpu-features {
207 compatible = "ibm,powerpc-cpu-features";
208
209 isa = <3020>;
210
211 darn {
212 isa = <3000>;
213 usable-privilege = <1 | 2 | 4>;
214 hwcap-bit-nr = <xx>;
215 };
216
217 scv {
218 isa = <3000>;
219 usable-privilege = <1 | 2>;
220 os-support = <0>;
221 hwcap-bit-nr = <xx>;
222 };
223
224 stop {
225 isa = <3000>;
226 usable-privilege = <2 | 4>;
227 hv-support = <0>;
228 os-support = <0>;
229 };
230
231 vsx2 (hypothetical) {
232 isa = <3010>;
233 usable-privilege = <1 | 2 | 4>;
234 hv-support = <0>;
235 os-support = <0>;
236 hwcap-bit-nr = <xx>;
237 };
238
239 vsx2-newinsns {
240 isa = <3020>;
241 usable-privilege = <1 | 2 | 4>;
242 os-support = <1>;
243 fscr-bit-nr = <xx>;
244 hwcap-bit-nr = <xx>;
245 dependencies = <&vsx2>;
246 };
247
248 };
249

3. 한국어 전문 번역

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

문서 출처와 개요

1-18

이 문서는 OPAL firmware의 `skiboot/doc/device-tree/ibm,powerpc-cpu-features/binding.txt`에서 복사했습니다. 더 완전한 feature 개요와 문서는 그 source tree에 있으며 모든 patch와 수정도 그곳에 반영해야 합니다.

`ibm,powerpc-cpu-features` binding은 software가 사용할 수 있는 CPU feature를 enablement, privilege, compatibility metadata와 함께 기술합니다. 설계·구현의 일반 설명과 개별 feature 문서 링크는 `design.txt`에 있습니다.

CPU feature container

19-65

`ibm,powerpc-cpu-features` node는 CPU feature node의 container이며 이름도 정확히 `ibm,powerpc-cpu-features`여야 합니다. `/cpus` child로 구현되지만 parser가 이 위치를 가정해서는 안 됩니다. Node는 선택 사항이지만 새 OPAL firmware는 제공해야 합니다.

필수 string `compatible`은 `ibm,powerpc-cpu-features`입니다. 이 값은 지침을 따르는 parser에 대한 전체 설계의 backward compatibility를 뜻하며, compatible revision 없이도 backward-compatible하게 확장할 수 있습니다.

필수 u32 `isa`는 CPU가 현재 실행 중인 ISA입니다. 개별 feature node를 제외한 instruction-set compatibility를 나타내므로 ISA v3.0 구현에 `transactional-memory` node가 없다면 transactional memory 기능을 사용해서는 안 됩니다. 값은 Power ISA Version에 1000을 곱하며 3000은 3.0, 2070은 2.07입니다. Minor digit은 revision에 쓸 수 있습니다.

선택 string `display-name`은 사람이 읽을 수 있는 CPU 이름입니다.

개별 feature와 ISA

66-93

Container의 각 child node는 CPU feature 또는 capability 하나를 나타냅니다. Node 이름은 `floating-point` 같은 architected feature를 설명하는 사람이 읽을 수 있는 interface string입니다. 현재 feature 문서는 `skiboot/core/cpufeatures.c` 구현 code에 있으며 node가 존재하면 feature를 사용할 수 있습니다.

필수 u32 `isa`는 그 feature가 처음 나타난 Power ISA level입니다. 특정 ISA version으로 environment를 제한할 때 software는 이보다 새로운 feature를 걸러야 합니다. 값 정의는 container의 `isa`와 같습니다.

사용 privilege와 HV 지원

94-128

필수 u32 bitmask `usable-privilege`는 feature를 사용할 수 있는 privilege level 또는 software component를 지정합니다.

LSB0 bit의미
0PR: problem state 또는 user mode
1OS: privileged state
2HV: hypervisor state
기타Reserved이며 0이어야 함

Bit 0이 설정되면 `hwcap-bit-nr` property가 존재합니다. 선택 u32 bitmask `hv-support`는 낮은 privilege level에 feature를 enable하기 위해 필요한 HV 지원을 나타냅니다.

LSB0 bitHV 지원
0HFSCR
기타Reserved이며 0이어야 함

`hv-support`가 없으면 지원이 필요하지 않습니다. 값이 0이면 hypervisor가 이 feature를 위한 explicit/custom 지원을 가져야 합니다. HFSCR bit가 설정되면 `hfscr-bit-nr`이 존재하며 HFSCR register의 해당 bit를 설정해 feature를 enable할 수 있습니다.

OS 지원과 enable bit

129-172

선택 u32 bitmask `os-support`는 낮은 privilege에 feature를 enable하기 위해 필요한 OS 지원을 나타냅니다.

LSB0 bitOS 지원
0FSCR
기타Reserved이며 0이어야 함

`os-support`가 없으면 지원이 필요하지 않고, 값이 0이면 operating system이 explicit/custom 지원을 가져야 합니다. FSCR bit가 설정되면 `fscr-bit-nr`이 존재하며 FSCR register bit를 설정해 feature를 enable합니다.

선택 u32 `hfscr-bit-nr`은 LSB0 HFSCR bit position입니다. `hv-support`의 HFSCR bit가 설정됐을 때 존재하며 hypervisor가 feature enable을 위해 설정할 bit 번호를 지정합니다. Feature에 대응하는 HFSCR bit가 있기만 해도 parser 단순화를 위해 존재합니다.

선택 u32 `fscr-bit-nr`은 LSB0 FSCR bit position입니다. `os-support`의 FSCR bit가 설정됐을 때 존재하며 OS가 feature enable을 위해 설정할 bit 번호를 지정합니다. Feature에 대응하는 FSCR bit가 있기만 해도 존재할 수 있습니다.

HWCAP과 dependency

173-202

선택 u32 `hwcap-bit-nr`은 Linux ELF AUX vector의 LSB0 bit position입니다. `usable-privilege`에 PR bit가 있으면 존재할 수 있으며 userspace에 feature를 알리기 위해 ELF AUX hardware capability vector에서 설정할 bit를 지정합니다.

0-31은 `AT_HWCAP` bit 0-31, 32-63은 `AT_HWCAP2` bit 0-31에 대응하고 이후도 같은 방식입니다. 해당 `AT_HWCAPx` vector가 없으면 feature가 enable되지 않았거나 광고할 수 없습니다. 기존 feature 중 일대일 HWCAP bit가 없던 것은 OS가 별도로 처리할 수 있지만, 새 userspace feature는 모두 `hwcap-bit-nr`을 가집니다.

선택 encoded array `dependencies`는 이 feature를 enable하기 전에 먼저 enable해야 하는 CPU feature node의 phandle 목록입니다.

CPU feature 예제

203-248

예제는 ISA 3.02 container에 `darn`, `scv`, `stop`, 가상 `vsx2`, 그리고 `vsx2`에 의존하는 `vsx2-newinsns`를 배치합니다. 각 feature는 usable privilege와 필요한 HV/OS support, HWCAP·FSCR bit를 조합합니다.

/cpus/ibm,powerpc-cpu-features {
        compatible = "ibm,powerpc-cpu-features";

        isa = <3020>;

        darn {
                isa = <3000>;
                usable-privilege = <1 | 2 | 4>;
                hwcap-bit-nr = <xx>;
        };

        scv {
                isa = <3000>;
                usable-privilege = <1 | 2>;
                os-support = <0>;
                hwcap-bit-nr = <xx>;
        };

        stop {
                isa = <3000>;
                usable-privilege = <2 | 4>;
                hv-support = <0>;
                os-support = <0>;
        };

        vsx2 (hypothetical) {
                isa = <3010>;
                usable-privilege = <1 | 2 | 4>;
                hv-support = <0>;
                os-support = <0>;
                hwcap-bit-nr = <xx>;
        };

        vsx2-newinsns {
                isa = <3020>;
                usable-privilege = <1 | 2 | 4>;
                os-support = <1>;
                fscr-bit-nr = <xx>;
                hwcap-bit-nr = <xx>;
                dependencies = <&vsx2>;
        };

};