XSM: make XSM hooks well-formed ones

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.

flask_do_xsm_op() is also changed to return int, as all the function ever
returns is an int. This way no new machinery needs adding to xsm/hooks.h.
Instead one piece of compat machinery can then be dropped from
xsm/flask/flask_op.c.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
This commit is contained in:
Jan Beulich committed 2026-08-17 09:23:57 +02:00
1 parent 7f659ae00a
commit 5e2bbb53f5
8 files changed
+12 -38

No files matched your search

+1 -1
View File
@@ -439,7 +439,7 @@ static XSM_INLINE int xsm_hypfs_op(XSM_DEFAULT_VOID)
#ifdef CONFIG_XSM
static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
static XSM_INLINE int xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
{
return -ENOSYS;
}
+5
View File
@@ -154,6 +154,11 @@ XSM_HOOK(int, dm_op, struct domain *)
XSM_HOOK(int, xen_version, uint32_t)
XSM_HOOK(int, domain_resource_map, struct domain *)
XSM_HOOK(int, do_xsm_op, XEN_GUEST_HANDLE_PARAM(void))
#ifdef CONFIG_COMPAT
XSM_HOOK(int, do_compat_op, XEN_GUEST_HANDLE_PARAM(void))
#endif
#undef XSM_HOOK0
#undef XSM_HOOK1
#undef XSM_HOOK2
-17
View File
@@ -86,11 +86,6 @@ struct xsm_ops {
char *(*show_irq_sid)(int irq);
long (*do_xsm_op)(XEN_GUEST_HANDLE_PARAM(void) op);
#ifdef CONFIG_COMPAT
int (*do_compat_op)(XEN_GUEST_HANDLE_PARAM(void) op);
#endif
#ifdef CONFIG_ARGO
int (*argo_enable)(const struct domain *d);
int (*argo_register_single_source)(const struct domain *d,
@@ -201,18 +196,6 @@ static inline char *xsm_show_irq_sid(int irq)
return alternative_call(xsm_ops.show_irq_sid, irq);
}
static inline long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
{
return alternative_call(xsm_ops.do_xsm_op, op);
}
#ifdef CONFIG_COMPAT
static inline int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
{
return alternative_call(xsm_ops.do_compat_op, op);
}
#endif
#ifdef CONFIG_ARGO
static inline int xsm_argo_enable(const struct domain *d)
{
-5
View File
@@ -36,11 +36,6 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops = {
.show_irq_sid = xsm_show_irq_sid,
.do_xsm_op = xsm_do_xsm_op,
#ifdef CONFIG_COMPAT
.do_compat_op = xsm_do_compat_op,
#endif
#ifdef CONFIG_ARGO
.argo_enable = xsm_argo_enable,
.argo_register_single_source = xsm_argo_register_single_source,
+2 -5
View File
@@ -23,7 +23,6 @@
#include <conditional.h>
#include "private.h"
#define ret_t long
#define _copy_to_guest copy_to_guest
#define _copy_from_guest copy_from_guest
@@ -606,7 +605,7 @@ static int flask_relabel_domain(const struct xen_flask_relabel *arg)
#endif /* !COMPAT */
ret_t cf_check do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op)
int cf_check flask_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op)
{
xen_flask_op_t op;
int rv;
@@ -772,9 +771,7 @@ CHECK_flask_transition;
#define flask_devicetree_label compat_devicetree_label
#define xen_flask_op_t compat_flask_op_t
#undef ret_t
#define ret_t int
#define do_flask_op compat_flask_op
#define flask_do_xsm_op flask_do_compat_op
#include "flask_op.c"
#endif
-6
View File
@@ -1969,12 +1969,6 @@ static const struct xsm_ops __initconst_cf_clobber flask_ops = {
.show_irq_sid = flask_show_irq_sid,
.do_xsm_op = do_flask_op,
#ifdef CONFIG_COMPAT
.do_compat_op = compat_flask_op,
#endif
#ifdef CONFIG_ARGO
.argo_enable = flask_argo_enable,
.argo_register_single_source = flask_argo_register_single_source,
+2 -2
View File
@@ -3,7 +3,7 @@
#include <public/xen.h>
long cf_check do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
int cf_check compat_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
int cf_check flask_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
int cf_check flask_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
#endif /* XSM_FLASK_PRIVATE */
+2 -2
View File
@@ -216,12 +216,12 @@ bool __init has_xsm_magic(paddr_t start)
long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
{
return xsm_do_xsm_op(op);
return xsm_do_xsm_op(XSM_HOOK, op);
}
#ifdef CONFIG_COMPAT
int compat_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
{
return xsm_do_compat_op(op);
return xsm_do_compat_op(XSM_HOOK, op);
}
#endif
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.