← Interrupt 상세 목차DUJINLABS.COM

Hardware · Interrupt detailed manual 03 · Linux v6.18.37

3. hart context별 enable, priority와 threshold를 계산한다

PLIC target context는 hart와 privilege mode 조합입니다. global source priority와 context별 enable/threshold를 모두 통과해야 external interrupt가 hart에 전달됩니다.

상세 표
2
검증 행
14
절차
4 checkpoints
기준
RISC-V PLIC · AIA · Linux v6.18.37

CHAPTER 03

3. hart context별 enable, priority와 threshold를 계산한다

PLIC target context는 hart와 privilege mode 조합입니다. global source priority와 context별 enable/threshold를 모두 통과해야 external interrupt가 hart에 전달됩니다.

context

hart 하나에 M-mode와 S-mode context가 따로 있을 수 있습니다.

enable

같은 source도 context별 enable bitmap이 다릅니다.

threshold

source priority가 threshold보다 높아야 전달됩니다.

tie

같은 priority source의 tie-break는 낮은 source ID가 우선입니다.

레지스터·번호·소유권 대조

항목소유자값의 의미정상 증거오류 해석
priority[source]globalsource 우선순위threshold보다 큼0 또는 낮음
enable[context]target contextsource 허용현재 hart/mode bit 1다른 context를 씀
threshold[context]target context최소 전달 priority시험 정책 일치모든 source 차단
context base/strideSoC maphart/mode addressfirmware context map과 일치잘못된 MMIO context
hart external pendingCSRcontext 출력qualified source 존재 시 setPLIC 설정과 CSR 불일치

실패 경계 판정

증상직전 통과우선 확인반증 시험판정
hart0만 수신global pendinghart1 context enableenable bitmap diffper-context 설정
S-mode는 안 옴M-mode context 성공S context와 delegationcontext/CSR를 분리 시험privilege context
priority 바꿔도 순서 동일둘 다 전달threshold/tie/source ID서로 다른 priority로 재시험설정 address 오류
threshold 0인데 차단enable/priority 정상현재 context 식별claim register 주소 비교context map
CPU hotplug 후 enable 유실boot 시 정상per-CPU restoreonline 전후 bitmap difflifecycle
그림 1. 3. hart context별 enable, priority와 threshold를 계산한다의 실행 순서왼쪽에서 오른쪽으로 실제 소유권과 관찰 지점이 이동합니다.
01 global pending
02 source priority
03 context enable
04 threshold compare
05 hart external pending
06 trap
07 claim

실제 검증 절차

순서실행남길 증거판정 목적
1firmware의 context list를 hart/mode/MMIO base로 펼칩니다.context map주소 확인
2source별 priority와 모든 context enable을 CSV로 저장합니다.정책 matrix차단 지점
3threshold를 단계별로 올려 전달 경계를 측정합니다.priority orderingcomparator 확인
4hart hotplug 후 context bitmap을 비교합니다.restore 증거lifecycle 검증

주의context 번호를 hart ID와 동일하게 가정하지 않습니다. 구현과 firmware가 제공한 context 순서를 사용합니다.

공개적으로 다시 확인할 수 있는 자료

공개되지 않은 vendor register나 integration별 offset을 추측해서 채우지 않았습니다. 아래 제조사 자료, architecture 문서와 Linux v6.18.37 원본에서 다시 확인할 수 있는 범위만 사용했습니다.