From 29df230854b5775f845127360d6c1b0de86b51eb Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 3 Aug 2026 16:36:13 +0200 Subject: [PATCH] XSM: make .hvm_param*() hooks dependent upon HVM=y They're unreachable / dead otherwise. Signed-off-by: Jan Beulich Acked-by: Daniel P. Smith --- xen/include/xsm/dummy.h | 4 ++++ xen/include/xsm/hooks.h | 2 ++ xen/xsm/flask/hooks.c | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 47a704c01e..773666a778 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -569,6 +569,8 @@ static XSM_INLINE int cf_check xsm_map_gmfn_foreign( return xsm_default_action(action, d, t); } +#ifdef CONFIG_HVM + static XSM_INLINE int cf_check xsm_hvm_param( XSM_DEFAULT_ARG struct domain *d, unsigned long op) { @@ -583,6 +585,8 @@ static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm( return xsm_default_action(action, current->domain, d); } +#endif /* CONFIG_HVM */ + #ifdef CONFIG_ALTP2M static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op( XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op) diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h index 117640f95b..54e91497b8 100644 --- a/xen/include/xsm/hooks.h +++ b/xen/include/xsm/hooks.h @@ -104,8 +104,10 @@ XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t, XSM_HOOK(int, hypfs_op) #endif +#ifdef CONFIG_HVM XSM_HOOK(int, hvm_param, struct domain *, unsigned long) XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *) +#endif #ifdef CONFIG_ALTP2M XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t) diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 789e815377..2e27dc2b8a 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1368,6 +1368,8 @@ static int cf_check flask_map_gmfn_foreign(struct domain *d, struct domain *t) return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE); } +#ifdef CONFIG_HVM + static int cf_check flask_hvm_param(struct domain *d, unsigned long op) { uint32_t perm; @@ -1393,6 +1395,8 @@ static int cf_check flask_hvm_param_altp2mhvm(struct domain *d) return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM); } +#endif /* CONFIG_HVM */ + #ifdef CONFIG_ALTP2M static int cf_check flask_hvm_altp2mhvm_op(struct domain *d, uint64_t mode, uint32_t op) {