diff mbox series

[v2,09/10] xsm: expand the function related macros in dummy.h

Message ID 20210712203233.20289-10-dpsmith@apertussolutions.com (mailing list archive)
State Superseded
Headers show
Series xsm: refactoring xsm hooks | expand

Commit Message

Daniel P. Smith July 12, 2021, 8:32 p.m. UTC
With the elimination of switching how dummy.h gets included, the function
declaration macros are no longer necessary. This commit expands them out to the
only value for which they will ever be set. This results in function
declaration lengths changing and since some definitions did not even follow the
80 column wrapping style, all function definitions were aligned with the
predominate style found in core hypervisor code.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/xsm/dummy.h | 275 +++++++++++++++++++++++++++---------------------
 1 file changed, 153 insertions(+), 122 deletions(-)

Comments

Jan Beulich July 16, 2021, 7:34 a.m. UTC | #1
On 12.07.2021 22:32, Daniel P. Smith wrote:
> With the elimination of switching how dummy.h gets included, the function
> declaration macros are no longer necessary. This commit expands them out to the
> only value for which they will ever be set. This results in function
> declaration lengths changing and since some definitions did not even follow the
> 80 column wrapping style, all function definitions were aligned with the
> predominate style found in core hypervisor code.

I'm afraid this last half sentence is quite far from true:

> @@ -82,43 +79,43 @@ static always_inline int xsm_default_action(
>      }
>  }
>  
> -static XSM_INLINE void dummy_security_domaininfo(struct domain *d,
> +static inline void dummy_security_domaininfo(struct domain *d,
>                                      struct xen_domctl_getdomaininfo *info)

Padding wasn't good here before, but you clearly do not change it to
either of the forms we agreed on as being the goal for consistency:

static inline void dummy_security_domaininfo(struct domain *d,
                                             struct xen_domctl_getdomaininfo *info)

or

static inline void dummy_security_domaininfo(
    struct domain *d,
    struct xen_domctl_getdomaininfo *info)

. Further down there are enough other examples.

> -static XSM_INLINE int dummy_domain_create(XSM_DEFAULT_ARG struct domain *d, u32 ssidref)
> +static inline int dummy_domain_create(struct domain *d, u32 ssidref)

When you have to touch lines anyway, may I suggest that you also take
the opportunity and convert u<N> to uint<N>_t, to bring this file
better in line with ./CODING_STYLE?

Jan
Daniel P. Smith July 24, 2021, 8:07 p.m. UTC | #2
On 7/16/21 3:34 AM, Jan Beulich wrote:
> On 12.07.2021 22:32, Daniel P. Smith wrote:
>> With the elimination of switching how dummy.h gets included, the function
>> declaration macros are no longer necessary. This commit expands them out to the
>> only value for which they will ever be set. This results in function
>> declaration lengths changing and since some definitions did not even follow the
>> 80 column wrapping style, all function definitions were aligned with the
>> predominate style found in core hypervisor code.
> 
> I'm afraid this last half sentence is quite far from true:

I would disagree since I know I went through the frustration of trying
to find a discernible consistency in the files in common/ in the end I
settled on following common/memory.c since it seemed to have the most
uniform, it had only a couple of anomalies, as opposed to other files
where indentation was varied throughout.

>> @@ -82,43 +79,43 @@ static always_inline int xsm_default_action(
>>      }
>>  }
>>  
>> -static XSM_INLINE void dummy_security_domaininfo(struct domain *d,
>> +static inline void dummy_security_domaininfo(struct domain *d,
>>                                      struct xen_domctl_getdomaininfo *info)
> 
> Padding wasn't good here before, but you clearly do not change it to
> either of the forms we agreed on as being the goal for consistency:

Then that agreement should be document as CODING_STYLE only states:


Line Length
-----------

Lines should be less than 80 characters in length.  Long lines should
be split at sensible places and the trailing portions indented.


I found that in common/memory.c the predominate style was to align
parameters with the first parameter when wrapping, which is what I
followed. In this specific case when I wrapped the second parameter to
make the line less than 80 chars (an explicit rule in CODING_STYLE) and
attempted to align with the first paramter resulted in the line
exceeding 80 chars. Since the only hard rule is lines must be less than
80, I decreased the indent by enough characters for the line to be less
than 80 to be in line with CODING_STYLE since it only calls for sensible
splits that are indented.

> static inline void dummy_security_domaininfo(struct domain *d,
>                                              struct xen_domctl_getdomaininfo *info)
> 
> or
> 
> static inline void dummy_security_domaininfo(
>     struct domain *d,
>     struct xen_domctl_getdomaininfo *info)
> 

I will align to the second, even though I find it annoying to switch
alignment styles, since the first would be in violation of CODING_STYLE
sine the second line would exceed 80 chars

>> -static XSM_INLINE int dummy_domain_create(XSM_DEFAULT_ARG struct domain *d, u32 ssidref)
>> +static inline int dummy_domain_create(struct domain *d, u32 ssidref)
> 
> When you have to touch lines anyway, may I suggest that you also take
> the opportunity and convert u<N> to uint<N>_t, to bring this file
> better in line with ./CODING_STYLE?

Sure.

v/r,
dps
Daniel P. Smith July 24, 2021, 8:43 p.m. UTC | #3
On 7/24/21 4:07 PM, Daniel P. Smith wrote:
> On 7/16/21 3:34 AM, Jan Beulich wrote:
>> On 12.07.2021 22:32, Daniel P. Smith wrote:
>>> With the elimination of switching how dummy.h gets included, the function
>>> declaration macros are no longer necessary. This commit expands them out to the
>>> only value for which they will ever be set. This results in function
>>> declaration lengths changing and since some definitions did not even follow the
>>> 80 column wrapping style, all function definitions were aligned with the
>>> predominate style found in core hypervisor code.
>>
>> I'm afraid this last half sentence is quite far from true:
> 
> I would disagree since I know I went through the frustration of trying
> to find a discernible consistency in the files in common/ in the end I
> settled on following common/memory.c since it seemed to have the most
> uniform, it had only a couple of anomalies, as opposed to other files
> where indentation was varied throughout.
> 

Going back into the patch I found what happened. I am not sure how, but
every parameter line I wrapped had 7 additional spaces. This has been
corrected.

v/r
dps
Jan Beulich Aug. 3, 2021, 7:23 a.m. UTC | #4
On 24.07.2021 22:07, Daniel P. Smith wrote:
> On 7/16/21 3:34 AM, Jan Beulich wrote:
>> On 12.07.2021 22:32, Daniel P. Smith wrote:
>>> With the elimination of switching how dummy.h gets included, the function
>>> declaration macros are no longer necessary. This commit expands them out to the
>>> only value for which they will ever be set. This results in function
>>> declaration lengths changing and since some definitions did not even follow the
>>> 80 column wrapping style, all function definitions were aligned with the
>>> predominate style found in core hypervisor code.
>>
>> I'm afraid this last half sentence is quite far from true:
> 
> I would disagree since I know I went through the frustration of trying
> to find a discernible consistency in the files in common/ in the end I
> settled on following common/memory.c since it seemed to have the most
> uniform, it had only a couple of anomalies, as opposed to other files
> where indentation was varied throughout.
> 
>>> @@ -82,43 +79,43 @@ static always_inline int xsm_default_action(
>>>      }
>>>  }
>>>  
>>> -static XSM_INLINE void dummy_security_domaininfo(struct domain *d,
>>> +static inline void dummy_security_domaininfo(struct domain *d,
>>>                                      struct xen_domctl_getdomaininfo *info)
>>
>> Padding wasn't good here before, but you clearly do not change it to
>> either of the forms we agreed on as being the goal for consistency:
> 
> Then that agreement should be document as CODING_STYLE only states:
> 
> 
> Line Length
> -----------
> 
> Lines should be less than 80 characters in length.  Long lines should
> be split at sensible places and the trailing portions indented.
> 
> 
> I found that in common/memory.c the predominate style was to align
> parameters with the first parameter when wrapping, which is what I
> followed. In this specific case when I wrapped the second parameter to
> make the line less than 80 chars (an explicit rule in CODING_STYLE) and
> attempted to align with the first paramter resulted in the line
> exceeding 80 chars. Since the only hard rule is lines must be less than
> 80, I decreased the indent by enough characters for the line to be less
> than 80 to be in line with CODING_STYLE since it only calls for sensible
> splits that are indented.
> 
>> static inline void dummy_security_domaininfo(struct domain *d,
>>                                              struct xen_domctl_getdomaininfo *info)
>>
>> or
>>
>> static inline void dummy_security_domaininfo(
>>     struct domain *d,
>>     struct xen_domctl_getdomaininfo *info)
>>
> 
> I will align to the second, even though I find it annoying to switch
> alignment styles, since the first would be in violation of CODING_STYLE
> sine the second line would exceed 80 chars

I guess you nevertheless realize that this 2nd form is precisely to
overcome the problem with otherwise exceeding the 80 chars limit,
while at the same time making sure the indentation doesn't end up
entirely random then?

As to extending ./CODING_STYLE - I've had rather bad experience
with attempts to do so, with my two most recent patches to that effect
just having had their 2nd anniversary without getting any feedback
moving things forward (despite, unlike in some earlier instances, the
proposed changes not looking overly controversial to me).

Coincidence or not, just a few days after my submission Volodymyr
submitted a patch making an attempt to document function parameter
indentation [1]. While the patch as is had some comments, it didn't
seem like it was controversial either. Yet nothing has since made it
in.

Jan

[1] https://lists.xen.org/archives/html/xen-devel/2019-07/msg02440.html
diff mbox series

Patch

diff --git a/xen/xsm/dummy.h b/xen/xsm/dummy.h
index a3e698c3b5..1cb26e4146 100644
--- a/xen/xsm/dummy.h
+++ b/xen/xsm/dummy.h
@@ -9,7 +9,7 @@ 
  *
  *
  *  Each XSM hook implementing an access check should have its first parameter
- *  preceded by XSM_DEFAULT_ARG (or use XSM_DEFAULT_VOID if it has no
+ *  preceded by (or use XSM_DEFAULT_VOID if it has no
  *  arguments). The first non-declaration statement shold be XSM_ASSERT_ACTION
  *  with the expected type of the hook, which will either define or check the
  *  value of action.
@@ -47,14 +47,11 @@  void __xsm_action_mismatch_detected(void);
  * xsm_default_t argument available, so the value from the assertion is used to
  * initialize the variable.
  */
-#define XSM_INLINE __maybe_unused
-
-#define XSM_DEFAULT_ARG /* */
-#define XSM_DEFAULT_VOID void
 #define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action
 
-static always_inline int xsm_default_action(
-    xsm_default_t action, struct domain *src, struct domain *target)
+static always_inline int xsm_default_action(xsm_default_t action,
+                                            struct domain *src,
+                                            struct domain *target)
 {
     switch ( action ) {
     case XSM_HOOK:
@@ -82,43 +79,43 @@  static always_inline int xsm_default_action(
     }
 }
 
-static XSM_INLINE void dummy_security_domaininfo(struct domain *d,
+static inline void dummy_security_domaininfo(struct domain *d,
                                     struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_INLINE int dummy_domain_create(XSM_DEFAULT_ARG struct domain *d, u32 ssidref)
+static inline int dummy_domain_create(struct domain *d, u32 ssidref)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_getdomaininfo(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_getdomaininfo(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_domctl_scheduler_op(XSM_DEFAULT_ARG struct domain *d, int cmd)
+static inline int dummy_domctl_scheduler_op(struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_sysctl_scheduler_op(XSM_DEFAULT_ARG int cmd)
+static inline int dummy_sysctl_scheduler_op(int cmd)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_set_target(XSM_DEFAULT_ARG struct domain *d, struct domain *e)
+static inline int dummy_set_target(struct domain *d, struct domain *e)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_domctl(XSM_DEFAULT_ARG struct domain *d, int cmd)
+static inline int dummy_domctl(struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
     switch ( cmd )
@@ -135,85 +132,91 @@  static XSM_INLINE int dummy_domctl(XSM_DEFAULT_ARG struct domain *d, int cmd)
     }
 }
 
-static XSM_INLINE int dummy_sysctl(XSM_DEFAULT_ARG int cmd)
+static inline int dummy_sysctl(int cmd)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_readconsole(XSM_DEFAULT_ARG uint32_t clear)
+static inline int dummy_readconsole(uint32_t clear)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_alloc_security_domain(struct domain *d)
+static inline int dummy_alloc_security_domain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE void dummy_free_security_domain(struct domain *d)
+static inline void dummy_free_security_domain(struct domain *d)
 {
     return;
 }
 
-static XSM_INLINE int dummy_grant_mapref(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2,
-                                                                uint32_t flags)
+static inline int dummy_grant_mapref(struct domain *d1,
+                                             struct domain *d2,
+                                             uint32_t flags)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_grant_unmapref(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
+static inline int dummy_grant_unmapref(struct domain *d1,
+                                               struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_grant_setup(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
+static inline int dummy_grant_setup(struct domain *d1,
+                                            struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_grant_transfer(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
+static inline int dummy_grant_transfer(struct domain *d1,
+                                               struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_grant_copy(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
+static inline int dummy_grant_copy(struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_grant_query_size(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
+static inline int dummy_grant_query_size(struct domain *d1,
+                                                 struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_memory_exchange(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_memory_exchange(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_memory_adjust_reservation(XSM_DEFAULT_ARG struct domain *d1,
-                                                            struct domain *d2)
+static inline int dummy_memory_adjust_reservation(struct domain *d1,
+                                                          struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_memory_stat_reservation(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
+static inline int dummy_memory_stat_reservation(struct domain *d1,
+                                                        struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
+static inline int dummy_console_io(struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
     if ( d->is_console )
@@ -225,129 +228,140 @@  static XSM_INLINE int dummy_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd
     return xsm_default_action(XSM_PRIV, d, NULL);
 }
 
-static XSM_INLINE int dummy_profile(XSM_DEFAULT_ARG struct domain *d, int op)
+static inline int dummy_profile(struct domain *d, int op)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int dummy_kexec(XSM_DEFAULT_VOID)
+static inline int dummy_kexec(void)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_schedop_shutdown(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
+static inline int dummy_schedop_shutdown(struct domain *d1,
+                                                 struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_memory_pin_page(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2,
-                                          struct page_info *page)
+static inline int dummy_memory_pin_page(struct domain *d1,
+                                                struct domain *d2,
+                                                struct page_info *page)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_claim_pages(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_claim_pages(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_evtchn_unbound(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn,
-                                         domid_t id2)
+static inline int dummy_evtchn_unbound(struct domain *d,
+                                               struct evtchn *chn,
+                                               domid_t id2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_evtchn_interdomain(XSM_DEFAULT_ARG struct domain *d1, struct evtchn
-                                *chan1, struct domain *d2, struct evtchn *chan2)
+static inline int dummy_evtchn_interdomain(struct domain *d1,
+                                                   struct evtchn *chan1,
+                                                   struct domain *d2,
+                                                   struct evtchn *chan2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE void dummy_evtchn_close_post(struct evtchn *chn)
+static inline void dummy_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_INLINE int dummy_evtchn_send(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
+static inline int dummy_evtchn_send(struct domain *d,
+                                            struct evtchn *chn)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int dummy_evtchn_status(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
+static inline int dummy_evtchn_status(struct domain *d,
+                                              struct evtchn *chn)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_evtchn_reset(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
+static inline int dummy_evtchn_reset(struct domain *d1,
+                                             struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_alloc_security_evtchns(
-    struct evtchn chn[], unsigned int nr)
+static inline int dummy_alloc_security_evtchns(struct evtchn chn[],
+                                                       unsigned int nr)
 {
     return 0;
 }
 
-static XSM_INLINE void dummy_free_security_evtchns(
-    struct evtchn chn[], unsigned int nr)
+static inline void dummy_free_security_evtchns(struct evtchn chn[],
+                                                       unsigned int nr)
 {
     return;
 }
 
-static XSM_INLINE char *dummy_show_security_evtchn(struct domain *d, const struct evtchn *chn)
+static inline char *dummy_show_security_evtchn(struct domain *d,
+                                                       const struct evtchn *chn)
 {
     return NULL;
 }
 
-static XSM_INLINE int dummy_init_hardware_domain(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_init_hardware_domain(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_get_pod_target(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_get_pod_target(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_set_pod_target(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_set_pod_target(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_get_vnumainfo(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_get_vnumainfo(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-static XSM_INLINE int dummy_get_device_group(XSM_DEFAULT_ARG uint32_t machine_bdf)
+static inline int dummy_get_device_group(uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_assign_device(XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf)
+static inline int dummy_assign_device(struct domain *d,
+                                              uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_deassign_device(XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf)
+static inline int dummy_deassign_device(struct domain *d,
+                                                uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
@@ -356,15 +370,15 @@  static XSM_INLINE int dummy_deassign_device(XSM_DEFAULT_ARG struct domain *d, ui
 #endif /* HAS_PASSTHROUGH && HAS_PCI */
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
-static XSM_INLINE int dummy_assign_dtdevice(XSM_DEFAULT_ARG struct domain *d,
-                                          const char *dtpath)
+static inline int dummy_assign_dtdevice(struct domain *d,
+                                                const char *dtpath)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_deassign_dtdevice(XSM_DEFAULT_ARG struct domain *d,
-                                            const char *dtpath)
+static inline int dummy_deassign_dtdevice(struct domain *d,
+                                                  const char *dtpath)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
@@ -372,178 +386,190 @@  static XSM_INLINE int dummy_deassign_dtdevice(XSM_DEFAULT_ARG struct domain *d,
 
 #endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE */
 
-static XSM_INLINE int dummy_resource_plug_core(XSM_DEFAULT_VOID)
+static inline int dummy_resource_plug_core(void)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_resource_unplug_core(XSM_DEFAULT_VOID)
+static inline int dummy_resource_unplug_core(void)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_resource_plug_pci(XSM_DEFAULT_ARG uint32_t machine_bdf)
+static inline int dummy_resource_plug_pci(uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_resource_unplug_pci(XSM_DEFAULT_ARG uint32_t machine_bdf)
+static inline int dummy_resource_unplug_pci(uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_resource_setup_pci(XSM_DEFAULT_ARG uint32_t machine_bdf)
+static inline int dummy_resource_setup_pci(uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
+static inline int dummy_resource_setup_gsi(int gsi)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_resource_setup_misc(XSM_DEFAULT_VOID)
+static inline int dummy_resource_setup_misc(void)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_page_offline(XSM_DEFAULT_ARG uint32_t cmd)
+static inline int dummy_page_offline(uint32_t cmd)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_hypfs_op(XSM_DEFAULT_VOID)
+static inline int dummy_hypfs_op(void)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE long dummy_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+static inline long dummy_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
 }
 
 #ifdef CONFIG_COMPAT
-static XSM_INLINE int dummy_do_compat_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
+static inline int dummy_do_compat_op(
+                                XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)
 {
     return -ENOSYS;
 }
 #endif
 
-static XSM_INLINE char *dummy_show_irq_sid(int irq)
+static inline char *dummy_show_irq_sid(int irq)
 {
     return NULL;
 }
 
-static XSM_INLINE int dummy_map_domain_pirq(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_map_domain_pirq(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_map_domain_irq(XSM_DEFAULT_ARG struct domain *d,
-                                         int irq, const void *data)
+static inline int dummy_map_domain_irq(struct domain *d, int irq,
+                                               const void *data)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_unmap_domain_pirq(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_unmap_domain_pirq(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_bind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static inline int dummy_bind_pt_irq(struct domain *d,
+                                            struct xen_domctl_bind_pt_irq *bind)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_unbind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+static inline int dummy_unbind_pt_irq(struct domain *d,
+                                        struct xen_domctl_bind_pt_irq *bind)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_unmap_domain_irq(XSM_DEFAULT_ARG struct domain *d,
-                                           int irq, const void *data)
+static inline int dummy_unmap_domain_irq(struct domain *d, int irq,
+                                                 const void *data)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_irq_permission(XSM_DEFAULT_ARG struct domain *d, int pirq, uint8_t allow)
+static inline int dummy_irq_permission(struct domain *d, int pirq,
+                                               uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_iomem_permission(XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int dummy_iomem_permission(struct domain *d, uint64_t s,
+                                                 uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_iomem_mapping(XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+static inline int dummy_iomem_mapping(struct domain *d, uint64_t s,
+                                              uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_pci_config_permission(XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf,
-                                        uint16_t start, uint16_t end,
-                                        uint8_t access)
+static inline int dummy_pci_config_permission(struct domain *d,
+                                                      uint32_t machine_bdf,
+                                                      uint16_t start,
+                                                      uint16_t end,
+                                                      uint8_t access)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_add_to_physmap(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
+static inline int dummy_add_to_physmap(struct domain *d1,
+                                               struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_remove_from_physmap(XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
+static inline int dummy_remove_from_physmap(struct domain *d1,
+                                                    struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int dummy_map_gmfn_foreign(XSM_DEFAULT_ARG struct domain *d, struct domain *t)
+static inline int dummy_map_gmfn_foreign(struct domain *d,
+                                                 struct domain *t)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d, t);
 }
 
-static XSM_INLINE int dummy_hvm_param(XSM_DEFAULT_ARG struct domain *d, unsigned long op)
+static inline int dummy_hvm_param(struct domain *d, unsigned long op)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_hvm_control(XSM_DEFAULT_ARG struct domain *d, unsigned long op)
+static inline int dummy_hvm_control(struct domain *d, unsigned long op)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_hvm_param_altp2mhvm(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_hvm_param_altp2mhvm(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_hvm_altp2mhvm_op(XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op)
+static inline int dummy_hvm_altp2mhvm_op(struct domain *d,
+                                                 uint64_t mode, uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
 
@@ -562,14 +588,15 @@  static XSM_INLINE int dummy_hvm_altp2mhvm_op(XSM_DEFAULT_ARG struct domain *d, u
     }
 }
 
-static XSM_INLINE int dummy_vm_event_control(XSM_DEFAULT_ARG struct domain *d, int mode, int op)
+static inline int dummy_vm_event_control(struct domain *d, int mode,
+                                                 int op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
 #ifdef CONFIG_MEM_ACCESS
-static XSM_INLINE int dummy_mem_access(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_mem_access(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -577,7 +604,7 @@  static XSM_INLINE int dummy_mem_access(XSM_DEFAULT_ARG struct domain *d)
 #endif
 
 #ifdef CONFIG_MEM_PAGING
-static XSM_INLINE int dummy_mem_paging(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_mem_paging(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -585,58 +612,59 @@  static XSM_INLINE int dummy_mem_paging(XSM_DEFAULT_ARG struct domain *d)
 #endif
 
 #ifdef CONFIG_MEM_SHARING
-static XSM_INLINE int dummy_mem_sharing(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_mem_sharing(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 #endif
 
-static XSM_INLINE int dummy_platform_op(XSM_DEFAULT_ARG uint32_t op)
+static inline int dummy_platform_op(uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
 #ifdef CONFIG_X86
-static XSM_INLINE int dummy_do_mca(XSM_DEFAULT_VOID)
+static inline int dummy_do_mca(void)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_shadow_control(XSM_DEFAULT_ARG struct domain *d, uint32_t op)
+static inline int dummy_shadow_control(struct domain *d, uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_mem_sharing_op(XSM_DEFAULT_ARG struct domain *d, struct domain *cd, int op)
+static inline int dummy_mem_sharing_op(struct domain *d,
+                                               struct domain *cd, int op)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, cd);
 }
 
-static XSM_INLINE int dummy_apic(XSM_DEFAULT_ARG struct domain *d, int cmd)
+static inline int dummy_apic(struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int dummy_machine_memory_map(XSM_DEFAULT_VOID)
+static inline int dummy_machine_memory_map(void)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int dummy_domain_memory_map(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_domain_memory_map(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_mmu_update(XSM_DEFAULT_ARG struct domain *d, struct domain *t,
-                                     struct domain *f, uint32_t flags)
+static inline int dummy_mmu_update(struct domain *d, struct domain *t,
+                                           struct domain *f, uint32_t flags)
 {
     int rc = 0;
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -647,38 +675,41 @@  static XSM_INLINE int dummy_mmu_update(XSM_DEFAULT_ARG struct domain *d, struct
     return rc;
 }
 
-static XSM_INLINE int dummy_mmuext_op(XSM_DEFAULT_ARG struct domain *d, struct domain *f)
+static inline int dummy_mmuext_op(struct domain *d, struct domain *f)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int dummy_update_va_mapping(XSM_DEFAULT_ARG struct domain *d, struct domain *f,
-                                                            l1_pgentry_t pte)
+static inline int dummy_update_va_mapping(struct domain *d,
+                                                  struct domain *f,
+                                                  l1_pgentry_t pte)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int dummy_priv_mapping(XSM_DEFAULT_ARG struct domain *d, struct domain *t)
+static inline int dummy_priv_mapping(struct domain *d, struct domain *t)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d, t);
 }
 
-static XSM_INLINE int dummy_ioport_permission(XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int dummy_ioport_permission(struct domain *d, uint32_t s,
+                                                  uint32_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_ioport_mapping(XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+static inline int dummy_ioport_mapping(struct domain *d, uint32_t s,
+                                               uint32_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int dummy_pmu_op (XSM_DEFAULT_ARG struct domain *d, unsigned int op)
+static inline int dummy_pmu_op (struct domain *d, unsigned int op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
     switch ( op )
@@ -695,31 +726,31 @@  static XSM_INLINE int dummy_pmu_op (XSM_DEFAULT_ARG struct domain *d, unsigned i
 
 #endif /* CONFIG_X86 */
 
-static XSM_INLINE int dummy_dm_op(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_dm_op(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
 #ifdef CONFIG_ARGO
-static XSM_INLINE int dummy_argo_enable(const struct domain *d)
+static inline int dummy_argo_enable(const struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int dummy_argo_register_single_source(const struct domain *d,
-                                                      const struct domain *t)
+static inline int dummy_argo_register_single_source(const struct domain *d,
+                                                            const struct domain *t)
 {
     return 0;
 }
 
-static XSM_INLINE int dummy_argo_register_any_source(const struct domain *d)
+static inline int dummy_argo_register_any_source(const struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int dummy_argo_send(const struct domain *d,
-                                    const struct domain *t)
+static inline int dummy_argo_send(const struct domain *d,
+                                          const struct domain *t)
 {
     return 0;
 }
@@ -727,7 +758,7 @@  static XSM_INLINE int dummy_argo_send(const struct domain *d,
 #endif /* CONFIG_ARGO */
 
 #include <public/version.h>
-static XSM_INLINE int dummy_xen_version (XSM_DEFAULT_ARG uint32_t op)
+static inline int dummy_xen_version(uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
     switch ( op )
@@ -751,7 +782,7 @@  static XSM_INLINE int dummy_xen_version (XSM_DEFAULT_ARG uint32_t op)
     }
 }
 
-static XSM_INLINE int dummy_domain_resource_map(XSM_DEFAULT_ARG struct domain *d)
+static inline int dummy_domain_resource_map(struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);