http://bugs.winehq.org/show_bug.cgi?id=19982
Summary: SetThreadAffinityMask() seems not to work correctly Product: Wine Version: 1.1.29 Platform: PC URL: http://rh-software.com/ OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 AssignedTo: wine-bugs@winehq.org ReportedBy: ray@pobox.co.uk
Created an attachment (id=23510) --> (http://bugs.winehq.org/attachment.cgi?id=23510) SIV log shouing pseuso random APICs
When my SIV application (http://rh-software.com/) on under Wine the reported processor topography is often incorrect. This is caused by the APIC returned by the CPUID 1 instruction not being the APIC for the CPU I have set affinity to. This makes me believe that SetThreadAffinityMask() is not working correctly. This can easily be shown using me SIV utility with the command line: SIV -SAVE=[processors]=stdout -nodriver | find "CPU-" which when run under Wine typically reports: MPS MCP HTT APIC G N Affinity Speed Processors CPU-0 0 3 0 (core) 0003 0 0 0x00000001 3.00GHz CPU-1 0 3 0 ... 0003 0 1 0x00000002 3.00GHz CPU-2 0 3 0 ... 0003 0 2 0x00000004 3.00GHz CPU-3 0 3 0 ... 0003 0 3 0x00000008 3.00GHz if SetThreadAffinityMask() was woring as expected each CPU would have a different APIC giving a report similar to Processors CPU-0 0 0 0 0000 0 0 0x00000001 3.20GHz CPU-1 0 1 0 (core) 0002 0 1 0x00000002 3.20GHz CPU-2 0 0 1 (logical) 0001 0 2 0x00000004 3.20GHz CPU-3 0 1 1 ... 0003 0 3 0x00000008 3.20GHz this has been seen on at least 2 different systems. Further the APIC returned for a given CPU seems to vary from run-to-run as shown in the siv_apic.txt attachment.
Looking through the bug reports this could also be what is fundamental cause of issue http://bugs.winehq.org/show_bug.cgi?id=11674. If WOW is using SetThreadAffinityMask() it could happen that all the threads end up running on the same CPU because of SetThreadAffinityMask() not working as it should.
The -NODRIVER qualifier is needed with SIV 4.00 and earlier and will not be needed from SIV 4.01 onwards.