summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/pin_gr_window.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 14:41:14 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 14:41:14 -0400
commitfa31d766d548a0e07426b6d231a42f05c07521a8 (patch)
tree979ce4eda4f8cea44c2a2290897abfba870d171b /tools/guest-diag/pin_gr_window.py
parent9db2c19f4e5d1a52dc500a199ed6dfa78f35ff0a (diff)
downloadopen-iov-fa31d766d548a0e07426b6d231a42f05c07521a8.tar.gz
open-iov-fa31d766d548a0e07426b6d231a42f05c07521a8.zip
kernel: grace window for untranslatable GR entries; tools: coalesce window pin output
The first GR window pin landed ~2 s after the pump consumed the freshly created channels' GPFIFO entries on the first failed read, so the pushes (and the tracking-semaphore releases they carry) were lost. GR entries with an unresolvable push page now stay pending for sema_gr_grace_ms (default 8 s) before the stale-entry consume; a pin landing in that window makes the entry readable and it executes normally. The completion counter is still published from put at the end of every pass, so the client's counter wait is not delayed. guest_pmap_win.py coalesces contiguous VA+PA pages into run lines, so a 15k-page window transfers as ~200 lines instead of ~15k and the pin batch lands within a second of the pages appearing.
Diffstat (limited to 'tools/guest-diag/pin_gr_window.py')
-rw-r--r--tools/guest-diag/pin_gr_window.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/guest-diag/pin_gr_window.py b/tools/guest-diag/pin_gr_window.py
index 4a968c9..26083f7 100644
--- a/tools/guest-diag/pin_gr_window.py
+++ b/tools/guest-diag/pin_gr_window.py
@@ -77,9 +77,14 @@ def scan(pid):
% (pid, LO, HI, MAXP, PAMAX), 90)
pairs = []
for line in out.splitlines():
- m = re.match(r"^(0x[0-9a-f]+),(0x[0-9a-f]+)$", line.strip())
- if m:
- pairs.append((int(m.group(1), 16), int(m.group(2), 16)))
+ m = re.match(r"^(0x[0-9a-f]+),(0x[0-9a-f]+)(?:,(\d+))?$", line.strip())
+ if not m:
+ continue
+ va = int(m.group(1), 16)
+ pa = int(m.group(2), 16)
+ n = int(m.group(3)) if m.group(3) else 1
+ for i in range(n):
+ pairs.append((va + i * 0x1000, pa + i * 0x1000))
return pairs
@@ -125,7 +130,7 @@ def probe(va):
def main():
- interval = float(sys.argv[1]) if len(sys.argv) > 1 else 2.0
+ interval = float(sys.argv[1]) if len(sys.argv) > 1 else 1.0
if not push_helper():
log("FATAL: could not push guest helper")
return 1