From b7636afd9715748396325ec4dd0899c7f42ece17 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 29 Sep 2026 15:34:18 -0400 Subject: sema-svc: apply releases before push memsets; poller: bypass read cache --- tools/guest-diag/semfix_uvmt.py | 8 ++++---- tools/guest-diag/semfix_watch.py | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'tools') diff --git a/tools/guest-diag/semfix_uvmt.py b/tools/guest-diag/semfix_uvmt.py index fb0e92e..02d4f9e 100755 --- a/tools/guest-diag/semfix_uvmt.py +++ b/tools/guest-diag/semfix_uvmt.py @@ -109,21 +109,21 @@ def uvmt_state(q, sem): cpu_va + idx*4 (its GPU alias is gpu_va + idx*4, the VA the releasing push writes). """ - vals = q.read64(sem, 12) + vals = q.read64(sem, 12, cache=False) if len(vals) < 2 or not is_kern(vals[0]): return None - pv = q.read64(vals[0]) + pv = q.read64(vals[0], cache=False) if not pv or not is_kern(pv[0]): return None mem = pv[0] - vas = q.read64(mem + 0x10, 16) + vas = q.read64(mem + 0x10, 16, cache=False) cpu = next((v for v in vas if is_kern(v)), None) gpu = [v for v in vas if is_gpu(v)] idx = vals[1] & 0xffff payload = None word_pa = None if cpu is not None: - w = q.read64(cpu + idx * 4) + w = q.read64(cpu + idx * 4, cache=False) payload = w[0] if w else None word_pa = q.gva2gpa(cpu + idx * 4) word_va = (gpu[0] + idx * 4) if gpu else None diff --git a/tools/guest-diag/semfix_watch.py b/tools/guest-diag/semfix_watch.py index 1fc6b01..1c33de6 100644 --- a/tools/guest-diag/semfix_watch.py +++ b/tools/guest-diag/semfix_watch.py @@ -96,16 +96,17 @@ class Qmp: def hmp(self, line): return self.cmd("human-monitor-command", **{"command-line": line}).get("return", "") - def read64(self, addr, n=1): + def read64(self, addr, n=1, cache=True): key = (addr, n) - if key in self._cache: + if cache and key in self._cache: return self._cache[key] out = self.hmp("x/%dgx 0x%x" % (n, addr)) m = re.search(r":(.*)$", out, re.S) if not m: return [] vals = [int(x, 16) for x in re.findall(r"0x([0-9a-fA-F]+)", m.group(1))][:n] - self._cache[key] = vals + if cache: + self._cache[key] = vals return vals def gva2gpa(self, va): -- cgit v1.2.3