[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 17/24] XSM: make Argo hooks well-formed ones


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 3 Aug 2026 17:01:43 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8aPzKaT4Ch3aMYTEO4glCQqrnHCy3HTBrxMY75ZeYh0=; b=e7mlNv3pYLMg2wFj7zcCh5jn4eznJPSXZOO8lZrtixXJXfpv9NXrCxoSjhgFJMxCkGoEkhM+D1F1KIBqtS74pbXZeZUb0BGxnuF6O5VYoweDP+vyXZVxiLVLyhsf63NTR+LSJFlXeX9cbD7ZryVCAeGV9uzyseO+ITNO8VH6N1Rth6+YABxqM4BZlsrTu0+BUjdElKwVZLY7yGi79HIKBWOeVXxa4PxWZfxg9mfv27KtiZGJ1pwGXN6/Bswqg/6cQjd3nRL/XST8WPriUsTWApdGU27ZXHZUnC4FWL7zgUXSOnA8QxjujGfOxHF4QPu1dZfuDUYozTV02166hWsKeQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iTyKZXx5jeJeCIi21orKLBttZSXFVh0ZEMjO0I+DB6YmoLYd6LMI8tVdAhZxRvNsv/EGXNeQ0Gj9H11Q+3nRYo5IwgyRqRFPa7GMSwEbcxOHgbCgZbI7mBEA43mUrQHYofkxt+npcB+zezD6Z+bvzO9WiHtpoFVObp5nqCa1oZg5nD8vtdowIy4lAkTslVCBiEElcwQ8iU0Pl1qUns8dfadfyG1JZzHCFsIYC1X1nlFl8GSNhNYBAL6vIyARdC+sfU+EotK03WTPNVZZzrNpC48uf9OYhkRScD4PYN3RIPk33IxiSTwC8GA/LfCK1Pj4jEBEzqF5LV/KFVuTZKaBUw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Daniel Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 03 Aug 2026 21:02:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2026-07-28 09:22, Jan Beulich wrote:
For whatever reason they didn't have an xsm_default_t first argument (to
cope with XSM=n mode), making it impossible to (easily) cover them in
xsm/hooks.h.

To be able to retain the const on their function parameters, adjust
xsm_default_action() accordingly.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h

@@ -751,27 +751,32 @@ static XSM_INLINE int xsm_dm_op(XSM_DEFA
  #endif
#ifdef CONFIG_ARGO
-static XSM_INLINE int xsm_argo_enable(const struct domain *d)
+
+static XSM_INLINE int xsm_argo_enable(XSM_DEFAULT_ARG const struct domain *d)
  {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);

This one I think should be
    return xsm_default_action(action, d, NULL);

Usually current is passed in for the check, but for domain_create() -> argo_init() it is the under-construction domain.
  }
static XSM_INLINE int xsm_argo_register_single_source(
-    const struct domain *d, const struct domain *t)
+    XSM_DEFAULT_ARG const struct domain *d, const struct domain *t)
  {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d, t);
  }
static XSM_INLINE int xsm_argo_register_any_source(
-    const struct domain *d)
+    XSM_DEFAULT_ARG const struct domain *d)
  {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);

Similarly:
    return xsm_default_action(action, d, NULL);

The single call is:
xsm_argo_register_any_source(currd);

These argo hooks all pass in their arguments explicitly, so I think we should do that and not use current. (The send and register hooks could use current, and that could make sense as those map to hypercalls. But it is correct today with the explicit arguments.)

With the changes:
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

Thanks,
Jason

  }
static XSM_INLINE int xsm_argo_send(
-    const struct domain *d, const struct domain *t)
+    XSM_DEFAULT_ARG const struct domain *d, const struct domain *t)
  {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d, t);
  }
#endif /* CONFIG_ARGO */



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.