From 430673b8455ea56f533991f52abcbea721843482 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 3 Aug 2026 16:35:12 +0200 Subject: [PATCH] XSM: make .kexec() hook dependent upon KEXEC=y It's unreachable / dead otherwise. Signed-off-by: Jan Beulich Acked-by: Daniel P. Smith --- xen/include/xsm/dummy.h | 2 ++ xen/include/xsm/hooks.h | 2 ++ xen/xsm/flask/hooks.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 7cedad01eb..4fe12f3c85 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -271,11 +271,13 @@ static XSM_INLINE int cf_check xsm_console_io( return xsm_default_action(XSM_PRIV, d, NULL); } +#ifdef CONFIG_KEXEC static XSM_INLINE int cf_check xsm_kexec(XSM_DEFAULT_VOID) { XSM_ASSERT_ACTION(XSM_PRIV); return xsm_default_action(action, current->domain, NULL); } +#endif static XSM_INLINE int cf_check xsm_schedop_shutdown( XSM_DEFAULT_ARG struct domain *d1, struct domain *d2) diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h index e85c035f66..41c12c9306 100644 --- a/xen/include/xsm/hooks.h +++ b/xen/include/xsm/hooks.h @@ -61,7 +61,9 @@ XSM_HOOK(int, claim_pages, struct domain *) XSM_HOOK(int, console_io, struct domain *, int) +#ifdef CONFIG_KEXEC XSM_HOOK(int, kexec) +#endif XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *) diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 8b1834ca0a..1656ac8f3c 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -536,10 +536,12 @@ static int cf_check flask_console_io(struct domain *d, int cmd) return domain_has_xen(d, perm); } +#ifdef CONFIG_KEXEC static int cf_check flask_kexec(void) { return domain_has_xen(current->domain, XEN__KEXEC); } +#endif static int cf_check flask_schedop_shutdown(struct domain *d1, struct domain *d2) {