Closed
Bug 1492064
Opened 7 years ago
Closed 7 years ago
Baseline JIT is not disabled on unsupported variants of supported CPUs
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla64
People
(Reporter: glandium, Assigned: glandium)
References
Details
Attachments
(1 file)
|
46 bytes,
text/x-phabricator-request
|
jandem
:
review+
RyanVM
:
approval-mozilla-esr60+
|
Details | Review |
While Mozilla.org builds of Firefox dropped support for x86 CPUs without SSE2, downstreams may support it. This is generally handled gracefully by having runtime detection, and the ION JIT does it. But the baseline JIT doesn't.
I have a WIP patch that adds a cx->runtime()->jitSupportsFloatingPoint condition to IsBaselineEnabled but I have a few interrogations:
- What does it mean for non x86 CPUs? (like ARM, etc.)
- It seems WASM does the right thing in wasm::HasCompilerSupport, but I don't know if it's used in all code paths.
Not sure who would have the best answers for this. Trying Jan.
Flags: needinfo?(jdemooij)
Comment 1•7 years ago
|
||
wasm::HasCompilerSupport should properly gate wasm always, and then there are additional checks on hardware capabilities in wasm::BaselineCanCompile and wasm::IonCanCompile to determine if specific compilers are available. For example, the baseline compiler requires IDIV on ARM, and both compilers require LDREXD / STREXD on ARM for atomics support.
Comment 2•7 years ago
|
||
Baseline should work fine without floating point support (at least that's how it used to work but maybe someone broke it since then).
I'd really like to require SSE2+ and ARMv7+ at some point in the JIT. If people want to run Firefox on ancient hardware they can compile with --disable-ion (and use the none/ backend, no JITs). I honestly don't think it's worth our time and resources fixing what are effectively tier 3 platforms.
That said, adding a cx->runtime()->jitSupportsFloatingPoint check to IsBaselineEnabled seems OK.
Flags: needinfo?(jdemooij)
| Assignee | ||
Comment 3•7 years ago
|
||
> If people want to run Firefox on ancient hardware they can compile with --disable-ion (and use the none/ backend, no JITs).
For downstreams such as Debian, it's preferable to keep a runtime way to disable JITs on unsupported CPUs, allowing the same binary to run both on systems with and without SSE2, with a JIT for the former.
Comment 4•7 years ago
|
||
FWIW we used to have a --no-fpu shell flag (to pretend we don't have SSE2) to find bugs here. We removed it in bug 1279529, two years ago, because we thought all of our builds would require SSE2...
Anyway, suggested fix SGTM, if this is causing crashes downstream.
| Assignee | ||
Comment 5•7 years ago
|
||
| Assignee | ||
Updated•7 years ago
|
Assignee: nobody → mh+mozilla
Comment 6•7 years ago
|
||
Comment on attachment 9010118 [details]
Bug 1492064 - Disable baseline JIT when SSE2 is not supported at runtime
Jan de Mooij [:jandem] has approved the revision.
Attachment #9010118 -
Flags: review+
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/921e4aa179f8
Disable baseline JIT when SSE2 is not supported at runtime r=jandem
Comment 8•7 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
| Assignee | ||
Comment 9•7 years ago
|
||
Comment on attachment 9010118 [details]
Bug 1492064 - Disable baseline JIT when SSE2 is not supported at runtime
[Approval Request Comment]
If this is not a sec:{high,crit} bug, please state case for ESR consideration: Necessary for some downstreams.
User impact if declined: Downstreams such as Debian provide OSes that work on older x86 machines, and as such, try to keep Firefox working on those machines. For users with such machines (and there are surprisingly lots of them), Firefox crashes without this patch.
Fix Landed on Version: 64
Risk to taking this patch (and alternatives if risky): For Firefox builds that Mozilla ships, the patch essentially is a no-op: the added condition is true on all machines with SSE2, which is the minimum supported for those builds. On arm, it means machines with VFP, which is all those we support for Android. For downstreams like Debian, this just ensures SSE2 instructions are not used on machines without SSE2. Note that Ion jit is already disabled for such machines, this disables the baseline jit for them.
String or UUID changes made by this patch: N/A
Attachment #9010118 -
Flags: approval-mozilla-esr60?
Comment 10•7 years ago
|
||
Comment on attachment 9010118 [details]
Bug 1492064 - Disable baseline JIT when SSE2 is not supported at runtime
Fix for some downstream distros. Approved for ESR 60.3.
Attachment #9010118 -
Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
Comment 11•7 years ago
|
||
| bugherder uplift | ||
status-firefox-esr60:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•