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: 7ef0084418 ("x86/spinlock: introduce support for blocking speculation into critical regions")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Andrew Cooper committed 2024-04-11 13:23:08 +01:00
1 parent d0a718a45f
commit 52bde26c1c
1 file changed
+2 -1
+2 -1
View File
@@ -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 */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.