Skip to content

hint::spin_loop invokes undefined behavior on targets without SSE2 #59237

Closed
@gnzlbg

Description

@gnzlbg

Currently hint::spin_loop is implemented with the pause instruction on all x86 / x86_64 targets, but this instruction is only available on CPUs with SSE2. The behavior of pause on CPUs without SSE2 is undefined.


This hint should not be implemented with inline assembly, but should call the appropriate core::arch intrinsics instead. Those explicitly state which features are required for each operation on each target.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessO-x86_32Target: x86 processors, 32 bit (like i686-*) (IA-32)O-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions