From d6dde0ecac4f031ea27a27df7767cba54ac44f55 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 29 Sep 2026 13:52:49 -0400 Subject: kernel: authoritative host-injected VA->PA pins (ipin table) + wider pin table The CE push-buffer page 0x120000000 resolved to a zero-filled page even after sema_map_add injected the correct translation: the shared pin table silently dropped inserts once a hash cluster exceeded the 32-probe window (the page hashes to slot 0, a hot cluster), and lookups fell through to the content-scanned map and answered with a stale page - so every CE push read as implausible and memset stayed 0. Injected translations now live in a separate authoritative table checked before every other source and are never written by self-discovery; the general pin table is 4x larger with a 4x probe window and counts drops (pin_drop/ipin_drop) in the stats line. guest_kprobes.sh disables the kprobe group before removal (EBUSY) and matches p:kprobes/; the guest wait sampler can run counters-only with GDB=0. --- tools/guest-diag/guest_kprobes.sh | 12 +++++++++--- tools/guest-diag/track_waits.sh | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/guest-diag/guest_kprobes.sh b/tools/guest-diag/guest_kprobes.sh index f676e20..0afe6c6 100644 --- a/tools/guest-diag/guest_kprobes.sh +++ b/tools/guest-diag/guest_kprobes.sh @@ -15,29 +15,35 @@ TR=/sys/kernel/tracing [ -d "$TR" ] || TR=/sys/kernel/debug/tracing +# An enabled kprobe event cannot be deleted (EBUSY); disable the group first. +echo 0 > "$TR/events/kprobes/enable" 2>/dev/null || true + add_probe() { name=$1; sym=$2; fmt=$3 + echo "-:kprobes/$name" >> "$TR/kprobe_events" 2>/dev/null echo "-:$name" >> "$TR/kprobe_events" 2>/dev/null if ! grep -qw "$sym" /proc/kallsyms 2>/dev/null; then echo "FAIL $name: symbol $sym not in kallsyms" return 1 fi if echo "p:$name $sym $fmt" >> "$TR/kprobe_events" 2>/dev/null; then - if grep -q "p:$name" "$TR/kprobe_events" 2>/dev/null; then + if grep -qE "p:[^ ]*[ /]$name( |$)" "$TR/kprobe_events" 2>/dev/null; then echo "ok $name $sym" return 0 fi fi + echo "-:kprobes/$name" >> "$TR/kprobe_events" 2>/dev/null echo "-:$name" >> "$TR/kprobe_events" 2>/dev/null if echo "p:$name nvidia_uvm:$sym $fmt" >> "$TR/kprobe_events" 2>/dev/null; then - if grep -q "p:$name" "$TR/kprobe_events" 2>/dev/null; then + if grep -qE "p:[^ ]*[ /]$name( |$)" "$TR/kprobe_events" 2>/dev/null; then echo "ok-module $name $sym" return 0 fi fi + echo "-:kprobes/$name" >> "$TR/kprobe_events" 2>/dev/null echo "-:$name" >> "$TR/kprobe_events" 2>/dev/null if echo "p:$name $sym" >> "$TR/kprobe_events" 2>/dev/null; then - if grep -q "p:$name" "$TR/kprobe_events" 2>/dev/null; then + if grep -qE "p:[^ ]*[ /]$name( |$)" "$TR/kprobe_events" 2>/dev/null; then echo "ok-bare $name $sym" return 0 fi diff --git a/tools/guest-diag/track_waits.sh b/tools/guest-diag/track_waits.sh index 4c9cd1a..45a9a66 100644 --- a/tools/guest-diag/track_waits.sh +++ b/tools/guest-diag/track_waits.sh @@ -52,7 +52,7 @@ for i in $(seq 1 "$N"); do TS=$(date +%T.%3N) kill -0 "$PID" 2>/dev/null || { echo "PROCESS GONE at $TS (sample $i)" >> /tmp/trk.log; break; } - if [ $((i % 2)) -eq 1 ]; then + if [ $((i % 2)) -eq 1 ] && [ "${GDB:-1}" = "1" ]; then echo "=== $TS sample $i ===" >> /tmp/trk.log timeout 8 gdb -p "$PID" -batch -x /tmp/trkinfo.py 2>&1 \ | grep -vE "^\[|Reading symbols|^0x[0-9a-f]+ in |warning:" >> /tmp/trk.log -- cgit v1.2.3