qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] linux-user: add plugin API to filter syscalls
@ 2025-12-14 14:19 Ziyang Zhang
  2025-12-14 14:19 ` [PATCH v3 1/2] " Ziyang Zhang
  2025-12-14 14:19 ` [PATCH v3 2/2] tcg tests: add a test to verify the syscall filter plugin API Ziyang Zhang
  0 siblings, 2 replies; 4+ messages in thread
From: Ziyang Zhang @ 2025-12-14 14:19 UTC (permalink / raw)
  To: qemu-devel
  Cc: Riku Voipio, Laurent Vivier, Alex Bennee, Alexandre Iooss,
	Mahmoud Mandour, Pierrick Bouvier, Richard Henderson, Zhengwei Qi,
	Yun Wang, Mingyuan Xia, Kailiang Xu, Ziyang Zhang

We choose a smaller magic syscall number to avoid the illegal instruction
exception [1] on qemu-arm.

PATCH v3:
  1. Change to a smaller magic syscall number and add comments
  2. Set register flags out of the for-loop

PATCH v2:
  1. Rebased on newest version of master

PATCH v1:
  1. Format the code

RFC v2:
  1. Simplify the syscall filter mechanism and remove fork-cpu
  2. Add QEMU_PLUGIN_EV_VCPU_SYSCALL_FILTER enum

RFC v1:
  1. Add syscall filter registry
  2. Add fork-cpu interface to re-enter cpu_loop when handling syscalls

[1] https://lore.kernel.org/qemu-devel/20251212141541.1792111-1-functioner@sjtu.edu.cn/T/#m0e6809c5a894d64a8b7e67324a4b7cb414c644bf

Ziyang Zhang (2):
  linux-user: add plugin API to filter syscalls
  tcg tests: add a test to verify the syscall filter  plugin API

 include/qemu/plugin-event.h                   |  1 +
 include/qemu/plugin.h                         | 33 ++++++++++++-----
 include/qemu/qemu-plugin.h                    | 32 ++++++++++++++++
 include/user/syscall-trace.h                  | 17 +++++++++
 linux-user/syscall.c                          |  7 +++-
 plugins/api.c                                 |  7 ++++
 plugins/core.c                                | 37 +++++++++++++++++++
 tests/tcg/multiarch/Makefile.target           |  4 +-
 .../multiarch/test-plugin-syscall-filter.c    | 35 ++++++++++++++++++
 tests/tcg/plugins/syscall.c                   | 19 ++++++++++
 10 files changed, 180 insertions(+), 12 deletions(-)
 create mode 100644 tests/tcg/multiarch/test-plugin-syscall-filter.c

-- 
2.34.1



^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH v3 0/2] linux-user: add plugin API to filter syscalls
@ 2025-12-14 14:10 Ziyang Zhang
  2025-12-14 14:10 ` [PATCH v3 1/2] " Ziyang Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Ziyang Zhang @ 2025-12-14 14:10 UTC (permalink / raw)
  To: qemu-devel
  Cc: Riku Voipio, Laurent Vivier, Alex Bennee, Alexandre Iooss,
	Mahmoud Mandour, Pierrick Bouvier, Richard Henderson, Zhengwei Qi,
	Yun Wang, Mingyuan Xia, Kailiang Xu, Ziyang Zhang

We choose a smaller magic syscall number to avoid the illegal instruction
exception [1] on qemu-arm.

PATCH v3:
  1. Change to a smaller magic syscall number and add comments
  2. Set register flags out of the for-loop

PATCH v2:
  1. Rebased on newest version of master

PATCH v1:
  1. Format the code

RFC v2:
  1. Simplify the syscall filter mechanism and remove fork-cpu
  2. Add QEMU_PLUGIN_EV_VCPU_SYSCALL_FILTER enum

RFC v1:
  1. Add syscall filter registry
  2. Add fork-cpu interface to re-enter cpu_loop when handling syscalls

[1] https://lore.kernel.org/qemu-devel/20251212141541.1792111-1-functioner@sjtu.edu.cn/T/#m0e6809c5a894d64a8b7e67324a4b7cb414c644bf

Ziyang Zhang (2):
  linux-user: add plugin API to filter syscalls
  tcg tests: add a test to verify the syscall filter plugin API

 include/qemu/plugin-event.h                   |  1 +
 include/qemu/plugin.h                         | 33 ++++++++++++-----
 include/qemu/qemu-plugin.h                    | 32 ++++++++++++++++
 include/user/syscall-trace.h                  | 17 +++++++++
 linux-user/syscall.c                          |  7 +++-
 plugins/api.c                                 |  7 ++++
 plugins/core.c                                | 37 +++++++++++++++++++
 tests/tcg/multiarch/Makefile.target           |  4 +-
 .../multiarch/test-plugin-syscall-filter.c    | 35 ++++++++++++++++++
 tests/tcg/plugins/syscall.c                   | 19 ++++++++++
 10 files changed, 180 insertions(+), 12 deletions(-)
 create mode 100644 tests/tcg/multiarch/test-plugin-syscall-filter.c

-- 
2.34.1



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

end of thread, other threads:[~2025-12-14 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-14 14:19 [PATCH v3 0/2] linux-user: add plugin API to filter syscalls Ziyang Zhang
2025-12-14 14:19 ` [PATCH v3 1/2] " Ziyang Zhang
2025-12-14 14:19 ` [PATCH v3 2/2] tcg tests: add a test to verify the syscall filter plugin API Ziyang Zhang
  -- strict thread matches above, loose matches on Subject: below --
2025-12-14 14:10 [PATCH v3 0/2] linux-user: add plugin API to filter syscalls Ziyang Zhang
2025-12-14 14:10 ` [PATCH v3 1/2] " Ziyang Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).