|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] 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.
Fixes: 7ef0084418e1 ("x86/spinlock: introduce support for blocking speculation
into critical regions")
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: consulting@xxxxxxxxxxx <consulting@xxxxxxxxxxx>
CC: Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>
CC: Federico Serafini <federico.serafini@xxxxxxxxxxx>
CC: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
---
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |