From c36ddba28e314e9350f4024972023b52e34ec73e Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Fri, 12 Dec 2025 20:14:56 +0000 Subject: [PATCH] x86: Address MIRSA R8.4 (declaration visibility) issues set_guest_*_trapbounce() are only called from assembly so gain asmlinkage to identify them. xen_msr_s_cet_value() is called by assembly and C, so asmlinkage isn't appropriate. Make the declaration unconditional, which silences the complaint. No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/pv/traps.c | 4 ++-- xen/arch/x86/setup.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c index c3c0976c44..26a468108a 100644 --- a/xen/arch/x86/pv/traps.c +++ b/xen/arch/x86/pv/traps.c @@ -99,7 +99,7 @@ void pv_inject_event(const struct x86_event *event) * Called from asm to set up the MCE trapbounce info. * Returns false no callback is set up, else true. */ -bool set_guest_machinecheck_trapbounce(void) +bool asmlinkage set_guest_machinecheck_trapbounce(void) { struct vcpu *curr = current; struct trap_bounce *tb = &curr->arch.pv.trap_bounce; @@ -114,7 +114,7 @@ bool set_guest_machinecheck_trapbounce(void) * Called from asm to set up the NMI trapbounce info. * Returns false if no callback is set up, else true. */ -bool set_guest_nmi_trapbounce(void) +bool asmlinkage set_guest_nmi_trapbounce(void) { struct vcpu *curr = current; struct trap_bounce *tb = &curr->arch.pv.trap_bounce; diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 44da5efa1d..27c63d1d97 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -877,6 +877,8 @@ static void noreturn init_done(void) startup_cpu_idle_loop(); } +unsigned int xen_msr_s_cet_value(void); /* To avoid ifdefary, and placate MISRA */ + #if defined(CONFIG_XEN_SHSTK) || defined(CONFIG_XEN_IBT) /* * Used by AP and S3 asm code to calcualte the appropriate MSR_S_CET setting. @@ -888,8 +890,6 @@ unsigned int xen_msr_s_cet_value(void) return ((cpu_has_xen_shstk ? CET_SHSTK_EN | CET_WRSS_EN : 0) | (cpu_has_xen_ibt ? CET_ENDBR_EN : 0)); } -#else -unsigned int xen_msr_s_cet_value(void); /* To avoid ifdefary */ #endif /* Reinitalise all state referring to the old virtual address of the stack. */