diff mbox series

x86/mm: use block_lock_speculation() in _mm_write_lock()

Message ID eea85453-32df-4d0e-b6b5-74b2bf16ae1a@suse.com (mailing list archive)
State New, archived
Headers show
Series x86/mm: use block_lock_speculation() in _mm_write_lock() | expand

Commit Message

Jan Beulich March 18, 2024, 10:54 a.m. UTC
I can only guess that using block_speculation() there was a leftover
from, earlier on, SPECULATIVE_HARDEN_LOCK depending on
SPECULATIVE_HARDEN_BRANCH.

Fixes: 197ecd838a2a ("locking: attempt to ensure lock wrappers are always inline")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Noticed while backporting to 4.12, where block_speculation() didn't
exist yet.

Comments

Andrew Cooper March 18, 2024, 12:21 p.m. UTC | #1
On 18/03/2024 10:54 am, Jan Beulich wrote:
> I can only guess that using block_speculation() there was a leftover
> from, earlier on, SPECULATIVE_HARDEN_LOCK depending on
> SPECULATIVE_HARDEN_BRANCH.
>
> Fixes: 197ecd838a2a ("locking: attempt to ensure lock wrappers are always inline")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Yes, it looks that way.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox series

Patch

--- a/xen/arch/x86/mm/mm-locks.h
+++ b/xen/arch/x86/mm/mm-locks.h
@@ -138,7 +138,7 @@  static inline void _mm_write_lock(const struct domain *d, mm_rwlock_t *l,
         _set_lock_level(_lock_level(d, level));
     }
     else
-        block_speculation();
+        block_lock_speculation();
     l->recurse_count++;
 }