xen/nospec: Remove unreachable code
PATCH 1/1 xen/nospec: Remove unreachable code
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.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: [email protected] <[email protected]>
CC: Roberto Bagnara <[email protected]>
CC: Federico Serafini <[email protected]>
CC: Nicola Vetrini <[email protected]>
--- xen/include/xen/nospec.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
xen/include/xen/nospec.h +2 -1
@@ -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
Signature · 1 line
2.30.2
Quoted 10 lines · Andrew Cooper
When
CONFIG_SPECULATIVE_HARDEN_LOCKis active, this reads:static
always_inlineboollock_evaluate_nospec(bool condition){ return arch_lock_evaluate_nospec(condition); return condition;
Quoted 7 lines
}
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 <[email protected]>---
Quoted 8 lines · Andrew Cooper
When
CONFIG_SPECULATIVE_HARDEN_LOCKis active, this reads:static always_inline bool lock_evaluate_nospec(bool condition) { return arch_lock_evaluate_nospec(condition); return condition; }
Quoted 4 lines
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 <[email protected]>