public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/27511] New: S390 memmove assumes Vector Facility when MIE Facility 3 is present
@ 2021-03-04 15:06 ian at iarosh dot com
  2021-03-23 16:41 ` [Bug libc/27511] " stli at linux dot ibm.com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ian at iarosh dot com @ 2021-03-04 15:06 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27511

            Bug ID: 27511
           Summary: S390 memmove assumes Vector Facility when MIE Facility
                    3 is present
           Product: glibc
           Version: 2.32
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: ian at iarosh dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

glibc-2.32\sysdeps\s390\memmove.c contains:-

s390_libc_ifunc_expr (__redirect_memmove, memmove,
          ({
      s390_libc_ifunc_expr_stfle_init ();
      (HAVE_MEMMOVE_ARCH13
       && S390_IS_ARCH13_MIE3 (stfle_bits))
        ? MEMMOVE_ARCH13
        : (HAVE_MEMMOVE_Z13 && (hwcap & HWCAP_S390_VX))
        ? MEMMOVE_Z13
        : MEMMOVE_DEFAULT;
          })
          )

If S390_IS_ARCH13_MIE3 is on (i.e. Miscellaneous-Instruction-Extensions
Facility 3 is installed) the function MEMMOVE_ARCH13 is called, which contains
Vector Facility instructions. As the Vector Facility is optional,
MEMMOVE_ARCH13 abends with an Operation Exception.

The problem could be avoided if the code was changed to:

s390_libc_ifunc_expr (__redirect_memmove, memmove,
          ({
      s390_libc_ifunc_expr_stfle_init ();
      (HAVE_MEMMOVE_ARCH13 && (hwcap & HWCAP_S390_VX)
       && S390_IS_ARCH13_MIE3 (stfle_bits))
        ? MEMMOVE_ARCH13
        : (HAVE_MEMMOVE_Z13 && (hwcap & HWCAP_S390_VX))
        ? MEMMOVE_Z13
        : MEMMOVE_DEFAULT;
          })
          )

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/27511] S390 memmove assumes Vector Facility when MIE Facility 3 is present
  2021-03-04 15:06 [Bug libc/27511] New: S390 memmove assumes Vector Facility when MIE Facility 3 is present ian at iarosh dot com
@ 2021-03-23 16:41 ` stli at linux dot ibm.com
  2021-03-23 18:51 ` ian at iarosh dot com
  2021-03-26 10:44 ` stli at linux dot ibm.com
  2 siblings, 0 replies; 4+ messages in thread
From: stli at linux dot ibm.com @ 2021-03-23 16:41 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27511

Stefan Liebler <stli at linux dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-03-23
                 CC|                            |stli at linux dot ibm.com
           Assignee|unassigned at sourceware dot org   |stli at linux dot ibm.com

--- Comment #1 from Stefan Liebler <stli at linux dot ibm.com> ---
Thanks Ian,

you are right, if vector support is not present, this leads to an exception.
This is e.g. observable if you are booting with "novx" kernel-parameter on a
z15 or if you e.g. running on a zVM guest with an older zVM which has no
support for vector registers. I think some valgrind versions are also disabling
the vector HWCAPs, but not the stfle bits.

Which environment / distro are you using which leads to this exception?

I've just posted this patch:
[PATCH] S390: Also check vector support in memmove ifunc-selector [BZ #27511]
https://sourceware.org/pipermail/libc-alpha/2021-March/124311.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/27511] S390 memmove assumes Vector Facility when MIE Facility 3 is present
  2021-03-04 15:06 [Bug libc/27511] New: S390 memmove assumes Vector Facility when MIE Facility 3 is present ian at iarosh dot com
  2021-03-23 16:41 ` [Bug libc/27511] " stli at linux dot ibm.com
@ 2021-03-23 18:51 ` ian at iarosh dot com
  2021-03-26 10:44 ` stli at linux dot ibm.com
  2 siblings, 0 replies; 4+ messages in thread
From: ian at iarosh dot com @ 2021-03-23 18:51 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27511

--- Comment #2 from Ian <ian at iarosh dot com> ---
I discovered the problem using Fedora 33 s390x under Hercules (the S390
emulator). Hercules does not support Vector, but recently started supporting
MIE3, whereupon the problem surfaced. However, as Vector is still optional even
on a z15 (though possibly not for much longer) someone somewhere might
experience the problem on real hardware.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/27511] S390 memmove assumes Vector Facility when MIE Facility 3 is present
  2021-03-04 15:06 [Bug libc/27511] New: S390 memmove assumes Vector Facility when MIE Facility 3 is present ian at iarosh dot com
  2021-03-23 16:41 ` [Bug libc/27511] " stli at linux dot ibm.com
  2021-03-23 18:51 ` ian at iarosh dot com
@ 2021-03-26 10:44 ` stli at linux dot ibm.com
  2 siblings, 0 replies; 4+ messages in thread
From: stli at linux dot ibm.com @ 2021-03-26 10:44 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27511

Stefan Liebler <stli at linux dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.34

--- Comment #3 from Stefan Liebler <stli at linux dot ibm.com> ---
Committed to master:
"S390: Also check vector support in memmove ifunc-selector [BZ #27511]"
https://sourceware.org/git/?p=glibc.git;a=commit;h=7759be2593b689cb1eafc0f52ee7f59c639e5d2f

and to the release branches 2.30 - 2.33

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-03-26 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 15:06 [Bug libc/27511] New: S390 memmove assumes Vector Facility when MIE Facility 3 is present ian at iarosh dot com
2021-03-23 16:41 ` [Bug libc/27511] " stli at linux dot ibm.com
2021-03-23 18:51 ` ian at iarosh dot com
2021-03-26 10:44 ` stli at linux dot ibm.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).