http://bugs.winehq.org/show_bug.cgi?id=31322
Bug #: 31322 Summary: Remote Tools for Visual Studio 2012 RC for Windows on ARM (WoA) crashes because TPIDRURW (user TLS register) TEB value is not preserved by kernel Product: Wine Version: 1.5.9 Platform: arm OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net Classification: Unclassified
Hello,
split off from bug 31308 (see there for details). TPIDRURW (user TLS register) TEB value is not preserved by kernel (currently either reset to zero or left with same values across context switches).
Regards
http://bugs.winehq.org/show_bug.cgi?id=31322
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Status|NEW |RESOLVED URL| |http://www.microsoft.com/vi | |sualstudio/11/en-us/downloa | |ds#remote-tools Depends on| |31308 Resolution| |UPSTREAM Summary|Remote Tools for Visual |Remote Tools for Visual |Studio 2012 RC for Windows |Studio 2012 RC for Windows |on ARM (WoA) crashes |on ARM (WoA) crashes |because TPIDRURW (user TLS |because TPIDRURW (user TLS |register) TEB value is not |register) per thread TEB |preserved by kernel |value is not preserved by | |kernel
--- Comment #1 from Anastasius Focht focht@gmx.net 2012-07-25 16:35:58 CDT --- Hello,
resolving upstream (Linux kernel change for ARM arch needed).
Regards
http://bugs.winehq.org/show_bug.cgi?id=31322
--- Comment #2 from Austin English austinenglish@gmail.com 2012-07-25 17:05:55 CDT --- Is there a kernel bug filed for this/can you please file one?
http://bugs.winehq.org/show_bug.cgi?id=31322
--- Comment #3 from Anastasius Focht focht@gmx.net 2012-07-25 17:53:43 CDT --- Hello Austin,
that might take some time ... first I have to test the hypothesis by making a patch to my own kernel (thread_info needs to be extended to carry additional user TLS value, thread context switch save/restore etc.). I don't want to request a new kernel feature (which is an invasive change to some integral kernel structure/code) when other userland code not under control of Wine might also take advantage of this freely available TLS register.
There exist a large amount of proprietary kernel forks -> BSPs for ARM based platforms based on gazillion different versions of vanilla kernels and I'm sitting on one ... :( André's kernel has explicit zero out of TPIDRURW while mine doesn't even care for it.
Regards
http://bugs.winehq.org/show_bug.cgi?id=31322
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv@dawncrow.de
--- Comment #4 from André H. nerv@dawncrow.de 2012-07-26 15:16:58 CDT --- So in the end this kernel patch that zeroes out your favourite register needs to be reverted, right? Could you please take full care of the kernel part of the problem?
http://bugs.winehq.org/show_bug.cgi?id=31322
--- Comment #5 from Anastasius Focht focht@gmx.net 2012-07-26 15:55:06 CDT --- Hello André,
--- quote --- So in the end this kernel patch that zeroes out your favourite register needs to be reverted, right? Could you please take full care of the kernel part of the problem? --- quote ---
Something like this needs to be reverted, yes:
http://kernel.opensuse.org/cgit/kernel/commit/?id=6a1c53124aa161eb624ce7b1e4...
But that's only the part that restores the code to original state where TPIDRURW is simply ignored by Linux kernel.
I made a patch on my kernel tree to take care of this user TLS register (preserve it per thread) when hardware TLS registers are available (ARM v6+). So far it works (also requires a Wine TEB patch for TPIDRURW) ;-) The installer runs much farther now but unfortunately exits due to bug 17273 (pipe state). The WiX based installer creates a verbose log to document failures in "$WINEPREFIX/drive_c/users/<user>/Temp".
Regards
http://bugs.winehq.org/show_bug.cgi?id=31322
--- Comment #6 from Anastasius Focht focht@gmx.net 2012-07-29 15:23:14 CDT --- Created attachment 41194 --> http://bugs.winehq.org/attachment.cgi?id=41194 Patch to revert "ARM: tls: remove covert channel via TPIDRURW"
http://bugs.winehq.org/show_bug.cgi?id=31322
--- Comment #7 from Anastasius Focht focht@gmx.net 2012-07-29 15:24:56 CDT --- Created attachment 41195 --> http://bugs.winehq.org/attachment.cgi?id=41195 Patch to preserve TPIDRURW per thread to allow TEB access for Windows on ARM applications
http://bugs.winehq.org/show_bug.cgi?id=31322
Bug 31322 depends on bug 31308, which changed state.
Bug 31308 Summary: Remote Tools for Visual Studio 2012 RC installer for Windows on ARM (WoA) crashes because TPIDRURW (user TLS register) needs to be set to TEB address http://bugs.winehq.org/show_bug.cgi?id=31308
What |Old Value |New Value ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
http://bugs.winehq.org/show_bug.cgi?id=31322
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Remote Tools for Visual |Multiple applications |Studio 2012 RC for Windows |ported to WinRT/ARM crashes |on ARM (WoA) crashes |because TPIDRURW (user r/w |because TPIDRURW (user TLS |TLS register) per thread |register) per thread TEB |TEB value is not preserved |value is not preserved by |by kernel |kernel |
--- Comment #8 from André H. nerv@dawncrow.de 2013-04-19 11:01:14 CDT --- I just sent: http://marc.info/?l=linux-arch&m=136638692828591&w=2 Could you please test if that also works for you, obviously you'd need to apply it manually.
http://bugs.winehq.org/show_bug.cgi?id=31322
--- Comment #9 from André H. nerv@dawncrow.de 2013-06-08 06:32:25 CDT --- Amazing! After much iterations it's finally in the tree of Russel King: http://ftp.arm.linux.org.uk/git/gitweb.cgi?p=linux-arm.git;a=commit;h=41241d...
This means if nothing goes wrong it's about to be applied in the merge window of kernel 3.11 in a few weeks.
http://bugs.winehq.org/show_bug.cgi?id=31322
--- Comment #10 from André H. nerv@dawncrow.de 2013-06-21 16:40:45 CDT --- (In reply to comment #9)
This means if nothing goes wrong it's about to be applied in the merge window of kernel 3.11 in a few weeks.
Sadly something went wrong. The patch produces a build error on some older ARMs, try 2 is "pending"
http://bugs.winehq.org/show_bug.cgi?id=31322
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from André H. nerv@dawncrow.de 2013-07-03 12:18:59 CDT --- Final patch just made it into Linus tree: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a4...
http://bugs.winehq.org/show_bug.cgi?id=31322
--- Comment #12 from André H. nerv@dawncrow.de 2013-09-02 17:31:46 CDT --- Linux 3.11 is out now, yeah!
https://bugs.winehq.org/show_bug.cgi?id=31322
--- Comment #13 from André H. nerv@dawncrow.de --- This is also fixed on compat mode on ARM64 with: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d...
https://bugs.winehq.org/show_bug.cgi?id=31322
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://www.microsoft.com/vi |https://web.archive.org/web |sualstudio/11/en-us/downloa |/20210719085359/https://dow |ds#remote-tools |nload.microsoft.com/downloa | |d/4/1/5/41524F91-4CEE-416B- | |BB70-305756373937/VSU4/rtoo | |ls_setup_arm.exe
--- Comment #14 from Anastasius Focht focht@gmx.net --- Hello folks,
adding stable download links via Internet Archive for documentation.
Nice overview:
https://web.archive.org/web/20210719085257/https://zzz.buzz/notes/visual-stu... ("Visual Studio Remote Debugger Notes and Downloads")
--- Remote Tools for Visual Studio 2012:
https://web.archive.org/web/20210719085359/https://download.microsoft.com/do...
$ du -sh rtools_setup_arm.exe 19M rtools_setup_arm.exe
$ sha1sum rtools_setup_arm.exe 41e92bb09db780f54a210d921a1120d4d7e98a4d rtools_setup_arm.exe
--- Remote Tools for Visual Studio 2013:
https://web.archive.org/web/20210719084648/http://download.microsoft.com/dow...
$ sha1sum rtools_setup_arm.exe 2f82363adf4b396de9339a2302192fd2713be782 rtools_setup_arm.exe
$ du -sh rtools_setup_arm.exe 20M rtools_setup_arm.exe
--- Remote Tools for Visual Studio 2015:
https://web.archive.org/web/20190111183958/https://download.microsoft.com/do...
$ sha1sum rtools_setup_arm.exe 40192fac8236fa6428c27bfd2f929b7d81562d07 rtools_setup_arm.exe
$ du -sh rtools_setup_arm.exe 21M rtools_setup_arm.exe
Regards