← Documents Documentation/arch/parisc/debugging.rst GitHub 원문 ↗

Linux 6.18.37 · Architecture

PA-RISC Debugging

Real-mode address, HPMC와 PSW Q-bit 문제를 진단하는 low-level guide입니다.

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

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

1. 요약·해설

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

요약과 해설

debugging.rst:1-46

PA-RISC low-level fault는 virtual/physical address 혼동, HPMC responder address, Q-bit 비가시 구간을 순서대로 확인해야 합니다.

PA-RISC real-mode fault triage
Fault/HangReal-mode?`+ __PAGE_OFFSET` 역산
HPMCRequestor = HPA?Responder physical address
Q=0 windowIAOQ 신뢰 제한Clear-to-RFI 구간 검사

Address와 interruption state를 차례로 좁힙니다.

관찰 증상
증상대표 원인
HPMCUntranslated virtual address in real mode
설명 불가 hangPSW Q bit window
Physical memory 끝을 넘어 실행Stale interruption state

Fault 종류별 대표 단서입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 =================
2 PA-RISC Debugging
3 =================
4
5 okay, here are some hints for debugging the lower-level parts of
6 linux/parisc.
7
8
9 1. Absolute addresses
10 =====================
11
12 A lot of the assembly code currently runs in real mode, which means
13 absolute addresses are used instead of virtual addresses as in the
14 rest of the kernel. To translate an absolute address to a virtual
15 address you can lookup in System.map, add __PAGE_OFFSET (0x10000000
16 currently).
17
18
19 2. HPMCs
20 ========
21
22 When real-mode code tries to access non-existent memory, you'll get
23 an HPMC instead of a kernel oops. To debug an HPMC, try to find
24 the System Responder/Requestor addresses. The System Requestor
25 address should match (one of the) processor HPAs (high addresses in
26 the I/O range); the System Responder address is the address real-mode
27 code tried to access.
28
29 Typical values for the System Responder address are addresses larger
30 than __PAGE_OFFSET (0x10000000) which mean a virtual address didn't
31 get translated to a physical address before real-mode code tried to
32 access it.
33
34
35 3. Q bit fun
36 ============
37
38 Certain, very critical code has to clear the Q bit in the PSW. What
39 happens when the Q bit is cleared is the CPU does not update the
40 registers interruption handlers read to find out where the machine
41 was interrupted - so if you get an interruption between the instruction
42 that clears the Q bit and the RFI that sets it again you don't know
43 where exactly it happened. If you're lucky the IAOQ will point to the
44 instruction that cleared the Q bit, if you're not it points anywhere
45 at all. Usually Q bit problems will show themselves in unexplainable
46 system hangs or running off the end of physical memory.
47

3. 한국어 전문 번역

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

Real-mode absolute address

1-17

이 문서는 Linux/PA-RISC low-level code debugging을 위한 실무 hint를 설명합니다. 많은 assembly code가 real mode에서 실행되어 kernel 나머지 부분의 virtual address 대신 absolute address를 사용합니다.

Absolute address를 `System.map`에서 찾을 virtual address로 바꾸려면 현재 `__PAGE_OFFSET` 값인 `0x10000000`을 더합니다.

HPMC 분석

18-33

Real-mode code가 존재하지 않는 memory를 접근하면 kernel oops 대신 HPMC가 발생합니다. System Responder와 System Requestor address를 찾는 것이 첫 단계입니다.

Address예상값과 의미
System RequestorProcessor HPA 중 하나와 일치해야 함. I/O range의 높은 address
System ResponderReal-mode code가 실제로 접근하려 한 address

Responder가 `__PAGE_OFFSET` (`0x10000000`)보다 크면 virtual address를 physical address로 변환하지 않고 real-mode code가 접근했을 가능성이 큽니다.

PSW Q bit 주의

34-46

아주 critical한 code는 PSW의 Q bit를 clear해야 합니다. Q bit가 0이면 CPU가 interruption handler가 참조하는 interruption-state register를 갱신하지 않습니다.

Q bit clear instruction과 Q를 다시 set하는 `RFI` 사이에 interruption이 발생하면 정확한 위치를 알 수 없습니다. 운이 좋으면 `IAOQ`가 clear instruction을 가리키지만 그렇지 않으면 임의 위치가 될 수 있습니다. Q bit 문제는 설명하기 어려운 system hang이나 physical memory 끝을 넘어 실행하는 현상으로 나타납니다.