← Documents Documentation/arch/xtensa/atomctl.rst GitHub 원문 ↗

Linux 6.18.37 · Architecture

Xtensa Atomic Operation Control Register

ATOMCTL bit field가 cache mode별 S32C1I atomic operation을 선택하는 방식을 설명합니다.

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

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

1. 요약·해설

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

요약과 해설

atomctl.rst:1-51

`ATOMCTL`은 Write Back, Write Thru, Bypass mode마다 Exception, RCW Transaction, Internal Operation 중 하나를 선택합니다. 실제 memory controller의 RCW 지원 여부에 맞춘 설정이 중요합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ===========================================
2 Atomic Operation Control (ATOMCTL) Register
3 ===========================================
4
5 We Have Atomic Operation Control (ATOMCTL) Register.
6 This register determines the effect of using a S32C1I instruction
7 with various combinations of:
8
9 1. With and without an Coherent Cache Controller which
10 can do Atomic Transactions to the memory internally.
11
12 2. With and without An Intelligent Memory Controller which
13 can do Atomic Transactions itself.
14
15 The Core comes up with a default value of for the three types of cache ops::
16
17 0x28: (WB: Internal, WT: Internal, BY:Exception)
18
19 On the FPGA Cards we typically simulate an Intelligent Memory controller
20 which can implement RCW transactions. For FPGA cards with an External
21 Memory controller we let it to the atomic operations internally while
22 doing a Cached (WB) transaction and use the Memory RCW for un-cached
23 operations.
24
25 For systems without an coherent cache controller, non-MX, we always
26 use the memory controllers RCW, though non-MX controllers likely
27 support the Internal Operation.
28
29 CUSTOMER-WARNING:
30 Virtually all customers buy their memory controllers from vendors that
31 don't support atomic RCW memory transactions and will likely want to
32 configure this register to not use RCW.
33
34 Developers might find using RCW in Bypass mode convenient when testing
35 with the cache being bypassed; for example studying cache alias problems.
36
37 See Section 4.3.12.4 of ISA; Bits::
38
39 WB WT BY
40 5 4 | 3 2 | 1 0
41
42 ========= ================== ================== ===============
43 2 Bit
44 Field
45 Values WB - Write Back WT - Write Thru BY - Bypass
46 ========= ================== ================== ===============
47 0 Exception Exception Exception
48 1 RCW Transaction RCW Transaction RCW Transaction
49 2 Internal Operation Internal Operation Reserved
50 3 Reserved Reserved Reserved
51 ========= ================== ================== ===============
52

3. 한국어 전문 번역

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

ATOMCTL register와 기본값

1-18

`Atomic Operation Control (ATOMCTL)` register는 `S32C1I` instruction을 사용할 때 system의 atomic-operation 구현 방식에 어떤 효과가 생기는지 결정합니다.

  • memory에 대한 atomic transaction을 내부적으로 수행할 수 있는 Coherent Cache Controller의 유무
  • atomic transaction을 직접 수행할 수 있는 Intelligent Memory Controller의 유무

core가 시작될 때 세 cache-operation type에 적용되는 기본값은 다음과 같습니다.

0x28: (WB: Internal, WT: Internal, BY:Exception)

memory controller별 atomic 정책

19-35

FPGA card에서는 일반적으로 `RCW` transaction을 구현할 수 있는 Intelligent Memory Controller를 simulate합니다. External Memory Controller가 있는 FPGA card에서는 cached (`WB`) transaction에 대해 controller가 atomic operation을 내부 수행하게 하고, uncached operation에는 memory `RCW`를 사용합니다.

coherent cache controller가 없는 non-MX system에서는 memory controller의 `RCW`를 항상 사용합니다. 다만 non-MX controller도 Internal Operation을 지원할 가능성이 큽니다.

CUSTOMER-WARNING: 대부분 고객이 사용하는 vendor memory controller는 atomic `RCW` memory transaction을 지원하지 않습니다. 따라서 `ATOMCTL` register가 `RCW`를 사용하지 않도록 설정해야 할 가능성이 큽니다.

cache를 bypass한 상태에서 cache alias 문제 등을 시험할 때는 Bypass mode에서 `RCW`를 사용하는 것이 개발자에게 편리할 수 있습니다.

ATOMCTL bit field와 값

36-51

ISA Section 4.3.12.4에 정의된 bit 배치는 다음과 같습니다.

ATOMCTL 2-bit field layout
BitsFieldCache mode
`5:4``WB`Write Back
`3:2``WT`Write Thru
`1:0``BY`Bypass
Default 0x28`WB=2` Internal, `WT=2` Internal, `BY=0` Exception

원문의 WB·WT·BY bit 좌표를 구조화했습니다.

2 Bit Field ValueWB - Write BackWT - Write ThruBY - Bypass
`0`ExceptionExceptionException
`1`RCW TransactionRCW TransactionRCW Transaction
`2`Internal OperationInternal OperationReserved
`3`ReservedReservedReserved