All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: make getcpu optional
@ 2018-02-17  2:01 Mike Frysinger
  2018-02-17  2:02 ` [Qemu-devel] [PATCH v2] " Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2018-02-17  2:01 UTC (permalink / raw)
  To: qemu-devel, Riku Voipio, Laurent Vivier; +Cc: samuel.thibault

Not all arches implement this, and the kernel doesn't require them to.
Add ifdef logic to disable it when not available.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 linux-user/syscall.c    | 4 ++++
 target/bfin/op_helper.c | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 799c8e2800ea..a9904fac791f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -290,8 +290,10 @@ _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len,
 #define __NR_sys_sched_setaffinity __NR_sched_setaffinity
 _syscall3(int, sys_sched_setaffinity, pid_t, pid, unsigned int, len,
           unsigned long *, user_mask_ptr);
+#ifdef TARGET_NR_getcpu
 #define __NR_sys_getcpu __NR_getcpu
 _syscall3(int, sys_getcpu, unsigned *, cpu, unsigned *, node, void *, tcache);
+#endif
 _syscall4(int, reboot, int, magic1, int, magic2, unsigned int, cmd,
           void *, arg);
 _syscall2(int, capget, struct __user_cap_header_struct *, header,
@@ -10595,6 +10597,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(sys_sched_setaffinity(arg1, mask_size, mask));
         }
         break;
+#ifdef TARGET_NR_getcpu
     case TARGET_NR_getcpu:
         {
             unsigned cpu, node;
@@ -10612,6 +10615,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             }
         }
         break;
+#endif
     case TARGET_NR_sched_setparam:
         {
             struct sched_param *target_schp;
diff --git a/target/bfin/op_helper.c b/target/bfin/op_helper.c
index 5b80aea23bc6..abb3e9301814 100644
--- a/target/bfin/op_helper.c
+++ b/target/bfin/op_helper.c
@@ -18,8 +18,8 @@
    NULL, it means that the function was called in C code (i.e. not
    from generated code or from helper.c) */
 /* XXX: fix it to restore all registers */
-void tlb_fill(CPUState *cs, target_ulong addr, MMUAccessType access_type,
-              int mmu_idx, uintptr_t retaddr)
+void tlb_fill(CPUState *cs, target_ulong addr, int size,
+              MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)
 {
     int ret;
 
-- 
2.16.1

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

* [Qemu-devel] [PATCH v2] linux-user: make getcpu optional
  2018-02-17  2:01 [Qemu-devel] [PATCH] linux-user: make getcpu optional Mike Frysinger
@ 2018-02-17  2:02 ` Mike Frysinger
  2018-02-17 10:35   ` Laurent Vivier
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2018-02-17  2:02 UTC (permalink / raw)
  To: qemu-devel, Riku Voipio, Laurent Vivier; +Cc: samuel.thibault

Not all arches implement this, and the kernel doesn't require them to.
Add ifdef logic to disable it when not available.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 linux-user/syscall.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 799c8e2800ea..a9904fac791f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -290,8 +290,10 @@ _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len,
 #define __NR_sys_sched_setaffinity __NR_sched_setaffinity
 _syscall3(int, sys_sched_setaffinity, pid_t, pid, unsigned int, len,
           unsigned long *, user_mask_ptr);
+#ifdef TARGET_NR_getcpu
 #define __NR_sys_getcpu __NR_getcpu
 _syscall3(int, sys_getcpu, unsigned *, cpu, unsigned *, node, void *, tcache);
+#endif
 _syscall4(int, reboot, int, magic1, int, magic2, unsigned int, cmd,
           void *, arg);
 _syscall2(int, capget, struct __user_cap_header_struct *, header,
@@ -10595,6 +10597,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(sys_sched_setaffinity(arg1, mask_size, mask));
         }
         break;
+#ifdef TARGET_NR_getcpu
     case TARGET_NR_getcpu:
         {
             unsigned cpu, node;
@@ -10612,6 +10615,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             }
         }
         break;
+#endif
     case TARGET_NR_sched_setparam:
         {
             struct sched_param *target_schp;
-- 
2.16.1

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

* Re: [Qemu-devel] [PATCH v2] linux-user: make getcpu optional
  2018-02-17  2:02 ` [Qemu-devel] [PATCH v2] " Mike Frysinger
@ 2018-02-17 10:35   ` Laurent Vivier
  0 siblings, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2018-02-17 10:35 UTC (permalink / raw)
  To: Mike Frysinger, qemu-devel, Riku Voipio; +Cc: samuel.thibault

Le 17/02/2018 à 03:02, Mike Frysinger a écrit :
> Not all arches implement this, and the kernel doesn't require them to.
> Add ifdef logic to disable it when not available.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  linux-user/syscall.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 799c8e2800ea..a9904fac791f 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -290,8 +290,10 @@ _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len,
>  #define __NR_sys_sched_setaffinity __NR_sched_setaffinity
>  _syscall3(int, sys_sched_setaffinity, pid_t, pid, unsigned int, len,
>            unsigned long *, user_mask_ptr);
> +#ifdef TARGET_NR_getcpu
>  #define __NR_sys_getcpu __NR_getcpu
>  _syscall3(int, sys_getcpu, unsigned *, cpu, unsigned *, node, void *, tcache);
> +#endif

I didn't find any arch that doesn't have it in linux-user/*/syscall_nr.h
Which arches are you speaking about?

As it can be also undefined for the host arch, you should use:

    #if defined(TARGET_NR_getcpu) && defined(__NR_getcpu)

Thanks,
Laurent

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

end of thread, other threads:[~2018-02-17 10:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-17  2:01 [Qemu-devel] [PATCH] linux-user: make getcpu optional Mike Frysinger
2018-02-17  2:02 ` [Qemu-devel] [PATCH v2] " Mike Frysinger
2018-02-17 10:35   ` 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.