diff mbox

alpha-user: wire epoll_create, epoll_ctl, epoll_wait

Message ID 20170408193322.16631-1-slyfox@gentoo.org
State New
Headers show

Commit Message

Sergei Trofimovich April 8, 2017, 7:33 p.m. UTC
Noticed when ran GHC on alpha:
    $ qemu-alpha -L /usr/alpha-unknown-linux-gnu/ /tmp/a
    qemu: Unsupported syscall: 407

linux-user/syscall.c does have 'epoll_create' wiring,
but under nondeprecated name.

Instead of defining both
    TARGET_NR_sys_epoll_create
and
    TARGET_NR_epoll_create
I've renamed former to later as old name is not used
anywhere else in qemu.

After this change GHC works fine under qemu-alpha:
    $ ./alpha-linux-user/qemu-alpha -L /usr/alpha-unknown-linux-gnu/ /tmp/a
    ...

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: qemu-devel@nongnu.org
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 linux-user/alpha/syscall_nr.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Sergei Trofimovich May 11, 2017, 9:56 p.m. UTC | #1
On Sat,  8 Apr 2017 20:33:22 +0100
Sergei Trofimovich <slyfox@gentoo.org> wrote:

> Noticed when ran GHC on alpha:
>     $ qemu-alpha -L /usr/alpha-unknown-linux-gnu/ /tmp/a
>     qemu: Unsupported syscall: 407
> 
> linux-user/syscall.c does have 'epoll_create' wiring,
> but under nondeprecated name.
> 
> Instead of defining both
>     TARGET_NR_sys_epoll_create
> and
>     TARGET_NR_epoll_create
> I've renamed former to later as old name is not used
> anywhere else in qemu.
> 
> After this change GHC works fine under qemu-alpha:
>     $ ./alpha-linux-user/qemu-alpha -L /usr/alpha-unknown-linux-gnu/ /tmp/a
>     ...
> 
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Riku Voipio <riku.voipio@iki.fi>
> Cc: qemu-devel@nongnu.org
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> ---
>  linux-user/alpha/syscall_nr.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/linux-user/alpha/syscall_nr.h b/linux-user/alpha/syscall_nr.h
> index 00e14bb6b3..e848154663 100644
> --- a/linux-user/alpha/syscall_nr.h
> +++ b/linux-user/alpha/syscall_nr.h
> @@ -343,9 +343,9 @@
>  #define TARGET_NR_io_cancel			402
>  #define TARGET_NR_exit_group			405
>  #define TARGET_NR_lookup_dcookie		406
> -#define TARGET_NR_sys_epoll_create		407
> -#define TARGET_NR_sys_epoll_ctl		408
> -#define TARGET_NR_sys_epoll_wait		409
> +#define TARGET_NR_epoll_create			407
> +#define TARGET_NR_epoll_ctl			408
> +#define TARGET_NR_epoll_wait			409
>  #define TARGET_NR_remap_file_pages		410
>  #define TARGET_NR_set_tid_address		411
>  #define TARGET_NR_restart_syscall		412
> -- 
> 2.12.2
> 

Ping.
Peter Maydell May 30, 2017, 1:04 p.m. UTC | #2
On 8 April 2017 at 20:33, Sergei Trofimovich <slyfox@gentoo.org> wrote:
> Noticed when ran GHC on alpha:
>     $ qemu-alpha -L /usr/alpha-unknown-linux-gnu/ /tmp/a
>     qemu: Unsupported syscall: 407
>
> linux-user/syscall.c does have 'epoll_create' wiring,
> but under nondeprecated name.
>
> Instead of defining both
>     TARGET_NR_sys_epoll_create
> and
>     TARGET_NR_epoll_create
> I've renamed former to later as old name is not used
> anywhere else in qemu.

It's also still used in the linux-user/strace.list
file:

#ifdef TARGET_NR_sys_epoll_create
{ TARGET_NR_sys_epoll_create, "sys_epoll_create" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_sys_epoll_ctl
{ TARGET_NR_sys_epoll_ctl, "sys_epoll_ctl" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_sys_epoll_wait
{ TARGET_NR_sys_epoll_wait, "sys_epoll_wait" , NULL, NULL, NULL },
#endif

so these sections are now unused and could be deleted.

> After this change GHC works fine under qemu-alpha:
>     $ ./alpha-linux-user/qemu-alpha -L /usr/alpha-unknown-linux-gnu/ /tmp/a
>     ...
>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Riku Voipio <riku.voipio@iki.fi>
> Cc: qemu-devel@nongnu.org
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> ---
>  linux-user/alpha/syscall_nr.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/linux-user/alpha/syscall_nr.h b/linux-user/alpha/syscall_nr.h
> index 00e14bb6b3..e848154663 100644
> --- a/linux-user/alpha/syscall_nr.h
> +++ b/linux-user/alpha/syscall_nr.h
> @@ -343,9 +343,9 @@
>  #define TARGET_NR_io_cancel                    402
>  #define TARGET_NR_exit_group                   405
>  #define TARGET_NR_lookup_dcookie               406
> -#define TARGET_NR_sys_epoll_create             407
> -#define TARGET_NR_sys_epoll_ctl                408
> -#define TARGET_NR_sys_epoll_wait               409
> +#define TARGET_NR_epoll_create                 407
> +#define TARGET_NR_epoll_ctl                    408
> +#define TARGET_NR_epoll_wait                   409
>  #define TARGET_NR_remap_file_pages             410
>  #define TARGET_NR_set_tid_address              411
>  #define TARGET_NR_restart_syscall              412
> --
> 2.12.2

This change is fine though.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
diff mbox

Patch

diff --git a/linux-user/alpha/syscall_nr.h b/linux-user/alpha/syscall_nr.h
index 00e14bb6b3..e848154663 100644
--- a/linux-user/alpha/syscall_nr.h
+++ b/linux-user/alpha/syscall_nr.h
@@ -343,9 +343,9 @@ 
 #define TARGET_NR_io_cancel			402
 #define TARGET_NR_exit_group			405
 #define TARGET_NR_lookup_dcookie		406
-#define TARGET_NR_sys_epoll_create		407
-#define TARGET_NR_sys_epoll_ctl		408
-#define TARGET_NR_sys_epoll_wait		409
+#define TARGET_NR_epoll_create			407
+#define TARGET_NR_epoll_ctl			408
+#define TARGET_NR_epoll_wait			409
 #define TARGET_NR_remap_file_pages		410
 #define TARGET_NR_set_tid_address		411
 #define TARGET_NR_restart_syscall		412