[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#799478: marked as done (glibc: revised atomic and new syscall patches for hppa)



Your message dated Sun, 22 Nov 2015 19:34:46 +0000
with message-id <E1a0aPO-0007Bv-Pm@franck.debian.org>
and subject line Bug#799478: fixed in glibc 2.21-0experimental3
has caused the Debian Bug report #799478,
regarding glibc: revised atomic and new syscall patches for hppa
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
799478: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=799478
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: glibc
Version: 13
Severity: normal
Tags: patch

Dear Maintainer,

Attached are two patches for hppa.  Both use the register asm feature
of gcc to load arguments to specific registers prior to a syscall.

The updated atomic patch avoids the infamous "can't find a register in
class R1_REGS" and avoids the noinline function in the previous version.

The old hppa/local-atomic.diff patch needs to be deleted before applying
the hppa/submitted-atomic.diff change.

The syscall patch fixes the miscompilation of sched_setaffinity().  It
is similar to the fix applied to other archs.

Both patches have been submitted and applied to the upstream glibc source:
https://sourceware.org/bugzilla/show_bug.cgi?id=18787
https://sourceware.org/ml/libc-alpha/2015-08/msg00266.html

I would appreciate your adding these two changes to the set of hppa
changes.

I now need to look at 2.21...

Thanks,
Dave

-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.21+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
===================================================================
--- glibc-2.19.orig/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
@@ -53,7 +53,7 @@ typedef uintmax_t uatomic_max_t;
 #define _LWS "0xb0"
 #define _LWS_CAS "0"
 /* Note r31 is the link register.  */
-#define _LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory"
+#define _LWS_CLOBBER "r1", "r23", "r22", "r20", "r31", "memory"
 /* String constant for -EAGAIN.  */
 #define _ASM_EAGAIN "-11"
 /* String constant for -EDEADLOCK.  */
@@ -63,25 +63,23 @@ typedef uintmax_t uatomic_max_t;
 /* The only basic operation needed is compare and exchange.  */
 # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) 	\
   ({									\
-     volatile int lws_errno;						\
-     volatile int lws_ret;						\
+     register int lws_errno asm("r21");					\
+     register int lws_ret asm("r28");					\
+     register unsigned long lws_mem asm("r26") = (unsigned long)(mem);	\
+     register unsigned long lws_old asm("r25") = (unsigned long)(oldval);\
+     register unsigned long lws_new asm("r24") = (unsigned long)(newval);\
      asm volatile(							\
 	"0:					\n\t"			\
-	"copy	%2, %%r26			\n\t"			\
-	"copy	%3, %%r25			\n\t"			\
-	"copy	%4, %%r24			\n\t"			\
 	"ble	" _LWS "(%%sr2, %%r0)		\n\t"			\
 	"ldi	" _LWS_CAS ", %%r20		\n\t"			\
-	"ldi	" _ASM_EAGAIN ", %%r24		\n\t"			\
-	"cmpb,=,n %%r24, %%r21, 0b		\n\t"			\
+	"ldi	" _ASM_EAGAIN ", %%r20		\n\t"			\
+	"cmpb,=,n %%r20, %%r21, 0b		\n\t"			\
 	"nop					\n\t"			\
-	"ldi	" _ASM_EDEADLOCK ", %%r25	\n\t"			\
-	"cmpb,=,n %%r25, %%r21, 0b		\n\t"			\
+	"ldi	" _ASM_EDEADLOCK ", %%r20	\n\t"			\
+	"cmpb,=,n %%r20, %%r21, 0b		\n\t"			\
 	"nop					\n\t"			\
-	"stw	%%r28, %0			\n\t"			\
-	"stw	%%r21, %1			\n\t"			\
-	: "=m" (lws_ret), "=m" (lws_errno) 				\
-        : "r" (mem), "r" (oldval), "r" (newval)				\
+	: "=r" (lws_ret), "=r" (lws_errno)		 		\
+        : "r" (lws_mem), "r" (lws_old), "r" (lws_new)			\
 	: _LWS_CLOBBER							\
      );									\
     									\
Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/hppa/sysdep.h
===================================================================
--- glibc-2.19.orig/ports/sysdeps/unix/sysv/linux/hppa/sysdep.h
+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/hppa/sysdep.h
@@ -361,9 +361,10 @@ L(pre_end):					ASM_LINE_SEP	\
 ({									\
 	long __sys_res;							\
 	{								\
+		LOAD_ARGS_##nr(args)					\
 		register unsigned long __res asm("r28");		\
 		PIC_REG_DEF						\
-		LOAD_ARGS_##nr(args)					\
+		LOAD_REGS_##nr						\
 		/* FIXME: HACK save/load r19 around syscall */		\
 		asm volatile(						\
 			SAVE_ASM_PIC					\
@@ -407,9 +408,10 @@ L(pre_end):					ASM_LINE_SEP	\
 ({									\
 	long __sys_res;							\
 	{								\
+		LOAD_ARGS_##nr(args)					\
 		register unsigned long __res asm("r28");		\
 		PIC_REG_DEF						\
-		LOAD_ARGS_##nr(args)					\
+		LOAD_REGS_##nr						\
 		/* FIXME: HACK save/load r19 around syscall */		\
 		asm volatile(						\
 			SAVE_ASM_PIC					\
@@ -432,9 +434,10 @@ L(pre_end):					ASM_LINE_SEP	\
 ({									\
 	long __sys_res;							\
 	{								\
+		LOAD_ARGS_##nr(args)					\
 		register unsigned long __res asm("r28");		\
 		PIC_REG_DEF						\
-		LOAD_ARGS_##nr(args)					\
+		LOAD_REGS_##nr						\
 		/* FIXME: HACK save/load r19 around syscall */		\
 		asm volatile(						\
 			SAVE_ASM_PIC					\
@@ -453,24 +456,43 @@ L(pre_end):					ASM_LINE_SEP	\
 
 
 #define LOAD_ARGS_0()
-#define LOAD_ARGS_1(r26)						\
-  register unsigned long __r26 __asm__("r26") = (unsigned long)(r26);	\
+#define LOAD_REGS_0
+#define LOAD_ARGS_1(a1)							\
+  register unsigned long __x26 = (unsigned long)(a1);			\
   LOAD_ARGS_0()
-#define LOAD_ARGS_2(r26,r25)						\
-  register unsigned long __r25 __asm__("r25") = (unsigned long)(r25);	\
-  LOAD_ARGS_1(r26)
-#define LOAD_ARGS_3(r26,r25,r24)					\
-  register unsigned long __r24 __asm__("r24") = (unsigned long)(r24);	\
-  LOAD_ARGS_2(r26,r25)
-#define LOAD_ARGS_4(r26,r25,r24,r23)					\
-  register unsigned long __r23 __asm__("r23") = (unsigned long)(r23);	\
-  LOAD_ARGS_3(r26,r25,r24)
-#define LOAD_ARGS_5(r26,r25,r24,r23,r22)				\
-  register unsigned long __r22 __asm__("r22") = (unsigned long)(r22);	\
-  LOAD_ARGS_4(r26,r25,r24,r23)
-#define LOAD_ARGS_6(r26,r25,r24,r23,r22,r21)				\
-  register unsigned long __r21 __asm__("r21") = (unsigned long)(r21);	\
-  LOAD_ARGS_5(r26,r25,r24,r23,r22)
+#define LOAD_REGS_1							\
+  register unsigned long __r26 __asm__("r26") = __x26;			\
+  LOAD_REGS_0
+#define LOAD_ARGS_2(a1,a2)						\
+  register unsigned long __x25 = (unsigned long)(a2);			\
+  LOAD_ARGS_1(a1)
+#define LOAD_REGS_2							\
+  register unsigned long __r25 __asm__("r25") = __x25;			\
+  LOAD_REGS_1
+#define LOAD_ARGS_3(a1,a2,a3)						\
+  register unsigned long __x24 = (unsigned long)(a3);			\
+  LOAD_ARGS_2(a1,a2)
+#define LOAD_REGS_3							\
+  register unsigned long __r24 __asm__("r24") = __x24;			\
+  LOAD_REGS_2
+#define LOAD_ARGS_4(a1,a2,a3,a4)					\
+  register unsigned long __x23 = (unsigned long)(a4);			\
+  LOAD_ARGS_3(a1,a2,a3)
+#define LOAD_REGS_4							\
+  register unsigned long __r23 __asm__("r23") = __x23;			\
+  LOAD_REGS_3
+#define LOAD_ARGS_5(a1,a2,a3,a4,a5)					\
+  register unsigned long __x22 = (unsigned long)(a5);			\
+  LOAD_ARGS_4(a1,a2,a3,a4)
+#define LOAD_REGS_5							\
+  register unsigned long __r22 __asm__("r22") = __x22;			\
+  LOAD_REGS_4
+#define LOAD_ARGS_6(a1,a2,a3,a4,a5,a6)					\
+  register unsigned long __x21 = (unsigned long)(a6);			\
+  LOAD_ARGS_5(a1,a2,a3,a4,a5)
+#define LOAD_REGS_6							\
+  register unsigned long __r21 __asm__("r21") = __x21;			\
+  LOAD_REGS_5
 
 /* Even with zero args we use r20 for the syscall number */
 #define ASM_ARGS_0
Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/hppa/sysdep.c
===================================================================
--- glibc-2.19.orig/ports/sysdeps/unix/sysv/linux/hppa/sysdep.c
+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/hppa/sysdep.c
@@ -56,9 +56,10 @@ syscall (long int __sysno, ...)
   va_end (args);
 
   {
+    LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5)
     register unsigned long int __res asm("r28");
     PIC_REG_DEF
-    LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5)
+    LOAD_REGS_6
     asm volatile (SAVE_ASM_PIC
 		  "	ble  0x100(%%sr2, %%r0)	\n"
 		  "	copy %1, %%r20		\n"

--- End Message ---
--- Begin Message ---
Source: glibc
Source-Version: 2.21-0experimental3

We believe that the bug you reported is fixed in the latest version of
glibc, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 799478@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Aurelien Jarno <aurel32@debian.org> (supplier of updated glibc package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


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

Format: 1.8
Date: Sun, 22 Nov 2015 19:37:39 +0100
Source: glibc
Binary: libc-bin libc-dev-bin libc-l10n glibc-doc glibc-source locales locales-all nscd multiarch-support libc6 libc6-dev libc6-dbg libc6-pic libc6-udeb libc6.1 libc6.1-dev libc6.1-dbg libc6.1-pic libc6.1-udeb libc0.3 libc0.3-dev libc0.3-dbg libc0.3-pic libc0.3-udeb libc0.1 libc0.1-dev libc0.1-dbg libc0.1-pic libc0.1-udeb libc6-i386 libc6-dev-i386 libc6-sparc libc6-dev-sparc libc6-sparc64 libc6-dev-sparc64 libc6-s390 libc6-dev-s390 libc6-amd64 libc6-dev-amd64 libc6-powerpc libc6-dev-powerpc libc6-ppc64 libc6-dev-ppc64 libc6-mips32 libc6-dev-mips32 libc6-mipsn32 libc6-dev-mipsn32 libc6-mips64 libc6-dev-mips64 libc0.1-i386 libc0.1-dev-i386 libc6-x32 libc6-dev-x32 libc6-i686 libc6-xen libc0.1-i686 libc0.3-i686 libc0.3-xen libc6.1-alphaev67 libnss-dns-udeb libnss-files-udeb
Architecture: source
Version: 2.21-0experimental3
Distribution: experimental
Urgency: medium
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Changed-By: Aurelien Jarno <aurel32@debian.org>
Description:
 glibc-doc  - GNU C Library: Documentation
 glibc-source - GNU C Library: sources
 libc-bin   - GNU C Library: Binaries
 libc-dev-bin - GNU C Library: Development binaries
 libc-l10n  - GNU C Library: localization files
 libc0.1    - GNU C Library: Shared libraries
 libc0.1-dbg - GNU C Library: detached debugging symbols
 libc0.1-dev - GNU C Library: Development Libraries and Header Files
 libc0.1-dev-i386 - GNU C Library: 32bit development libraries for AMD64
 libc0.1-i386 - GNU C Library: 32bit shared libraries for AMD64
 libc0.1-i686 - GNU C Library: Shared libraries [i686 optimized]
 libc0.1-pic - GNU C Library: PIC archive library
 libc0.1-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libc0.3    - GNU C Library: Shared libraries
 libc0.3-dbg - GNU C Library: detached debugging symbols
 libc0.3-dev - GNU C Library: Development Libraries and Header Files
 libc0.3-i686 - GNU C Library: Shared libraries [i686 optimized]
 libc0.3-pic - GNU C Library: PIC archive library
 libc0.3-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libc0.3-xen - GNU C Library: Shared libraries [Xen version]
 libc6      - GNU C Library: Shared libraries
 libc6-amd64 - GNU C Library: 64bit Shared libraries for AMD64
 libc6-dbg  - GNU C Library: detached debugging symbols
 libc6-dev  - GNU C Library: Development Libraries and Header Files
 libc6-dev-amd64 - GNU C Library: 64bit Development Libraries for AMD64
 libc6-dev-i386 - GNU C Library: 32-bit development libraries for AMD64
 libc6-dev-mips32 - GNU C Library: o32 Development Libraries for MIPS
 libc6-dev-mips64 - GNU C Library: 64bit Development Libraries for MIPS64
 libc6-dev-mipsn32 - GNU C Library: n32 Development Libraries for MIPS64
 libc6-dev-powerpc - GNU C Library: 32bit powerpc development libraries for ppc64
 libc6-dev-ppc64 - GNU C Library: 64bit Development Libraries for PowerPC64
 libc6-dev-s390 - GNU C Library: 32bit Development Libraries for IBM zSeries
 libc6-dev-sparc - GNU C Library: 32bit Development Libraries for SPARC
 libc6-dev-sparc64 - GNU C Library: 64bit Development Libraries for UltraSPARC
 libc6-dev-x32 - GNU C Library: X32 ABI Development Libraries for AMD64
 libc6-i386 - GNU C Library: 32-bit shared libraries for AMD64
 libc6-i686 - GNU C Library: Shared libraries [i686 optimized]
 libc6-mips32 - GNU C Library: o32 Shared libraries for MIPS
 libc6-mips64 - GNU C Library: 64bit Shared libraries for MIPS64
 libc6-mipsn32 - GNU C Library: n32 Shared libraries for MIPS64
 libc6-pic  - GNU C Library: PIC archive library
 libc6-powerpc - GNU C Library: 32bit powerpc shared libraries for ppc64
 libc6-ppc64 - GNU C Library: 64bit Shared libraries for PowerPC64
 libc6-s390 - GNU C Library: 32bit Shared libraries for IBM zSeries
 libc6-sparc - GNU C Library: 32bit Shared libraries for SPARC
 libc6-sparc64 - GNU C Library: 64bit Shared libraries for UltraSPARC
 libc6-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libc6-x32  - GNU C Library: X32 ABI Shared libraries for AMD64
 libc6-xen  - GNU C Library: Shared libraries [Xen version]
 libc6.1    - GNU C Library: Shared libraries
 libc6.1-alphaev67 - GNU C Library: Shared libraries (EV67 optimized)
 libc6.1-dbg - GNU C Library: detached debugging symbols
 libc6.1-dev - GNU C Library: Development Libraries and Header Files
 libc6.1-pic - GNU C Library: PIC archive library
 libc6.1-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libnss-dns-udeb - GNU C Library: NSS helper for DNS - udeb (udeb)
 libnss-files-udeb - GNU C Library: NSS helper for files - udeb (udeb)
 locales    - GNU C Library: National Language (locale) data [support]
 locales-all - GNU C Library: Precompiled locale data
 multiarch-support - Transitional package to ensure multiarch compatibility
 nscd       - GNU C Library: Name Service Cache Daemon
Closes: 712074 722885 753909 793641 799478 805730
Changes:
 glibc (2.21-0experimental3) experimental; urgency=medium
 .
   [ Aurelien Jarno ]
   * patches/hppa/cvs-allocatestack-stacktop.diff: new patch from upstream
     to fix a set-but-unused warning in nptl/allocatestack.c, causing a
     build failure.
   * patches/hppa/local-stack-grows-up.diff: rebase.
   * patches/any/cvs-tls-dtv.diff: new patch from upstream to fix fix DTV race,
     assert, and DTV_SURPLUS Static TLS limit.  This also reduces the failure
     rate of nptl/tst-stack4.  Closes: #793641.
   * Add expected testsuite result for mips64el:
     - testsuite-checking/expected-results-mips64el-linux-gnu-libc
     - testsuite-checking/expected-results-mips64el-linux-gnuabin32-mipsn32
     - testsuite-checking/expected-results-mipsel-linux-gnu-mips32
   * patches/kfreebsd/local-sysdeps.diff, patches/kfreebsd/local-fbtl.diff:
     update to revision 5844 (from glibc-bsd):
     - Update to glibc 2.21.
     - Define F_DUP2FD_CLOEXEC.  Closes: #712074.
     - Define SOCK_CLOEXEC and SOCK_NONBLOCK.
     - Wire-up accept4.  Closes: #722885.
   * sysdeps/kfreebsd-{amd64,i386}.mk: configure with --disable-werror.
   * patches/kfreebsd/local-nscd-no-sockcloexec.diff: Drop.
   * patches/kfreebsd/local-getaddrinfo-freebsd-kernel.diff: improve and remove
     a warning.
   * patches/kfreebsd/local-tst-auxv.diff: new patch to disable AT_EXECFN
     testing in tst-auxv when it is not defined.
   * patches/any/cvs-rfc3542-advanced-api.diff: new patch from usptream to
     add missing Advanced API (RFC3542) (1) defines.  Closes: #753909.
   * debian/rules: don't put debug files from libc0.1-i386 and libc6-mips32
     into libc0.1-dbg or libc6-dbg.
   * patches/hppa/cvs-atomic.diff, patches/hppa/cvs-inline-syscall.diff: new
     patches from upstream to improve atomic and inline syscalls on HPPA
     (closes: #799478).
   * rules.d/build.mk: don't run the testsuite with make -k, as a build
     failure in the testsuite, otherwise build failures cause the regression
     comparison to be entirely skipped.
   * testsuite-checking/expected-results-*kfreebsd-gnu-*: update testsuite
     results.
   * patches/any/cvs-check-localplt.diff: new patch from upstream to fix
     check-localplt test with recent binutils version on x86.
   * patches/hppa/submitted-gmon-start.diff: new patch from upstream to
     fix __gmon_start__ symbol proliferation on hppa.  Closes: #805730.
   * Update from upstream stable branch:
     - patches/any/cvs-make-typo.diff: Merged.
     - Fix FTBFS with libselinux 2.4.
 .
   [ Samuel Thibault ]
   * patches/hurd-i386/tg-pagesize.diff: Refresh.
   * patches/hurd-i386/submitted-handle-eprototype.diff: Refresh.
   * patches/hurd-i386/tg-posix_thread.diff: Update, to define
     _POSIX_THREAD_KEYS_MAX, _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
     _POSIX_THREAD_THREADS_MAX.
Checksums-Sha1:
 0776d55cdf6697af1d026667ab5f1fd3f9f35779 8250 glibc_2.21-0experimental3.dsc
 d77f23e894be85f2e1731d4114bf6993dbbea815 1008348 glibc_2.21-0experimental3.debian.tar.xz
Checksums-Sha256:
 c40d9393b8e59f1e8810e3c15913d9d3fedfa77ce03a2274e8a4cfcc094e56e7 8250 glibc_2.21-0experimental3.dsc
 b36b5791f3b4dd37d8933f35c7522fa27d50a585726f3a3a4baf19ad07269408 1008348 glibc_2.21-0experimental3.debian.tar.xz
Files:
 c040f519e85115b32436c516ee3d4b24 8250 libs required glibc_2.21-0experimental3.dsc
 dae5ef0bd39560199bb5d508c4d19cb0 1008348 libs required glibc_2.21-0experimental3.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJWUguvAAoJELqceAYd3YybWFoQAJBw6R5lunzcb1VWp264GsIH
1NSHjLYGY8AkfVMrDN+7AnS0ToEejXej1Iw0LiLGeYAgShqtZcxMVlFWJuXK7/cx
9VR0h2RYwtj4Y7GtZUiyMoKayEq9uWWaw/9OMiq15qQ+yelX36rKNiJmcBWnvTwh
8nKKiV61t04/mH7Zq8coMVLXI+JXbEhGlFDvo4iNfk8JRFzVlGtw8Y9hncl1e+6F
t2JuYB4is4z4T5HYPIDMpoJezTrN3NCGp7KZV74uCOwECaKixY35W9qu6IAxsheS
OB3JQkw4kSJDUVIn4oxmMvXDTkMOJw2rd1su/9cBX46AVUkdwuYb0kS7zJfQbT3t
An/LRjZz4efPppAoM/yjqEvdvQhT9lx+cifjLG+8vOYJXEtgc8c+8DOFdb6CAJ1h
031TAc/MXdoNjWoSWKRwQgg96lPX4ppToI3HHqmBkX5iG8wgVeiXdOSZVGiRYA4k
WhOTxDU61+d35xEFZ+cEDK7ZAfEb7iS+eQRnrj8Q8kvmvOC7qtfLJBljtQyqQZpv
bGwzMzeCGacnAycXG6iC+Zt+HRkvJOo1X3CsJLbQkncUfj4wuCzxTbfTI5nCBO+8
S4GqBOafkOaBy9GBVdGXIXhU3DLPAtw3so2Pga4kqA/Er13YGxoLpzb+nG63IGMY
0RmELy+DCiwez6uKgcxY
=838v
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: