← Documents Documentation/arch/arm64/legacy_instructions.rst GitHub 원문 ↗

Linux 6.18.37 · Architecture

Legacy Instructions

Arm64의 obsolete·deprecated instruction을 Undef, software emulation 또는 hardware execution으로 처리하는 sysctl ABI를 설명합니다.

Source pathDocumentation/arch/arm64/legacy_instructions.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

legacy_instructions.rst:1-68

Legacy instruction infrastructure는 old binary migration을 돕되 obsolete instruction은 기본 차단하고 deprecated instruction은 warning과 통계를 곁들여 emulate합니다.

Legacy instruction 처리
Instruction trap`/proc/sys/abi` mode`0` Undef
Instruction trap`/proc/sys/abi` mode`1` Emulate + trace
Instruction trap`/proc/sys/abi` mode`2` Hardware 실행

Architecture 상태와 sysctl mode가 실제 실행 경로를 결정합니다.

지원 instruction 기본값
Instruction상태기본 mode
SWP{B}ObsoleteUndef (0)
CP15 BarriersDeprecatedEmulate (1)
SETENDDeprecatedEmulate (1)

Obsolete와 deprecated 상태에 따라 기본 정책이 다릅니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ===================
2 Legacy instructions
3 ===================
4
5 The arm64 port of the Linux kernel provides infrastructure to support
6 emulation of instructions which have been deprecated, or obsoleted in
7 the architecture. The infrastructure code uses undefined instruction
8 hooks to support emulation. Where available it also allows turning on
9 the instruction execution in hardware.
10
11 The emulation mode can be controlled by writing to sysctl nodes
12 (/proc/sys/abi). The following explains the different execution
13 behaviours and the corresponding values of the sysctl nodes -
14
15 * Undef
16 Value: 0
17
18 Generates undefined instruction abort. Default for instructions that
19 have been obsoleted in the architecture, e.g., SWP
20
21 * Emulate
22 Value: 1
23
24 Uses software emulation. To aid migration of software, in this mode
25 usage of emulated instruction is traced as well as rate limited
26 warnings are issued. This is the default for deprecated
27 instructions, .e.g., CP15 barriers
28
29 * Hardware Execution
30 Value: 2
31
32 Although marked as deprecated, some implementations may support the
33 enabling/disabling of hardware support for the execution of these
34 instructions. Using hardware execution generally provides better
35 performance, but at the loss of ability to gather runtime statistics
36 about the use of the deprecated instructions.
37
38 The default mode depends on the status of the instruction in the
39 architecture. Deprecated instructions should default to emulation
40 while obsolete instructions must be undefined by default.
41
42 Note: Instruction emulation may not be possible in all cases. See
43 individual instruction notes for further information.
44
45 Supported legacy instructions
46 -----------------------------
47 * SWP{B}
48
49 :Node: /proc/sys/abi/swp
50 :Status: Obsolete
51 :Default: Undef (0)
52
53 * CP15 Barriers
54
55 :Node: /proc/sys/abi/cp15_barrier
56 :Status: Deprecated
57 :Default: Emulate (1)
58
59 * SETEND
60
61 :Node: /proc/sys/abi/setend
62 :Status: Deprecated
63 :Default: Emulate (1)*
64
65 Note: All the cpus on the system must have mixed endian support at EL0
66 for this feature to be enabled. If a new CPU - which doesn't support mixed
67 endian - is hotplugged in after this feature has been enabled, there could
68 be unexpected results in the application.
69

3. 한국어 전문 번역

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

Legacy instruction emulation

1-14

Arm64 Linux port는 architecture에서 deprecated 또는 obsolete가 된 instruction을 emulate하는 infrastructure를 제공합니다. Undefined-instruction hook으로 emulation을 지원하고, hardware가 제공하는 경우 instruction의 hardware execution을 켤 수도 있습니다.

실행 mode는 `/proc/sys/abi` 아래 sysctl node에 값을 써서 제어합니다.

실행 mode와 기본 정책

15-44
Mode동작과 기본 사용처
`Undef``0`Undefined-instruction abort를 발생시킵니다. `SWP`처럼 obsolete instruction의 기본값입니다.
`Emulate``1`Software emulation을 사용하고 usage trace와 rate-limited warning을 제공합니다. CP15 barrier처럼 deprecated instruction의 기본값입니다.
`Hardware Execution``2`지원 구현에서 hardware 실행을 사용합니다. 성능은 좋지만 deprecated instruction의 runtime 통계를 수집할 수 없습니다.

기본 mode는 architecture에서 instruction의 상태에 따라 결정됩니다. Deprecated instruction은 emulation이 기본이고 obsolete instruction은 undefined가 기본이어야 합니다.

모든 상황에서 instruction emulation이 가능한 것은 아닙니다. 개별 instruction 설명을 확인해야 합니다.

지원 legacy instruction

45-68
Instructionsysctl node상태기본값
`SWP{B}``/proc/sys/abi/swp`Obsolete`Undef (0)`
`CP15 Barriers``/proc/sys/abi/cp15_barrier`Deprecated`Emulate (1)`
`SETEND``/proc/sys/abi/setend`Deprecated`Emulate (1)*`

`SETEND`를 활성화하려면 system의 모든 CPU가 EL0 `mixed endian`을 지원해야 합니다. 활성화 후 이를 지원하지 않는 CPU를 hotplug하면 application에서 예기치 않은 결과가 생길 수 있습니다.