Skip to content

plugins: fix syscall filter return value type

Ziyang Zhang qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 3 repliesIn review
  2. v11 patch 7 repliesSuperseded

Changes in v2 from the cover letter

- rebased onto current master, where the syscall callbacks now take a userdata argument; the filter signatures were adjusted to keep that while changing only the sysret type. No functional change otherwise.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1plugins: use int64_t for the syscall filter return valueinclude/plugins/qemu-plugin.h include/qemu/plugin.h linux-user/syscall.c +3 more+7 -72 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchPierrick BouvierAlex Bennée
1/1R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/1] plugins: fix syscall filter return value type

Hi,

The sysret value of the syscall filter callback is declared as uint64_t, but it is semantically signed: the negative range encodes errno. This makes it int64_t, matching the ret parameter of qemu_plugin_vcpu_syscall_ret_cb_t, which already uses int64_t for the same syscall return value.

As discussed on v1, this is not a correctness fix (the filter only sets sysret, so the bit pattern is the same either way); it is a consistency and readability improvement, so that the same syscall return value is typed the same way on the read side and the write side.

I did not bump QEMU_PLUGIN_VERSION, since this only changes the signedness of an existing argument.

v1: https://lore.kernel.org/qemu-devel/[email protected]/

Changes since v1:
- rebased onto current master, where the syscall callbacks now take a userdata argument; the filter signatures were adjusted to keep that while changing only the sysret type. No functional change otherwise.

Thanks for your review.

Ziyang Zhang (1):
plugins: use int64_t for the syscall filter return value

 include/plugins/qemu-plugin.h | 2 +-
 include/qemu/plugin.h         | 4 ++--
 linux-user/syscall.c          | 2 +-
 plugins/core.c                | 2 +-
 tests/tcg/plugins/setpc.c     | 2 +-
 tests/tcg/plugins/syscall.c   | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.34.1