All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linux-user/syscall.c: add target-to-host mapping for epoll_create1()
@ 2020-04-15 22:05 Sergei Trofimovich
  2020-04-16  7:23 ` Laurent Vivier
  2020-04-16  7:39 ` Laurent Vivier
  0 siblings, 2 replies; 3+ messages in thread
From: Sergei Trofimovich @ 2020-04-15 22:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier, Sergei Trofimovich

Noticed by Barnabás Virágh as a python-3.7 failue on qemu-alpha.

The bug shows up on alpha as it's one of the targets where
EPOLL_CLOEXEC differs from other targets:
    sysdeps/unix/sysv/linux/alpha/bits/epoll.h: EPOLL_CLOEXEC  = 01000000
    sysdeps/unix/sysv/linux/bits/epoll.h:        EPOLL_CLOEXEC = 02000000

Bug: https://bugs.gentoo.org/717548
Reported-by: Barnabás Virágh
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
CC: Riku Voipio <riku.voipio@iki.fi>
CC: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 674f70e70a..05f03919ff 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -12012,7 +12012,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
 #if defined(TARGET_NR_epoll_create1) && defined(CONFIG_EPOLL_CREATE1)
     case TARGET_NR_epoll_create1:
-        return get_errno(epoll_create1(arg1));
+        return get_errno(epoll_create1(target_to_host_bitmask(arg1, fcntl_flags_tbl)));
 #endif
 #if defined(TARGET_NR_epoll_ctl)
     case TARGET_NR_epoll_ctl:
-- 
2.26.1



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

* Re: [PATCH] linux-user/syscall.c: add target-to-host mapping for epoll_create1()
  2020-04-15 22:05 [PATCH] linux-user/syscall.c: add target-to-host mapping for epoll_create1() Sergei Trofimovich
@ 2020-04-16  7:23 ` Laurent Vivier
  2020-04-16  7:39 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2020-04-16  7:23 UTC (permalink / raw)
  To: Sergei Trofimovich, qemu-devel; +Cc: Riku Voipio

Le 16/04/2020 à 00:05, Sergei Trofimovich a écrit :
> Noticed by Barnabás Virágh as a python-3.7 failue on qemu-alpha.
> 
> The bug shows up on alpha as it's one of the targets where
> EPOLL_CLOEXEC differs from other targets:
>     sysdeps/unix/sysv/linux/alpha/bits/epoll.h: EPOLL_CLOEXEC  = 01000000
>     sysdeps/unix/sysv/linux/bits/epoll.h:        EPOLL_CLOEXEC = 02000000
> 
> Bug: https://bugs.gentoo.org/717548
> Reported-by: Barnabás Virágh
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> CC: Riku Voipio <riku.voipio@iki.fi>
> CC: Laurent Vivier <laurent@vivier.eu>
> ---
>  linux-user/syscall.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 674f70e70a..05f03919ff 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -12012,7 +12012,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>  #endif
>  #if defined(TARGET_NR_epoll_create1) && defined(CONFIG_EPOLL_CREATE1)
>      case TARGET_NR_epoll_create1:
> -        return get_errno(epoll_create1(arg1));
> +        return get_errno(epoll_create1(target_to_host_bitmask(arg1, fcntl_flags_tbl)));
>  #endif
>  #if defined(TARGET_NR_epoll_ctl)
>      case TARGET_NR_epoll_ctl:
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


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

* Re: [PATCH] linux-user/syscall.c: add target-to-host mapping for epoll_create1()
  2020-04-15 22:05 [PATCH] linux-user/syscall.c: add target-to-host mapping for epoll_create1() Sergei Trofimovich
  2020-04-16  7:23 ` Laurent Vivier
@ 2020-04-16  7:39 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2020-04-16  7:39 UTC (permalink / raw)
  To: Sergei Trofimovich, qemu-devel; +Cc: Riku Voipio

Le 16/04/2020 à 00:05, Sergei Trofimovich a écrit :
> Noticed by Barnabás Virágh as a python-3.7 failue on qemu-alpha.
> 
> The bug shows up on alpha as it's one of the targets where
> EPOLL_CLOEXEC differs from other targets:
>     sysdeps/unix/sysv/linux/alpha/bits/epoll.h: EPOLL_CLOEXEC  = 01000000
>     sysdeps/unix/sysv/linux/bits/epoll.h:        EPOLL_CLOEXEC = 02000000
> 
> Bug: https://bugs.gentoo.org/717548
> Reported-by: Barnabás Virágh
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> CC: Riku Voipio <riku.voipio@iki.fi>
> CC: Laurent Vivier <laurent@vivier.eu>
> ---
>  linux-user/syscall.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 674f70e70a..05f03919ff 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -12012,7 +12012,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>  #endif
>  #if defined(TARGET_NR_epoll_create1) && defined(CONFIG_EPOLL_CREATE1)
>      case TARGET_NR_epoll_create1:
> -        return get_errno(epoll_create1(arg1));
> +        return get_errno(epoll_create1(target_to_host_bitmask(arg1, fcntl_flags_tbl)));
>  #endif
>  #if defined(TARGET_NR_epoll_ctl)
>      case TARGET_NR_epoll_ctl:
> 

Applied to my linux-user-for-5.0 branch.

Thanks,
Laurent


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

end of thread, other threads:[~2020-04-16  7:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 22:05 [PATCH] linux-user/syscall.c: add target-to-host mapping for epoll_create1() Sergei Trofimovich
2020-04-16  7:23 ` Laurent Vivier
2020-04-16  7:39 ` Laurent Vivier

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.