public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH] Fix ppc64 test-fenv
@ 2003-04-11 19:43 Steve Munroe
  2003-04-11 22:09 ` Roland McGrath
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Munroe @ 2003-04-11 19:43 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Ulrich Drepper, GNU libc hacker, Peter Bergner


Jakub Jelinek writes

> If the official kernel source contained a buggy prctl so that it is
unsafe
> to try prctl on kernels between 2.4.19 and 2.4.21, then
linux/configure.in
> needs to be changed for 2.4.21 the minimum required kernel version.
> Really, having glibc built without --enable-kernel switch just not work
> forever no matter what kernel it is running on is a bad idea.

prctl is not buggy. It either supports the feature or not. Your patch is OK
and should be integrated.

It just does not correct the fundamental problem. The 2.4.20 kernel does
not
initialize FE0|1 correctly for new processes lwp's. This disables FPE
raise,
until/unless this state is explicitely changed later.

The original fe_nomask.c hack (inherited from PPC32) to set FE0|1 was only
partially reliable on uniprocessors and unreliable on SMPs. That is why we
added the PR_SET_FPEXC feature. I feel that fe_nomask should either work
correctly or return ENOSYS. Your patch prevents test-fenv from seeing a
EINVAL.

The fix (both correct initial state for FE0|1 and the PR_SET_FPEXC feature
are in Marcelo's 2.4.21.pre tree and will be released with 2.4.21.



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

* Re: [PATCH] Fix ppc64 test-fenv
  2003-04-11 19:43 [PATCH] Fix ppc64 test-fenv Steve Munroe
@ 2003-04-11 22:09 ` Roland McGrath
  0 siblings, 0 replies; 5+ messages in thread
From: Roland McGrath @ 2003-04-11 22:09 UTC (permalink / raw)
  To: Steve Munroe
  Cc: Jakub Jelinek, Ulrich Drepper, GNU libc hacker, Peter Bergner

I've put Jakub's change in.


Thanks,
Roland

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

* Re: [PATCH] Fix ppc64 test-fenv
  2003-04-11 18:50 ` Ulrich Drepper
@ 2003-04-11 18:54   ` Jakub Jelinek
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Jelinek @ 2003-04-11 18:54 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Steve Munroe, Peter Bergner, GNU libc hacker

> Steve Munroe wrote:
> 
> > Actually a bad kernel patch (related to initialing the MSR FE0/1 bits
> > correctly) went in after sometime after the 2.4.19 Suse SLES 8 release and
> > was not fixed again until 2.4.21-pre4 (I think).

If the official kernel source contained a buggy prctl so that it is unsafe
to try prctl on kernels between 2.4.19 and 2.4.21, then linux/configure.in
needs to be changed for 2.4.21 the minimum required kernel version.
Really, having glibc built without --enable-kernel switch just not work
forever no matter what kernel it is running on is a bad idea.

	Jakub

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

* Re: [PATCH] Fix ppc64 test-fenv
       [not found] <OF5176686A.8C0180BF-ON86256D05.00655502-86256D05.00665397@rchland.ibm.com>
@ 2003-04-11 18:50 ` Ulrich Drepper
  2003-04-11 18:54   ` Jakub Jelinek
  0 siblings, 1 reply; 5+ messages in thread
From: Ulrich Drepper @ 2003-04-11 18:50 UTC (permalink / raw)
  To: Steve Munroe; +Cc: Jakub Jelinek, Peter Bergner, GNU libc hacker

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steve Munroe wrote:

> Actually a bad kernel patch (related to initialing the MSR FE0/1 bits
> correctly) went in after sometime after the 2.4.19 Suse SLES 8 release and
> was not fixed again until 2.4.21-pre4 (I think).

That's irrelevant.  What does the official kernel sources contain?

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+lw5k2ijCOnn/RHQRAp6UAKCvWrqxMb7WtMSzmS3FMo+9LgQS7ACeLnBh
jcoDOGZqyKwlUntibB+FxIU=
=ZUUl
-----END PGP SIGNATURE-----

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

* [PATCH] Fix ppc64 test-fenv
@ 2003-04-11 18:06 Jakub Jelinek
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Jelinek @ 2003-04-11 18:06 UTC (permalink / raw)
  To: Roland McGrath, Ulrich Drepper; +Cc: Glibc hackers

Hi!

Unless ppc64 glibc is built with --enable-kernel=2.4.21 or higher
(without this switch 2.4.19 is assumed), it will fail test-fenv
no matter whatever kernel it is running on.
The following patch fixes it.

2003-04-11  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c
	(__fe_nomask_env): Try prctl even if __ASSUME_NEW_PRCTL_SYSCALL
	is not defined, but the prctl constants are.

--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c.jj	2003-03-06 12:26:24.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c	2003-04-11 10:18:44.000000000 -0400
@@ -27,9 +27,15 @@
 const fenv_t *
 __fe_nomask_env (void)
 {
-#ifdef __ASSUME_NEW_PRCTL_SYSCALL
+#if defined PR_SET_FPEXC && defined PR_FP_EXC_PRECISE
+  int result;
   INTERNAL_SYSCALL_DECL (err);
-  INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE);
+  result = INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE);
+# ifndef __ASSUME_NEW_PRCTL_SYSCALL
+  if (INTERNAL_SYSCALL_ERROR_P (result, err)
+      && INTERNAL_SYSCALL_ERRNO (result, err) == EINVAL)
+    __set_errno (ENOSYS);
+# endif
 #else  
   __set_errno (ENOSYS);
 #endif

	Jakub

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

end of thread, other threads:[~2003-04-11 22:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-11 19:43 [PATCH] Fix ppc64 test-fenv Steve Munroe
2003-04-11 22:09 ` Roland McGrath
     [not found] <OF5176686A.8C0180BF-ON86256D05.00655502-86256D05.00665397@rchland.ibm.com>
2003-04-11 18:50 ` Ulrich Drepper
2003-04-11 18:54   ` Jakub Jelinek
  -- strict thread matches above, loose matches on Subject: below --
2003-04-11 18:06 Jakub Jelinek

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).