Message ID | 1478012867-6031-2-git-send-email-andreas@gaisler.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 79303 invoked by alias); 1 Nov 2016 15:08:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 79289 invoked by uid 89); 1 Nov 2016 15:08:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=H*Ad:U*davem, H*MI:sk:1478012, H*F:U*andreas, Hx-spam-relays-external:ESMTPA X-HELO: bin-vsp-out-03.atm.binero.net X-Halon-ID: 0b81d735-a045-11e6-99f1-0050569116f7 Authorized-sender: andreas@gaisler.com From: Andreas Larsson <andreas@gaisler.com> To: GNU C Library <libc-alpha@sourceware.org> Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>, Carlos O'Donell <carlos@redhat.com>, David Miller <davem@davemloft.net>, Torvald Riegel <triegel@redhat.com>, software@gaisler.com Subject: [RFC][PATCH 1/2] sparc32: Mark sendmsg and recvmsg system calls as unsupported Date: Tue, 1 Nov 2016 16:07:46 +0100 Message-Id: <1478012867-6031-2-git-send-email-andreas@gaisler.com> In-Reply-To: <1478012867-6031-1-git-send-email-andreas@gaisler.com> References: <1478012867-6031-1-git-send-email-andreas@gaisler.com> |
Commit Message
Andreas Larsson
Nov. 1, 2016, 3:07 p.m. UTC
This fixes a bug introduced by abf29edd4a3918 that missed fixing up sparc32 in the change. * sysdeps/unix/sysv/linux/sparc/kernel-features.h: Undefine __ASSUME_SENDMSG_SYSCALL and __ASSUME_RECVMSG_SYSCALL for 32-bit sparcv8 --- sysdeps/unix/sysv/linux/sparc/kernel-features.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On 01/11/2016 13:07, Andreas Larsson wrote: > This fixes a bug introduced by abf29edd4a3918 that missed fixing up > sparc32 in the change. > > * sysdeps/unix/sysv/linux/sparc/kernel-features.h: Undefine > __ASSUME_SENDMSG_SYSCALL and __ASSUME_RECVMSG_SYSCALL for 32-bit > sparcv8 > --- > sysdeps/unix/sysv/linux/sparc/kernel-features.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h > index 69c9c7c..db3f5cd 100644 > --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h > @@ -32,8 +32,10 @@ > #include_next <kernel-features.h> > > /* 32-bit SPARC kernels do not support > - futex_atomic_cmpxchg_inatomic. */ > + futex_atomic_cmpxchg_inatomic or sendmsg/recvmsg. */ > #if !defined __arch64__ && !defined __sparc_v9__ > # undef __ASSUME_REQUEUE_PI > # undef __ASSUME_SET_ROBUST_LIST > +# undef __ASSUME_SENDMSG_SYSCALL > +# undef __ASSUME_RECVMSG_SYSCALL > #endif > At least the kernel headers for Linux 3.2 on sparc defined both __NR_recvmsg and __NR_sendmsg. Also, checking 'arch/sparc/kernel/sys32.S' on 3.2 does seems that sparc32 have both recvmsg and sendmsg wire-up. Am I missing something here?
On 2016-11-01 18:28, Adhemerval Zanella wrote: > > > On 01/11/2016 13:07, Andreas Larsson wrote: >> This fixes a bug introduced by abf29edd4a3918 that missed fixing up >> sparc32 in the change. >> >> * sysdeps/unix/sysv/linux/sparc/kernel-features.h: Undefine >> __ASSUME_SENDMSG_SYSCALL and __ASSUME_RECVMSG_SYSCALL for 32-bit >> sparcv8 >> --- >> sysdeps/unix/sysv/linux/sparc/kernel-features.h | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h >> index 69c9c7c..db3f5cd 100644 >> --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h >> +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h >> @@ -32,8 +32,10 @@ >> #include_next <kernel-features.h> >> >> /* 32-bit SPARC kernels do not support >> - futex_atomic_cmpxchg_inatomic. */ >> + futex_atomic_cmpxchg_inatomic or sendmsg/recvmsg. */ >> #if !defined __arch64__ && !defined __sparc_v9__ >> # undef __ASSUME_REQUEUE_PI >> # undef __ASSUME_SET_ROBUST_LIST >> +# undef __ASSUME_SENDMSG_SYSCALL >> +# undef __ASSUME_RECVMSG_SYSCALL >> #endif >> > > At least the kernel headers for Linux 3.2 on sparc defined both __NR_recvmsg > and __NR_sendmsg. Also, checking 'arch/sparc/kernel/sys32.S' on 3.2 does > seems that sparc32 have both recvmsg and sendmsg wire-up. Am I missing > something here? [resent to correct topic - I should apparently stay away from my mail client today] Linux kernel commit 8b30ca73b7cc7f2177cfc4e8274d2ebdba328cd5 added sys_sendmsg and sys_recvmsg to the sys_call_table in arch/sparc/kernel/systbls_32.S. So sparc32 kernels prior to Linux 4.4 do not support them as straight up system calls. Best regards, Andreas Larsson
On 02/11/2016 09:35, Andreas Larsson wrote: > On 2016-11-01 18:28, Adhemerval Zanella wrote: >> >> >> On 01/11/2016 13:07, Andreas Larsson wrote: >>> This fixes a bug introduced by abf29edd4a3918 that missed fixing up >>> sparc32 in the change. >>> >>> * sysdeps/unix/sysv/linux/sparc/kernel-features.h: Undefine >>> __ASSUME_SENDMSG_SYSCALL and __ASSUME_RECVMSG_SYSCALL for 32-bit >>> sparcv8 >>> --- >>> sysdeps/unix/sysv/linux/sparc/kernel-features.h | 4 +++- >>> 1 file changed, 3 insertions(+), 1 deletion(-) >>> >>> diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h >>> index 69c9c7c..db3f5cd 100644 >>> --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h >>> +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h >>> @@ -32,8 +32,10 @@ >>> #include_next <kernel-features.h> >>> >>> /* 32-bit SPARC kernels do not support >>> - futex_atomic_cmpxchg_inatomic. */ >>> + futex_atomic_cmpxchg_inatomic or sendmsg/recvmsg. */ >>> #if !defined __arch64__ && !defined __sparc_v9__ >>> # undef __ASSUME_REQUEUE_PI >>> # undef __ASSUME_SET_ROBUST_LIST >>> +# undef __ASSUME_SENDMSG_SYSCALL >>> +# undef __ASSUME_RECVMSG_SYSCALL >>> #endif >>> >> >> At least the kernel headers for Linux 3.2 on sparc defined both __NR_recvmsg >> and __NR_sendmsg. Also, checking 'arch/sparc/kernel/sys32.S' on 3.2 does >> seems that sparc32 have both recvmsg and sendmsg wire-up. Am I missing >> something here? > > [resent to correct topic - I should apparently stay away from my mail client today] > > Linux kernel commit 8b30ca73b7cc7f2177cfc4e8274d2ebdba328cd5 added > sys_sendmsg and sys_recvmsg to the sys_call_table in > arch/sparc/kernel/systbls_32.S. So sparc32 kernels prior to Linux 4.4 do > not support them as straight up system calls. > > Best regards, > Andreas Larsson Right, so it is advertise to userland through __SYS/__NR macros even though it is not really supported? Even though, I think a better solution would be: /* All direct socketcalls are available only with kernel 4.4. */ #if __LINUX_KERNEL_VERSION < 0x040400 # undef __ASSUME_SENDMSG_SYSCALL # undef __ASSUME_RECVMSG_SYSCALL #endif
From: Andreas Larsson <andreas@gaisler.com> Date: Tue, 1 Nov 2016 16:07:46 +0100 > @@ -32,8 +32,10 @@ > #include_next <kernel-features.h> > > /* 32-bit SPARC kernels do not support > - futex_atomic_cmpxchg_inatomic. */ > + futex_atomic_cmpxchg_inatomic or sendmsg/recvmsg. */ > #if !defined __arch64__ && !defined __sparc_v9__ > # undef __ASSUME_REQUEUE_PI > # undef __ASSUME_SET_ROBUST_LIST > +# undef __ASSUME_SENDMSG_SYSCALL > +# undef __ASSUME_RECVMSG_SYSCALL > #endif As mentioned elsewhere, these are available on 4.4. and later kernels.
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index 69c9c7c..db3f5cd 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -32,8 +32,10 @@ #include_next <kernel-features.h> /* 32-bit SPARC kernels do not support - futex_atomic_cmpxchg_inatomic. */ + futex_atomic_cmpxchg_inatomic or sendmsg/recvmsg. */ #if !defined __arch64__ && !defined __sparc_v9__ # undef __ASSUME_REQUEUE_PI # undef __ASSUME_SET_ROBUST_LIST +# undef __ASSUME_SENDMSG_SYSCALL +# undef __ASSUME_RECVMSG_SYSCALL #endif