All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Daniel P. Smith" <dpsmith@apertussolutions.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 09/11] silo: remove circular xsm hook call
Date: Thu, 9 Sep 2021 17:45:29 +0200	[thread overview]
Message-ID: <8d7824e1-3c7d-c0c5-f3ad-0644d4c49e07@suse.com> (raw)
In-Reply-To: <20210903190629.11917-10-dpsmith@apertussolutions.com>

On 03.09.2021 21:06, Daniel P. Smith wrote:
> SILO implements a few XSM hooks to extended the decision logic beyond
> what is defined in the dummy/default policy. For each of the hooks, it
> falls back to the dummy/default policy. The fall back is done a slight
> round-about way. This commit makes the direct call to the default policy's
> logic, xsm_default_action().

Again it's not clear to me what you're finding wrong here. The way it's
done is not as direct as it could be, but going through the extra layer
allows the functions to document things at the same time. You lose not
only that documentation, but also ...

> @@ -43,7 +44,7 @@ static int silo_evtchn_unbound(struct domain *d1, struct evtchn *chn,
>      else
>      {
>          if ( silo_mode_dom_check(d1, d2) )
> -            rc = xsm_evtchn_unbound(d1, chn, id2);
> +            rc = xsm_default_action(XSM_TARGET, current->domain, d1);

... will need to sync changes to the dummy xsm_evtchn_unbound(), no
matter how unlikely such may be, back to here. This would be quite
easy to forget.

But maybe I'm overlooking something where how things are really gets in
the way of something you mean to do in the remaining two patches (or
later)?

>  static int silo_grant_copy(struct domain *d1, struct domain *d2)
>  {
>      if ( silo_mode_dom_check(d1, d2) )
> -        return xsm_grant_copy(d1, d2);
> +        return xsm_default_action(XSM_HOOK, d1, d2);
>      return -EPERM;
>  }
>  
> @@ -86,14 +87,14 @@ 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 0;
>      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 0;
>      return -EPERM;
>  }

This would then also avoid introducing the anomaly observed by Andrew here.
And in fact the Argo dummy functions may be a good example where a change
might happen down the road - them being all empty doesn't seem quite right
to me.

Jan



  parent reply	other threads:[~2021-09-09 15:45 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 19:06 [PATCH v4 00/11] xsm: refactoring xsm hooks Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 01/11] xen: Implement xen/alternative-call.h for use in common code Daniel P. Smith
2021-09-06 15:52   ` Jan Beulich
2021-09-06 16:22     ` Andrew Cooper
2021-09-07  6:00       ` Jan Beulich
2021-09-07 13:07         ` Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 02/11] xsm: remove the ability to disable flask Daniel P. Smith
2021-09-06 17:56   ` Andrew Cooper
2021-09-03 19:06 ` [PATCH v4 03/11] xsm: drop dubious xsm_op_t type Daniel P. Smith
2021-09-06 18:00   ` Andrew Cooper
2021-09-03 19:06 ` [PATCH v4 04/11] xsm: apply coding style Daniel P. Smith
2021-09-06 18:17   ` Andrew Cooper
2021-09-07 13:41     ` Daniel P. Smith
2021-09-07 13:50       ` Jan Beulich
2021-09-07 14:09         ` Daniel P. Smith
2021-09-07 14:27           ` Jan Beulich
2021-09-07 14:55             ` Daniel P. Smith
2021-09-07 15:01               ` Jan Beulich
2021-09-03 19:06 ` [PATCH v4 05/11] xsm: refactor xsm_ops handling Daniel P. Smith
2021-09-06 18:31   ` Andrew Cooper
2021-09-07 13:44     ` Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 06/11] xsm: convert xsm_ops hook calls to alternative call Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 07/11] xsm: decouple xsm header inclusion selection Daniel P. Smith
2021-09-06 18:47   ` Andrew Cooper
2021-09-07 13:52     ` Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 08/11] xsm: drop generic event channel labeling exclusion Daniel P. Smith
2021-09-09 15:35   ` Jan Beulich
2021-09-09 16:44     ` Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 09/11] silo: remove circular xsm hook call Daniel P. Smith
2021-09-06 18:55   ` Andrew Cooper
2021-09-07 14:00     ` Daniel P. Smith
2021-09-09 15:45   ` Jan Beulich [this message]
2021-09-09 19:14     ` Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 10/11] kconfig: update xsm config to reflect reality Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 11/11] xsm: remove alternate xsm hook interface Daniel P. Smith
2021-09-06 19:18   ` Andrew Cooper
2021-09-07 14:03     ` Daniel P. Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d7824e1-3c7d-c0c5-f3ad-0644d4c49e07@suse.com \
    --to=jbeulich@suse.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=dpsmith@apertussolutions.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.