public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 07/12] aarch64: fix syscalls for BTI
Date: Mon, 11 May 2020 12:46:03 +0100	[thread overview]
Message-ID: <20200511114602.GH7649@arm.com> (raw)
In-Reply-To: <42ffecdd-31b4-d8a3-4832-eb0d187e0c33@linaro.org>

The 05/07/2020 16:40, Adhemerval Zanella via Libc-alpha wrote:
> > +#include <sysdep.h>
> > +PSEUDO (__umount2, umount2, 2)
> > +	ret
> > +PSEUDO_END(__umount2)
> > +weak_alias (__umount2, umount2)
> > +END_FILE
> 
> I think it is better to adapt the linux umount2.S to a C file instead of
> adding another arch-specific implementation.  Only alpha and ia64 do
> not support __NR_umount2 (exported as __NR_umount), but recent kernel
> fixes (74cd2184833f for ia64, 12b57c5c70f39 for alpha) add the alias.
> So we can use __NR_umount without the need to check its definition:

yes i think this is a useful thing to do
(independently of aarch64 bti work).

doesn't the patch add new umount2 symbol on
ia64 and alpha though?

> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 0326f92c40..62ac921e8f 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -54,7 +54,7 @@ CFLAGS-malloc.c += -DMORECORE_CLEARS=2
>  endif
>  
>  ifeq ($(subdir),misc)
> -sysdep_routines += adjtimex clone umount umount2 readahead sysctl \
> +sysdep_routines += adjtimex clone umount readahead sysctl \
>  		   setfsuid setfsgid epoll_pwait signalfd \
>  		   eventfd eventfd_read eventfd_write prlimit \
>  		   personality epoll_wait tee vmsplice splice \
> diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list
> index 56f4138c43..bd39441d3c 100644
> --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list
> +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list
> @@ -1,7 +1,5 @@
>  # File name	Caller	Syscall name	# args	Strong name	Weak names
>  
> -umount2		-	umount		2	__umount2	umount2
> -
>  getpriority	-	getpriority	i:ii	__getpriority	getpriority
>  
>  # proper socket implementations:
> diff --git a/sysdeps/unix/sysv/linux/umount.c b/sysdeps/unix/sysv/linux/umount.c
> index ab6a20f596..cdc8759118 100644
> --- a/sysdeps/unix/sysv/linux/umount.c
> +++ b/sysdeps/unix/sysv/linux/umount.c
> @@ -16,12 +16,17 @@
>     License along with the GNU C Library.  If not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -/* Since the generic Linux syscall ABI doesn't have an oldumount system call,
> -   do what the kernel does down here.  */
> +#include <sys/mount.h>
> +#include <sysdep.h>
>  
> -extern long int __umount2 (const char *name, int flags);
> +int
> +__umount2 (const char *special_file, int flags)
> +{
> +  return INLINE_SYSCALL_CALL (umount2, special_file, flags);
> +}
> +weak_alias (__umount2, umount2)
>  
> -long int
> +int
>  __umount (const char *name)
>  {
>    return __umount2 (name, 0);
> diff --git a/sysdeps/unix/sysv/linux/umount2.S b/sysdeps/unix/sysv/linux/umount2.S
> deleted file mode 100644
> index 92241bbf97..0000000000
> --- a/sysdeps/unix/sysv/linux/umount2.S
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -/* umount system call with two parameters.  */
> -
> -#include <sysdep.h>
> -#if defined __NR_oldumount || defined __NR_umount2
> -#ifdef __NR_oldumount
> -PSEUDO (__umount2, umount, 2)
> -#else
> -PSEUDO (__umount2, umount2, 2)
> -#endif
> -	ret
> -PSEUDO_END(__umount2)
> -weak_alias (__umount2, umount2)
> -#endif
> 
> 

-- 

  reply	other threads:[~2020-05-11 11:46 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 17:34 [PATCH 00/12] aarch64: branch protection support Szabolcs Nagy
2020-04-30 17:37 ` [PATCH 01/12] elf.h: Add PT_GNU_PROPERTY Szabolcs Nagy
2020-05-07 14:49   ` Adhemerval Zanella
2020-04-30 17:37 ` [PATCH 02/12] elf.h: add aarch64 property definitions Szabolcs Nagy
2020-05-07 14:50   ` Adhemerval Zanella
2020-04-30 17:39 ` [PATCH 03/12] aarch64: Add BTI landing pads to assembly code Szabolcs Nagy
2020-05-07 16:55   ` Adhemerval Zanella
2020-05-11 11:38     ` Szabolcs Nagy
2020-05-11 19:13       ` Adhemerval Zanella
2020-04-30 17:40 ` [PATCH 04/12] aarch64: Rename place holder .S files to .c Szabolcs Nagy
2020-05-07 18:29   ` Adhemerval Zanella
2020-04-30 17:41 ` [PATCH 05/12] aarch64: fix swapcontext for BTI Szabolcs Nagy
2020-05-07 18:42   ` Adhemerval Zanella
2020-04-30 17:42 ` [PATCH 06/12] aarch64: fix RTLD_START " Szabolcs Nagy
2020-05-07 18:49   ` Adhemerval Zanella
2020-05-07 19:24     ` Szabolcs Nagy
2020-05-07 19:55       ` Adhemerval Zanella
2020-05-07 20:14         ` Szabolcs Nagy
2020-05-07 20:20           ` Adhemerval Zanella
2020-04-30 17:42 ` [PATCH 07/12] aarch64: fix syscalls " Szabolcs Nagy
2020-05-07 19:40   ` Adhemerval Zanella
2020-05-11 11:46     ` Szabolcs Nagy [this message]
2020-04-30 17:43 ` [PATCH 08/12] Rewrite abi-note.S in C Szabolcs Nagy
2020-04-30 20:07   ` Zack Weinberg
2020-05-01  9:23     ` Szabolcs Nagy
2020-05-01 14:07       ` Zack Weinberg
2020-04-30 17:44 ` [PATCH 09/12] aarch64: support BTI enabled binaries Szabolcs Nagy
2020-05-07 21:07   ` Adhemerval Zanella
2020-05-11 11:04     ` Szabolcs Nagy
2020-05-11 18:38       ` Adhemerval Zanella
2020-04-30 17:44 ` [PATCH 10/12] aarch64: Add pac-ret support to asm files Szabolcs Nagy
2020-05-08 16:59   ` Adhemerval Zanella
2020-05-11  8:27     ` Szabolcs Nagy
2020-05-11 18:39       ` Adhemerval Zanella
2020-04-30 17:45 ` [PATCH 11/12] aarch64: redefine RETURN_ADDRESS to strip PAC Szabolcs Nagy
2020-05-08 17:44   ` Adhemerval Zanella
2020-05-11 12:38     ` Szabolcs Nagy
2020-05-11 19:15       ` Adhemerval Zanella
2020-05-11 19:21         ` Florian Weimer
2020-05-11 20:13           ` Adhemerval Zanella
2020-05-11 20:18             ` Florian Weimer
2020-05-11 19:22   ` Florian Weimer
2020-05-11 20:45     ` Adhemerval Zanella
2020-05-12  8:42     ` Szabolcs Nagy
2020-04-30 17:45 ` [PATCH 12/12] aarch64: Configure option to build glibc with branch protection Szabolcs Nagy
2020-04-30 19:02   ` Joseph Myers
2020-05-08 17:53   ` Adhemerval Zanella
2020-05-04 11:27 ` [PATCH 00/12] aarch64: branch protection support Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200511114602.GH7649@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).