Skip to contentSkip to conversation

Argo/XSM: add SILO hooks

PATCH In review Jan Beulich 2 participants 2 messages May 7, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Argo/XSM: add SILO hooks

In SILO mode restrictions for inter-domain communication should apply here along the lines of those for evtchn and gnttab.

---
Really I was first thinking about the shim: Shouldn't that proxy argo requests just like it does for gnttab ones? It only then occurred to me that there's also an implication for SILO mode.

xen/xsm/silo.c +23 -0
@@ -81,12 +81,35 @@ static int silo_grant_copy(struct domain
     return -EPERM;
 }
 
+#ifdef CONFIG_ARGO
+
+static int silo_argo_register_single_source(const struct domain *d1,
+                                            const struct domain *d2)
+{
+    if ( silo_mode_dom_check(d1, d2) )
+        return xsm_argo_register_single_source(d1, d2);
+    return -EPERM;
+}
+
+static int silo_argo_send(const struct domain *d1, const struct domain *d2)
+{
+    if ( silo_mode_dom_check(d1, d2) )
+        return xsm_argo_send(d1, d2);
+    return -EPERM;
+}
+
+#endif
+
 static struct xsm_operations silo_xsm_ops = {
     .evtchn_unbound = silo_evtchn_unbound,
     .evtchn_interdomain = silo_evtchn_interdomain,
     .grant_mapref = silo_grant_mapref,
     .grant_transfer = silo_grant_transfer,
     .grant_copy = silo_grant_copy,
+#ifdef CONFIG_ARGO
+    .argo_register_single_source = silo_argo_register_single_source,
+    .argo_send = silo_argo_send,
+#endif
 };
 
 void __init silo_init(void)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Jan Beulich

In SILO mode restrictions for inter-domain communication should apply here along the lines of those for evtchn and gnttab.

Quoted 44 lines

---
Really I was first thinking about the shim: Shouldn't that proxy argo requests just like it does for gnttab ones? It only then occurred to me that there's also an implication for SILO mode.

xen/xsm/silo.c +23 -0
@@ -81,12 +81,35 @@ static int silo_grant_copy(struct domain
     return -EPERM;
 }
 
+#ifdef CONFIG_ARGO
+
+static int silo_argo_register_single_source(const struct domain *d1,
+                                            const struct domain *d2)
+{
+    if ( silo_mode_dom_check(d1, d2) )
+        return xsm_argo_register_single_source(d1, d2);
+    return -EPERM;
+}
+
+static int silo_argo_send(const struct domain *d1, const struct domain *d2)
+{
+    if ( silo_mode_dom_check(d1, d2) )
+        return xsm_argo_send(d1, d2);
+    return -EPERM;
+}
+
+#endif
+
 static struct xsm_operations silo_xsm_ops = {
     .evtchn_unbound = silo_evtchn_unbound,
     .evtchn_interdomain = silo_evtchn_interdomain,
     .grant_mapref = silo_grant_mapref,
     .grant_transfer = silo_grant_transfer,
     .grant_copy = silo_grant_copy,
+#ifdef CONFIG_ARGO
+    .argo_register_single_source = silo_argo_register_single_source,
+    .argo_send = silo_argo_send,
+#endif
 };
 
 void __init silo_init(void)