Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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-*) (also known as IA-32, i386, i586, i686)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