[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>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 4 Aug 2026 10:27:17 -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=nR4Is8OyR6I08GeGM3t3zaSmggdBeboOOSXRsCXiuVk=; b=NtR4D2chpsbSQNxJQIVU2OnNc6q7AAzDkyL7XMYVTj4XEmvpWE5AcMlT19WboYKnUWSf3xKi0fMgzjMIeAWszu18NR8GXd7K6zjJLXZ4Ul1dXel+JUPu2Rpxj1JndVMjVjNk8kcU4FmhkRSLr6w23eIQXgEjMmYZRrMD6oF84rS57edea8GK9WYU56y+Tghw+7zZ4Zmj0pBq+9V4aXXWZUCwzOdHYQMiJZNkts6i5Mzu2xGOOuL80xFCoc7yAr9y4sfckhlHxBpfBvspxBx+XSDIejFwS3nS5s4uKr0rGv9HIu9jZxP5IMJna8FD+MxoG/nVx7h2W831iUukVQfW3w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DdejiW88sNJhAhZbXKWD0EyYZGNDAcuFlEfel4t62wJgjJ5gAu3tjUxfQjiluWWqUuIYdQzdBuuIpm5MXADKCQ+eWeNGCYw+VnoRLU2faqh4jJGur8Kh8Fps5o/HbKYonR0LdlwaVZzKsKEdVe1E8MLBNF2hEdFqPWPh3i1p1I055Me0nk1k8sYw7J92eiwWDlmGK3NNkgClV+vqFIY/TLyDCusNwlpsRPdx0hg4zgsJvjMrHINnWBOpl0H2g587sDqbIddFVVRG9SYQ6uZqm2+ckjLymP0uEvcOfgeXyaLftkqY82EXzYr/ftC9Pwg1t8vI5T2lnVBRpsmfVoeCEA==
  • 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>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 04 Aug 2026 14:27:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2026-08-04 03:53, Jan Beulich wrote:
On 03.08.2026 23:01, Jason Andryuk wrote:
On 2026-07-28 09:22, Jan Beulich wrote:
--- 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.

And in that case we want to make sure that current->domain may enable Argo
for d.

It's not a hook for current to enable for d, but more of a hook "is d allowed to use argo."

In the hypercall entry path, it use is clear - "is this domain allowed to make argo hypercalls."

In argo_init(), it is more of an optimization. Only initialize if d is allowed to use argo. I think this use is questionable, but it is the current code.

In flask, the source is d, the target is xen_t:
    allow domain_type xen_t:argo enable

So it is not an operation between domains.

   }
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);

There being just a single call puts this on the edge. If there was another
one not passing current->domain, I think the same argument as above would
hold here. And the general concept is what I think should matter when
writing the dummy implementations.

For flask, we have xen as the target again:
    allow domain_type xen_t:argo register_any_source;

... since a wildcard ring doesn't have a known target domain.

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, but no - unless I misunderstand how permissions are intended to
work here, I don't think I can make the changes requested, and hence I
can't apply the R-b.
Understandable.

It seems to me that the XSM hooks have two styles. Either implicit args (using current) or explicit args. Today, the argo hooks take explicit like the grant hooks for instance.

Regards,
Jason



 


Rackspace

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