Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-91071

Some rdrand instructions get executed before QT_NO_CPU_FEATURE=rdrnd is applied

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.15.2
    • Core: Other
    • None
    • Debian testing, linux 5.10.12-1, X11, running at AMD Ryzen 1700 cpu
    • Linux/X11

      Function detectProcessorFeatures calls checkRdrndWorks which executes a few rdrand instructions and just later the environment QT_NO_CPU_FEATURE=rdrnd gets examined and the feature disabled.

      Background was recording a Qt application with rr-debugger at a debian testing, running at AMD Ryzen 1700 cpu. That cpu lacks the facility "CPUID faulting", therefore rr-debugger uses that environment to disable rdrand instructions. There was a misuse of rdrand / rdrnd which got fixed in rr-debugger now making it unlikely for rr to fail because of these few instructions. rr-bug

      But if Qt developers want to have no rdrand instructions at all executed with this environment variable set, this might be achieved by moving the call to checkRdrndWorks after the environment variable check like in attached (and just little tested) patch against debians Qt 5.15.2.

      I have not tested, but Qt6 sources seem to show the same situation, the files got just moved from src/corelib/tools/qsimd.cpp to src/corelib/global/qsimd.cpp.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            bernhardue Bernhard
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes