Changeset 234648 in webkit


Ignore:
Timestamp:
Aug 7, 2018 5:50:23 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Hardcoded LFENCE instruction
https://bugs.webkit.org/show_bug.cgi?id=188145

Patch by Karo Gyoker <karogyoker2+webkit@gmail.com> on 2018-08-07
Reviewed by Filip Pizlo.

Remove lfence instruction because it is crashing systems without SSE2 and
this is not the way how WebKit mitigates Spectre.

Source/JavaScriptCore:

  • runtime/JSLock.cpp:

(JSC::JSLock::didAcquireLock):
(JSC::JSLock::willReleaseLock):

Source/WTF:

  • wtf/Atomics.h:

(WTF::crossModifyingCodeFence):
(WTF::speculationFence): Deleted.
(WTF::x86_lfence): Deleted.

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r234580 r234648  
     12018-08-07  Karo Gyoker  <karogyoker2+webkit@gmail.com>
     2
     3        Hardcoded LFENCE instruction
     4        https://bugs.webkit.org/show_bug.cgi?id=188145
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Remove lfence instruction because it is crashing systems without SSE2 and
     9        this is not the way how WebKit mitigates Spectre.
     10
     11        * runtime/JSLock.cpp:
     12        (JSC::JSLock::didAcquireLock):
     13        (JSC::JSLock::willReleaseLock):
     14
    1152018-08-04  David Kilzer  <ddkilzer@apple.com>
    216
  • trunk/Source/JavaScriptCore/runtime/JSLock.cpp

    r232998 r234648  
    123123
    124124void JSLock::didAcquireLock()
    125 {
    126     WTF::speculationFence();
    127    
     125
    128126    // FIXME: What should happen to the per-thread identifier table if we don't have a VM?
    129127    if (!m_vm)
     
    193191
    194192void JSLock::willReleaseLock()
    195 {
    196     WTF::speculationFence();
    197    
     193{   
    198194    RefPtr<VM> vm = m_vm;
    199195    if (vm) {
  • trunk/Source/WTF/ChangeLog

    r234646 r234648  
     12018-08-07  Karo Gyoker  <karogyoker2+webkit@gmail.com>
     2
     3        Hardcoded LFENCE instruction
     4        https://bugs.webkit.org/show_bug.cgi?id=188145
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Remove lfence instruction because it is crashing systems without SSE2 and
     9        this is not the way how WebKit mitigates Spectre.
     10
     11        * wtf/Atomics.h:
     12        (WTF::crossModifyingCodeFence):
     13        (WTF::speculationFence): Deleted.
     14        (WTF::x86_lfence): Deleted.
     15
    1162018-08-07  Antti Koivisto  <antti@apple.com>
    217
  • trunk/Source/WTF/wtf/Atomics.h

    r229988 r234648  
    277277inline void memoryBarrierBeforeUnlock() { arm_dmb(); }
    278278inline void crossModifyingCodeFence() { arm_isb(); }
    279 inline void speculationFence() { arm_isb(); }
    280279
    281280#elif CPU(X86) || CPU(X86_64)
    282 
    283 inline void x86_lfence()
    284 {
    285 #if !OS(WINDOWS)
    286     asm volatile("lfence" ::: "memory");
    287 #endif
    288 }
    289281
    290282inline void x86_ortop()
     
    323315inline void memoryBarrierBeforeUnlock() { compilerFence(); }
    324316inline void crossModifyingCodeFence() { x86_cpuid(); }
    325 inline void speculationFence() { x86_lfence(); }
    326317
    327318#else
     
    334325inline void memoryBarrierBeforeUnlock() { std::atomic_thread_fence(std::memory_order_seq_cst); }
    335326inline void crossModifyingCodeFence() { std::atomic_thread_fence(std::memory_order_seq_cst); } // Probably not strong enough.
    336 inline void speculationFence() { } // Probably not strong enough.
    337327
    338328#endif
Note: See TracChangeset for help on using the changeset viewer.