Xen guest floating point problem
We have a simple C test program that runs on our evolved version of Mini-OS (GUK) that exhibits sporadic non-deterministic failure regarding floating point computations (mostly calling the __ieee754_remainder method of fdlibm). Typically about 5 computations in 10000 fail, usually with Nan or Infinite values showing up. We are as convinced as we can be at this point that the GUK code is not corrupting the floating point state, so are down to two ideas. One is a bug in Xen on guest context switching or event delivery regarding the FP state. The other is that GUK is failing to obey some Xen API contract regarding FP state. For example, timer and xenstore events are being delivered during the run although we can't correlate them directly to the fault.
The program fails on both Solaris xVM 3.1.4, xVM 3.3, various Linux 3.1.4 systems, but does not fail when run on Solaris or Linux domUs. This points the finger at GUK but we are wondering whether they have a workaround for some problem we are not aware of.
Thanks for any help.
Mick
Quoted 12 lines · Mick Jordan
We have a simple C test program that runs on our evolved version of Mini-OS (GUK) that exhibits sporadic non-deterministic failure regarding floating point computations (mostly calling the
__ieee754_remaindermethod of fdlibm). Typically about 5 computations in 10000 fail, usually with Nan or Infinite values showing up. We are as convinced as we can be at this point that the GUK code is not corrupting the floating point state, so are down to two ideas. One is a bug in Xen on guest context switching or event delivery regarding the FP state. The other is that GUK is failing to obey some Xen API contract regarding FP state. For example, timer and xenstore events are being delivered during the run although we can't correlate them directly to the fault.
Quoted 4 lines
The program fails on both Solaris xVM 3.1.4, xVM 3.3, various Linux 3.1.4 systems, but does not fail when run on Solaris or Linux domUs. This points the finger at GUK but we are wondering whether they have a workaround for some problem we are not aware of.
I don't think the guest should have to do anything special regarding handling FP state. Xen should automatically save/restore the state as necessary. We had bugs in this area long ago, but they were fixed and I'd be surprised if problems had crept back in.
-- Keir