[patch] ZeroVM fix under linuxthreads

Damien Raude-Morvan drazzib at drazzib.com
Tue Aug 9 14:53:28 PDT 2011


When trying to use Zero VM with linuxthreads (under x86 but should also exist 
under others CPU), I found an issue with safe_cond_timedwait usage.

In openjdk/hotspot/src/os/linux/vm/os_linux.cpp#safe_cond_timedwait :
   if (is_NPTL()) {
      return pthread_cond_timedwait(_cond, _mutex, _abstime);
   } else {
#ifndef IA64
      // 6292965: LinuxThreads pthread_cond_timedwait() resets FPU control
      // word back to default 64bit precision if condvar is signaled. Java
      // wants 53bit precision.  Save and restore current value.
      int fpu = get_fpu_control_word();
#endif // IA64
      int status = pthread_cond_timedwait(_cond, _mutex, _abstime);
#ifndef IA64
#endif // IA64
      return status;
So if you use linuxthreads (!= NTPL) with a arch different from x86_64, it will 
try to call get_fpu_control_word / set_fpu_control_word.

Now, in os_linux_zero.cpp, this methods currently throw errors with 
ShouldNotCallThis. This obvousily fails in this case.

I've choosen to just replace this with just noop (see attached patch).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zero-fpu-control-is-noop.diff
Type: text/x-patch
Size: 970 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/zero-dev/attachments/20110809/cc0dd879/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://mail.openjdk.java.net/pipermail/zero-dev/attachments/20110809/cc0dd879/attachment-0001.bin 

More information about the zero-dev mailing list