On 1/28/26 6:56 PM, Pierrick Bouvier wrote:
On 1/28/26 6:28 PM, Richard Henderson wrote:
On 1/29/26 12:31, Pierrick Bouvier wrote:
--- a/include/user/syscall-trace.h
+++ b/include/user/syscall-trace.h
@@ -39,5 +39,22 @@ static inline void record_syscall_return(CPUState *cpu, int 
num, abi_long ret)
        gdb_syscall_return(cpu, num);
    }
+static bool send_through_syscall_filters(CPUState *cpu, int num,
+                                         abi_long arg1, abi_long arg2,
+                                         abi_long arg3, abi_long arg4,
+                                         abi_long arg5, abi_long arg6,
+                                         abi_long arg7, abi_long arg8,
+                                         abi_long *sysret)
+{
+    uint64_t sysret64 = 0;
+    bool filtered = qemu_plugin_vcpu_syscall_filter(cpu, num, arg1, arg2,
+                                                    arg3, arg4, arg5, arg6,
+                                                    arg7, arg8, &sysret64);
+    if (filtered) {
+        *sysret = sysret64;
+    }
+    return filtered;
+}

FreeBSD build failure:

https://gitlab.com/qemu-project/qemu/-/jobs/12906481914

In file included from ../bsd-user/freebsd/os-syscall.c:34:
/tmp/cirrus-ci-build/include/user/syscall-trace.h:42:13: error: unused function
'send_through_syscall_filters' [-Werror,-Wunused-function]
      42 | static bool send_through_syscall_filters(CPUState *cpu, int num,
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Why is this in the header anyway?  If it really *should* be shared with 
FreeBSD, then it
could just as well live somewhere in plugins/.  If it really is linux-specific, 
then it
could just as well live in linux-user/syscall.c.


r~

Sorry, it fell through the cracks.

FreeBSD has no werror by default, and the pipeline I ran doesn't add
explicitly add --enable-werror. Warning is there though:
https://github.com/pbo-linaro/qemu/actions/runs/21461090659/job/61813517774
I'll make sure to build with werror enabled for next runs.

This function was added in this header, next to
record_syscall_start/end, which is not used by BSD neither. It doesn't
raise a warning because they are static inline. The original dev added
it where it made sense.

Current series only has BSD implementation, but original

only has *Linux* implementation

qemu_plugin_vcpu_syscall supports only Linux too.
It could be implemented though, but not sure someone will spend time on
that for BSD.

If that's ok for you, I can move the function to linux-user/syscall.c
and remove the header. How about that?

Regards,
Pierrick


Reply via email to