All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [v2] ARM: oabi-compat: fix epoll_ctl build failure
@ 2020-04-29 13:23 ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2020-04-29 13:23 UTC (permalink / raw)
  To: Russell King
  Cc: Arnd Bergmann, Christoph Hellwig, Russell King, linux-arm-kernel,
	linux-kernel, linux-api

Two functions are not declared or defined when CONFIG_EPOLL is
disabled:

arch/arm/kernel/sys_oabi-compat.c: In function 'sys_oabi_epoll_ctl':
arch/arm/kernel/sys_oabi-compat.c:258:6: error: implicit declaration of function 'ep_op_has_event' [-Werror=implicit-function-declaration]
  258 |  if (ep_op_has_event(op) &&
      |      ^~~~~~~~~~~~~~~
arch/arm/kernel/sys_oabi-compat.c:265:9: error: implicit declaration of function 'do_epoll_ctl'; did you mean 'sys_epoll_ctl'? [-Werror=implicit-function-declaration]
  265 |  return do_epoll_ctl(epfd, op, fd, &kernel, false);
      |         ^~~~~~~~~~~~
      |         sys_epoll_ctl

Replace the function with the sys_ni_syscall stub in this case.

Fixes: c281634c8652 ("ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v2: use sys_ni_syscall() instead of removing the function body
---
 arch/arm/kernel/sys_oabi-compat.c | 2 ++
 kernel/sys_ni.c                   | 1 +
 2 files changed, 3 insertions(+)

diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
index 85a1e95341d8..2488c69242cf 100644
--- a/arch/arm/kernel/sys_oabi-compat.c
+++ b/arch/arm/kernel/sys_oabi-compat.c
@@ -249,6 +249,7 @@ struct oabi_epoll_event {
 	__u64 data;
 } __attribute__ ((packed,aligned(4)));
 
+#ifdef CONFIG_EPOLL
 asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
 				   struct oabi_epoll_event __user *event)
 {
@@ -264,6 +265,7 @@ asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
 
 	return do_epoll_ctl(epfd, op, fd, &kernel, false);
 }
+#endif
 
 asmlinkage long sys_oabi_epoll_wait(int epfd,
 				    struct oabi_epoll_event __user *events,
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 42ce28c460f6..9ee6a46b1795 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -68,6 +68,7 @@ COND_SYSCALL(epoll_create1);
 COND_SYSCALL(epoll_ctl);
 COND_SYSCALL(epoll_pwait);
 COND_SYSCALL_COMPAT(epoll_pwait);
+COND_SYSCALL(oabi_epoll_ctl); /* ARM OABI specific */
 
 /* fs/fcntl.c */
 
-- 
2.26.0


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

* [PATCH] [v2] ARM: oabi-compat: fix epoll_ctl build failure
@ 2020-04-29 13:23 ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2020-04-29 13:23 UTC (permalink / raw)
  To: Russell King
  Cc: Arnd Bergmann, linux-api, linux-kernel, Russell King,
	Christoph Hellwig, linux-arm-kernel

Two functions are not declared or defined when CONFIG_EPOLL is
disabled:

arch/arm/kernel/sys_oabi-compat.c: In function 'sys_oabi_epoll_ctl':
arch/arm/kernel/sys_oabi-compat.c:258:6: error: implicit declaration of function 'ep_op_has_event' [-Werror=implicit-function-declaration]
  258 |  if (ep_op_has_event(op) &&
      |      ^~~~~~~~~~~~~~~
arch/arm/kernel/sys_oabi-compat.c:265:9: error: implicit declaration of function 'do_epoll_ctl'; did you mean 'sys_epoll_ctl'? [-Werror=implicit-function-declaration]
  265 |  return do_epoll_ctl(epfd, op, fd, &kernel, false);
      |         ^~~~~~~~~~~~
      |         sys_epoll_ctl

Replace the function with the sys_ni_syscall stub in this case.

Fixes: c281634c8652 ("ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v2: use sys_ni_syscall() instead of removing the function body
---
 arch/arm/kernel/sys_oabi-compat.c | 2 ++
 kernel/sys_ni.c                   | 1 +
 2 files changed, 3 insertions(+)

diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
index 85a1e95341d8..2488c69242cf 100644
--- a/arch/arm/kernel/sys_oabi-compat.c
+++ b/arch/arm/kernel/sys_oabi-compat.c
@@ -249,6 +249,7 @@ struct oabi_epoll_event {
 	__u64 data;
 } __attribute__ ((packed,aligned(4)));
 
+#ifdef CONFIG_EPOLL
 asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
 				   struct oabi_epoll_event __user *event)
 {
@@ -264,6 +265,7 @@ asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
 
 	return do_epoll_ctl(epfd, op, fd, &kernel, false);
 }
+#endif
 
 asmlinkage long sys_oabi_epoll_wait(int epfd,
 				    struct oabi_epoll_event __user *events,
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 42ce28c460f6..9ee6a46b1795 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -68,6 +68,7 @@ COND_SYSCALL(epoll_create1);
 COND_SYSCALL(epoll_ctl);
 COND_SYSCALL(epoll_pwait);
 COND_SYSCALL_COMPAT(epoll_pwait);
+COND_SYSCALL(oabi_epoll_ctl); /* ARM OABI specific */
 
 /* fs/fcntl.c */
 
-- 
2.26.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] [v2] ARM: oabi-compat: fix epoll_ctl build failure
  2020-04-29 13:23 ` Arnd Bergmann
@ 2020-04-29 13:35   ` Russell King - ARM Linux admin
  -1 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux admin @ 2020-04-29 13:35 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Christoph Hellwig, linux-arm-kernel, linux-kernel, linux-api

On Wed, Apr 29, 2020 at 03:23:24PM +0200, Arnd Bergmann wrote:
> Two functions are not declared or defined when CONFIG_EPOLL is
> disabled:
> 
> arch/arm/kernel/sys_oabi-compat.c: In function 'sys_oabi_epoll_ctl':
> arch/arm/kernel/sys_oabi-compat.c:258:6: error: implicit declaration of function 'ep_op_has_event' [-Werror=implicit-function-declaration]
>   258 |  if (ep_op_has_event(op) &&
>       |      ^~~~~~~~~~~~~~~
> arch/arm/kernel/sys_oabi-compat.c:265:9: error: implicit declaration of function 'do_epoll_ctl'; did you mean 'sys_epoll_ctl'? [-Werror=implicit-function-declaration]
>   265 |  return do_epoll_ctl(epfd, op, fd, &kernel, false);
>       |         ^~~~~~~~~~~~
>       |         sys_epoll_ctl
> 
> Replace the function with the sys_ni_syscall stub in this case.
> 
> Fixes: c281634c8652 ("ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: use sys_ni_syscall() instead of removing the function body
> ---
>  arch/arm/kernel/sys_oabi-compat.c | 2 ++
>  kernel/sys_ni.c                   | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
> index 85a1e95341d8..2488c69242cf 100644
> --- a/arch/arm/kernel/sys_oabi-compat.c
> +++ b/arch/arm/kernel/sys_oabi-compat.c
> @@ -249,6 +249,7 @@ struct oabi_epoll_event {
>  	__u64 data;
>  } __attribute__ ((packed,aligned(4)));
>  
> +#ifdef CONFIG_EPOLL
>  asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
>  				   struct oabi_epoll_event __user *event)
>  {
> @@ -264,6 +265,7 @@ asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
>  
>  	return do_epoll_ctl(epfd, op, fd, &kernel, false);
>  }
> +#endif
>  
>  asmlinkage long sys_oabi_epoll_wait(int epfd,
>  				    struct oabi_epoll_event __user *events,
> diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
> index 42ce28c460f6..9ee6a46b1795 100644
> --- a/kernel/sys_ni.c
> +++ b/kernel/sys_ni.c
> @@ -68,6 +68,7 @@ COND_SYSCALL(epoll_create1);
>  COND_SYSCALL(epoll_ctl);
>  COND_SYSCALL(epoll_pwait);
>  COND_SYSCALL_COMPAT(epoll_pwait);
> +COND_SYSCALL(oabi_epoll_ctl); /* ARM OABI specific */
>  
>  /* fs/fcntl.c */
>  

I know what Chris said, but do we really want to be polluting generic
kernel files with arch specific stuff like this?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up

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

* Re: [PATCH] [v2] ARM: oabi-compat: fix epoll_ctl build failure
@ 2020-04-29 13:35   ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux admin @ 2020-04-29 13:35 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-api, Christoph Hellwig, linux-arm-kernel, linux-kernel

On Wed, Apr 29, 2020 at 03:23:24PM +0200, Arnd Bergmann wrote:
> Two functions are not declared or defined when CONFIG_EPOLL is
> disabled:
> 
> arch/arm/kernel/sys_oabi-compat.c: In function 'sys_oabi_epoll_ctl':
> arch/arm/kernel/sys_oabi-compat.c:258:6: error: implicit declaration of function 'ep_op_has_event' [-Werror=implicit-function-declaration]
>   258 |  if (ep_op_has_event(op) &&
>       |      ^~~~~~~~~~~~~~~
> arch/arm/kernel/sys_oabi-compat.c:265:9: error: implicit declaration of function 'do_epoll_ctl'; did you mean 'sys_epoll_ctl'? [-Werror=implicit-function-declaration]
>   265 |  return do_epoll_ctl(epfd, op, fd, &kernel, false);
>       |         ^~~~~~~~~~~~
>       |         sys_epoll_ctl
> 
> Replace the function with the sys_ni_syscall stub in this case.
> 
> Fixes: c281634c8652 ("ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: use sys_ni_syscall() instead of removing the function body
> ---
>  arch/arm/kernel/sys_oabi-compat.c | 2 ++
>  kernel/sys_ni.c                   | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
> index 85a1e95341d8..2488c69242cf 100644
> --- a/arch/arm/kernel/sys_oabi-compat.c
> +++ b/arch/arm/kernel/sys_oabi-compat.c
> @@ -249,6 +249,7 @@ struct oabi_epoll_event {
>  	__u64 data;
>  } __attribute__ ((packed,aligned(4)));
>  
> +#ifdef CONFIG_EPOLL
>  asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
>  				   struct oabi_epoll_event __user *event)
>  {
> @@ -264,6 +265,7 @@ asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
>  
>  	return do_epoll_ctl(epfd, op, fd, &kernel, false);
>  }
> +#endif
>  
>  asmlinkage long sys_oabi_epoll_wait(int epfd,
>  				    struct oabi_epoll_event __user *events,
> diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
> index 42ce28c460f6..9ee6a46b1795 100644
> --- a/kernel/sys_ni.c
> +++ b/kernel/sys_ni.c
> @@ -68,6 +68,7 @@ COND_SYSCALL(epoll_create1);
>  COND_SYSCALL(epoll_ctl);
>  COND_SYSCALL(epoll_pwait);
>  COND_SYSCALL_COMPAT(epoll_pwait);
> +COND_SYSCALL(oabi_epoll_ctl); /* ARM OABI specific */
>  
>  /* fs/fcntl.c */
>  

I know what Chris said, but do we really want to be polluting generic
kernel files with arch specific stuff like this?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] [v2] ARM: oabi-compat: fix epoll_ctl build failure
  2020-04-29 13:35   ` Russell King - ARM Linux admin
@ 2020-04-29 20:13     ` Arnd Bergmann
  -1 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2020-04-29 20:13 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Christoph Hellwig, Linux ARM, linux-kernel, Linux API

On Wed, Apr 29, 2020 at 3:35 PM Russell King - ARM Linux admin
<linux@armlinux.org.uk> wrote:
> On Wed, Apr 29, 2020 at 03:23:24PM +0200, Arnd Bergmann wrote:
> > Two functions are not declared or defined when CONFIG_EPOLL is
> > disabled:
> >
>
> I know what Chris said, but do we really want to be polluting generic
> kernel files with arch specific stuff like this?

The file already has a couple of architecture specific syscalls listed already,
so it shouldn't be a big deal. If you prefer the first version of my patch,
or have another suggestion, I don't mind sending a v3 that does it differently
again.

Unfortunately, COND_SYSCALL() is a locally defined macro in that file,
so we can't easily use it elsewhere without duplicating it like in
kernel/time/posix-stubs.c.

As I mentioned in v1, it's also possible to just make this function
compile without #ifdefs by having conditional stub definitions of the
missing interfaces.

      Arnd

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

* Re: [PATCH] [v2] ARM: oabi-compat: fix epoll_ctl build failure
@ 2020-04-29 20:13     ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2020-04-29 20:13 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Linux API, Christoph Hellwig, Linux ARM, linux-kernel

On Wed, Apr 29, 2020 at 3:35 PM Russell King - ARM Linux admin
<linux@armlinux.org.uk> wrote:
> On Wed, Apr 29, 2020 at 03:23:24PM +0200, Arnd Bergmann wrote:
> > Two functions are not declared or defined when CONFIG_EPOLL is
> > disabled:
> >
>
> I know what Chris said, but do we really want to be polluting generic
> kernel files with arch specific stuff like this?

The file already has a couple of architecture specific syscalls listed already,
so it shouldn't be a big deal. If you prefer the first version of my patch,
or have another suggestion, I don't mind sending a v3 that does it differently
again.

Unfortunately, COND_SYSCALL() is a locally defined macro in that file,
so we can't easily use it elsewhere without duplicating it like in
kernel/time/posix-stubs.c.

As I mentioned in v1, it's also possible to just make this function
compile without #ifdefs by having conditional stub definitions of the
missing interfaces.

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-04-29 20:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 13:23 [PATCH] [v2] ARM: oabi-compat: fix epoll_ctl build failure Arnd Bergmann
2020-04-29 13:23 ` Arnd Bergmann
2020-04-29 13:35 ` Russell King - ARM Linux admin
2020-04-29 13:35   ` Russell King - ARM Linux admin
2020-04-29 20:13   ` Arnd Bergmann
2020-04-29 20:13     ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.