summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/gsp_sema_service.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c
index a09a3c5..384b804 100644
--- a/kernel/gsp_sema_service.c
+++ b/kernel/gsp_sema_service.c
@@ -1886,16 +1886,38 @@ static void svc_pin_store_win(u64 va, u64 pa, int ap)
* (observed: the CE push-buffer page resolved to a zero-filled page and
* every push was "implausible").
*/
+static inline bool svc_pool_sem_va(u64 va);
+static void svc_pool_pa_forget(u64 va);
+
static int svc_ipin_lookup(u64 va, u64 *pa, int *ap)
{
- return pin_lookup_tab(svc.ipin, SVC_IPIN_SLOTS, SVC_IPIN_PROBE, va, pa,
- ap, false);
+ int rc = pin_lookup_tab(svc.ipin, SVC_IPIN_SLOTS, SVC_IPIN_PROBE, va, pa,
+ ap, false);
+
+ if (svc_pool_sem_va(va) && gsp_sema_dbg && svc.counter_rel_dbg < 256) {
+ svc.counter_rel_dbg++;
+ pr_info("vgsp-sema: ipin-lookup va=0x%llx rc=%d pa=0x%llx\n",
+ va, rc, rc ? 0 : *pa);
+ }
+ return rc;
}
static void svc_ipin_store(u64 va, u64 pa, int ap)
{
pin_store_tab(svc.ipin, SVC_IPIN_SLOTS, SVC_IPIN_PROBE, &svc.ipin_n,
&svc.ipin_drop, va, pa, ap, 0);
+ /*
+ * A fresh injection supersedes every older translation for this
+ * page: drop the verified pool cache entry so a subsequent pool
+ * release re-resolves through the pin we just stored instead of
+ * a cached page that may belong to the previous client.
+ */
+ if (svc_pool_sem_va(va))
+ svc_pool_pa_forget(va);
+ if (svc_pool_sem_va(va) && gsp_sema_dbg && svc.counter_rel_dbg < 256) {
+ svc.counter_rel_dbg++;
+ pr_info("vgsp-sema: ipin-store va=0x%llx pa=0x%llx\n", va, pa);
+ }
}
/* Any pinned translation: injected truth first, then self-discovered pins. */