When CONFIG_SPECULATIVE_HARDEN_LOCK is active, this reads: static always_inline bool lock_evaluate_nospec(bool condition) { return arch_lock_evaluate_nospec(condition); return condition; }
Insert an #else to take out the second return. Fixes: 7ef0084418e1 ("x86/spinlock: introduce support for blocking speculation into critical regions") Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> --- CC: Jan Beulich <jbeul...@suse.com> CC: Roger Pau Monné <roger....@citrix.com> CC: Stefano Stabellini <sstabell...@kernel.org> CC: consult...@bugseng.com <consult...@bugseng.com> CC: Roberto Bagnara <roberto.bagn...@bugseng.com> CC: Federico Serafini <federico.seraf...@bugseng.com> CC: Nicola Vetrini <nicola.vetr...@bugseng.com> --- xen/include/xen/nospec.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/include/xen/nospec.h b/xen/include/xen/nospec.h index 9fb15aa26aa9..828dbd4e0ad8 100644 --- a/xen/include/xen/nospec.h +++ b/xen/include/xen/nospec.h @@ -82,8 +82,9 @@ static always_inline bool lock_evaluate_nospec(bool condition) { #ifdef CONFIG_SPECULATIVE_HARDEN_LOCK return arch_lock_evaluate_nospec(condition); -#endif +#else return condition; +#endif } #endif /* XEN_NOSPEC_H */ base-commit: 0e7ea8ca5fc9bce9248414f6aaf2dc861abd45d9 -- 2.30.2