summaryrefslogtreecommitdiff
path: root/internal/generate/classify_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-30 10:17:11 +0300
committerPaul Buetow <paul@buetow.org>2026-05-30 10:17:11 +0300
commitd7ed10ef5f3d819c7232302317c8ba149922b391 (patch)
treec4f46f2384758a99e7dd90a47e088d3952cc84e1 /internal/generate/classify_test.go
parent768e53d90be2d15242266b898023c9c39dacf47d (diff)
family: document Misc-vs-IPC boundary rule; keep robust_list in Misc (task 520)
Resolve the get_robust_list/set_robust_list classification decision: keep both as FamilyMisc rather than promoting them to FamilyIPC alongside the recently-moved futex_* syscalls. Rule (now documented in family.go next to the futex IPC block): a syscall is IPC only if it PERFORMS the actual IPC/sync operation (futex wait/wake/requeue on the futex word, or an op on an IPC object). Per-thread registration/bookkeeping that merely hands the kernel a pointer it consults later -- rseq and get_robust_list/set_robust_list -- stays Misc. man 2 get_robust_list confirms the robust futex list is 'managed in user space: the kernel knows only about the location of the head'; these syscalls register/query that per-thread head pointer and never wait/wake or touch shared memory, structurally identical to rseq. The split axis is operation-vs-registration, not name similarity. No classification change, so mage generate is a no-op (generated artifacts and docs/syscall-tracing-plan.md unchanged). Strengthened the rseq/ robust_list comments in family_test.go and the TestClassifyGetRobustListPidNotFd lock-in comment in classify_test.go to cite the rule and mark the decision resolved. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'internal/generate/classify_test.go')
-rw-r--r--internal/generate/classify_test.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/internal/generate/classify_test.go b/internal/generate/classify_test.go
index 77e19d1..bebf85e 100644
--- a/internal/generate/classify_test.go
+++ b/internal/generate/classify_test.go
@@ -2276,10 +2276,16 @@ func TestClassifySchedGetattrPidNotFd(t *testing.T) {
// IPC like the futex_* shared-memory primitives (see family.go / family_test.go),
// - return classifies as UNCLASSIFIED (0/-1, no byte transfer).
//
-// NOTE: get_robust_list/set_robust_list are robust-futex bookkeeping and could
-// arguably sit with futex_* under IPC; that grouping question is tracked as a
-// follow-up rather than changed here, since the syscalls register/query a
-// per-thread pointer (like rseq) rather than operating on shared memory.
+// FAMILY DECISION (resolved): get_robust_list/set_robust_list stay FamilyMisc and
+// are NOT moved to FamilyIPC for "futex consistency". The boundary rule (spelled
+// out next to the futex block in family.go) is operation-vs-registration: a
+// syscall is IPC only if it PERFORMS the actual IPC/sync operation (futex
+// wait/wake/requeue, or an op on an IPC object). These two only register/query
+// the per-thread robust-futex list head pointer — per get_robust_list(2) the list
+// is "managed in user space: the kernel knows only about the location of the head"
+// — and never wait, wake, or touch the shared futex word. That is per-thread
+// bookkeeping, structurally identical to rseq, so they share rseq's Misc family.
+// The contrast assertion below (futex == IPC) pins both sides of the boundary.
func TestClassifyGetRobustListPidNotFd(t *testing.T) {
// Field layout mirrors the actual kernel tracepoint format for
// sys_enter_get_robust_list: int pid, struct robust_list_head **head_ptr,