All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 1883984] [NEW] QEMU S/390x sqxbr (128-bit IEEE 754 square root) crashes qemu-system-s390x
@ 2020-06-17 21:50 Nelson H F Beebe
  2020-06-19  0:11 ` [Bug 1883984] " Bruno Haible
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Nelson H F Beebe @ 2020-06-17 21:50 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

In porting software to guest Ubuntu 18.04 and 20.04 VMs for S/390x, I discovered
that some of my own numerical programs, and also a GNU configure script for at
least one package with CC=clang, would cause an instant crash of the VM, sometimes
also destroying recently opened files, and producing long strings of NUL characters
in /var/log/syslog in the S/390 guest O/S.

Further detective work narrowed the cause of the crash down to a single IBM S/390
instruction: sqxbr (128-bit IEEE 754 square root).  Here is a one-line program
that when compiled and run on a VM hosted on QEMUcc emulator version 4.2.0 
(Debian 1:4.2-3ubuntu6.1) [hosted on Ubuntu 20.04 on a Dell Precision 7920 
workstation with an Intel Xeon Platinum 8253 CPU],  and also on QEMU emulator 
version 5.0.0, reproducibly produces a VM crash under qemu-system-s390x.

% cat bug-sqrtl-one-line.c
int main(void) { volatile long double x, r; x = 4.0L; __asm__ __volatile__("sqxbr %0, %1" : "=f" (r) : "f" (x)); return (0);}

% cc bug-sqrtl-one-line.c && ./a.out
Segmentation fault (core dumped)

The problem code may be the function float128_sqrt() defined in qemu-5.0.0/fpu/softfloat.c
starting at line 7619.  I have NOT attempted to run the qemu-system-s390x executable
under a debugger.  However, I observe that S/390 is the only CPU family that I know of,
except possibly for a Fujitsu SPARC-64, that has a 128-bit square root in hardware.
Thus, this instruction bug may not have been seen before.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1883984

Title:
  QEMU S/390x sqxbr (128-bit IEEE 754 square root) crashes qemu-system-
  s390x

Status in QEMU:
  New

Bug description:
  In porting software to guest Ubuntu 18.04 and 20.04 VMs for S/390x, I discovered
  that some of my own numerical programs, and also a GNU configure script for at
  least one package with CC=clang, would cause an instant crash of the VM, sometimes
  also destroying recently opened files, and producing long strings of NUL characters
  in /var/log/syslog in the S/390 guest O/S.

  Further detective work narrowed the cause of the crash down to a single IBM S/390
  instruction: sqxbr (128-bit IEEE 754 square root).  Here is a one-line program
  that when compiled and run on a VM hosted on QEMUcc emulator version 4.2.0 
  (Debian 1:4.2-3ubuntu6.1) [hosted on Ubuntu 20.04 on a Dell Precision 7920 
  workstation with an Intel Xeon Platinum 8253 CPU],  and also on QEMU emulator 
  version 5.0.0, reproducibly produces a VM crash under qemu-system-s390x.

  % cat bug-sqrtl-one-line.c
  int main(void) { volatile long double x, r; x = 4.0L; __asm__ __volatile__("sqxbr %0, %1" : "=f" (r) : "f" (x)); return (0);}

  % cc bug-sqrtl-one-line.c && ./a.out
  Segmentation fault (core dumped)

  The problem code may be the function float128_sqrt() defined in qemu-5.0.0/fpu/softfloat.c
  starting at line 7619.  I have NOT attempted to run the qemu-system-s390x executable
  under a debugger.  However, I observe that S/390 is the only CPU family that I know of,
  except possibly for a Fujitsu SPARC-64, that has a 128-bit square root in hardware.
  Thus, this instruction bug may not have been seen before.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1883984/+subscriptions


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-09-16  2:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-17 21:50 [Bug 1883984] [NEW] QEMU S/390x sqxbr (128-bit IEEE 754 square root) crashes qemu-system-s390x Nelson H F Beebe
2020-06-19  0:11 ` [Bug 1883984] " Bruno Haible
2020-06-20  3:22 ` Richard Henderson
2020-06-20 10:12 ` Bruno Haible
2020-07-09 16:03 ` Richard Henderson
2020-08-03  6:40 ` Christian Ehrhardt 
2020-08-03  6:45 ` Launchpad Bug Tracker
2020-08-03  6:53 ` Christian Ehrhardt 
2020-08-08  0:43 ` Launchpad Bug Tracker
2020-08-19  7:03 ` Christian Ehrhardt 
2020-08-19  7:35 ` Christian Ehrhardt 
2020-08-19 12:28 ` Launchpad Bug Tracker
2020-08-20 14:36 ` Thomas Huth
2020-08-21 11:04 ` Timo Aaltonen
2020-08-21 22:35 ` [Bug 1883984] Autopkgtest regression report (qemu/1:4.2-3ubuntu6.5) Ubuntu SRU Bot
2020-08-26 12:19 ` [Bug 1883984] Re: QEMU S/390x sqxbr (128-bit IEEE 754 square root) crashes qemu-system-s390x Christian Ehrhardt 
2020-09-16  2:18 ` [Bug 1883984] Update Released Chris Halse Rogers
2020-09-16  2:18 ` [Bug 1883984] Re: QEMU S/390x sqxbr (128-bit IEEE 754 square root) crashes qemu-system-s390x Launchpad Bug Tracker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.