[PATCH v2 0/1] contrib/plugins: add syscall-filter passthrough zlib demo

XU Kailiang posted 1 patch 5 days, 1 hour ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260406153331.8846-1-xukl2019@sjtu.edu.cn
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>
contrib/plugins/meson.build                   |  11 ++
contrib/plugins/passthrough-examples/Makefile |  23 +++
.../plugins/passthrough-examples/README.rst   |  60 +++++++
.../plugins/passthrough-examples/meson.build  |  19 ++
.../passthrough-examples/passthrough-gtl.c    |  41 +++++
.../passthrough-examples/passthrough-gtl.h    |  17 ++
.../plugins/passthrough-examples/zlib-demo.c  |  90 ++++++++++
.../plugins/passthrough-examples/zlib-gtl.c   |  72 ++++++++
.../plugins/passthrough-examples/zlib-htl.c   |  37 ++++
contrib/plugins/passthrough-protocol.h        |  14 ++
contrib/plugins/passthrough.c                 | 162 ++++++++++++++++++
docs/about/emulation.rst                      |  33 ++++
12 files changed, 579 insertions(+)
create mode 100644 contrib/plugins/passthrough-examples/Makefile
create mode 100644 contrib/plugins/passthrough-examples/README.rst
create mode 100644 contrib/plugins/passthrough-examples/meson.build
create mode 100644 contrib/plugins/passthrough-examples/passthrough-gtl.c
create mode 100644 contrib/plugins/passthrough-examples/passthrough-gtl.h
create mode 100644 contrib/plugins/passthrough-examples/zlib-demo.c
create mode 100644 contrib/plugins/passthrough-examples/zlib-gtl.c
create mode 100644 contrib/plugins/passthrough-examples/zlib-htl.c
create mode 100644 contrib/plugins/passthrough-protocol.h
create mode 100644 contrib/plugins/passthrough.c
[PATCH v2 0/1] contrib/plugins: add syscall-filter passthrough zlib demo
Posted by XU Kailiang 5 days, 1 hour ago
Hi,

This v2 simplifies the earlier series into one minimal, runnable example for
the linux-user syscall filter API.

It adds:

- one plugin: contrib/plugins/passthrough.c
- one matching in-tree example: contrib/plugins/passthrough-examples/ (zlib)

The plugin handles a small passthrough protocol over a magic syscall
(load HTL module, resolve HTL symbol, invoke HTL entry). The zlib guest thunk
library (GTL) uses this protocol to forward selected zlib calls to host-side
HTL/native zlib.

Compared to v1 [1], this version narrows scope:

- drop the callback/qsort prototype
- drop extra demo variants
- keep only a single plugin + single matching example that is easy to build
  and reproduce

Build/repro documentation is provided in:

- docs/about/emulation.rst
- contrib/plugins/passthrough-examples/README.rst

Thanks,
XU Kailiang

[1]: https://lore.kernel.org/qemu-devel/20260331173656.35305-1-xukl2019@sjtu.edu.cn/T/#t

---

XU Kailiang (1):
  contrib/plugins: add syscall-filter passthrough zlib demo

 contrib/plugins/meson.build                   |  11 ++
 contrib/plugins/passthrough-examples/Makefile |  23 +++
 .../plugins/passthrough-examples/README.rst   |  60 +++++++
 .../plugins/passthrough-examples/meson.build  |  19 ++
 .../passthrough-examples/passthrough-gtl.c    |  41 +++++
 .../passthrough-examples/passthrough-gtl.h    |  17 ++
 .../plugins/passthrough-examples/zlib-demo.c  |  90 ++++++++++
 .../plugins/passthrough-examples/zlib-gtl.c   |  72 ++++++++
 .../plugins/passthrough-examples/zlib-htl.c   |  37 ++++
 contrib/plugins/passthrough-protocol.h        |  14 ++
 contrib/plugins/passthrough.c                 | 162 ++++++++++++++++++
 docs/about/emulation.rst                      |  33 ++++
 12 files changed, 579 insertions(+)
 create mode 100644 contrib/plugins/passthrough-examples/Makefile
 create mode 100644 contrib/plugins/passthrough-examples/README.rst
 create mode 100644 contrib/plugins/passthrough-examples/meson.build
 create mode 100644 contrib/plugins/passthrough-examples/passthrough-gtl.c
 create mode 100644 contrib/plugins/passthrough-examples/passthrough-gtl.h
 create mode 100644 contrib/plugins/passthrough-examples/zlib-demo.c
 create mode 100644 contrib/plugins/passthrough-examples/zlib-gtl.c
 create mode 100644 contrib/plugins/passthrough-examples/zlib-htl.c
 create mode 100644 contrib/plugins/passthrough-protocol.h
 create mode 100644 contrib/plugins/passthrough.c


base-commit: b6a7d06213e5d2f7d124d16418bc289c4a8a4b82
-- 
2.53.0
Re: [PATCH v2 0/1] contrib/plugins: add syscall-filter passthrough zlib demo
Posted by Pierrick Bouvier 4 days, 23 hours ago
Hi Kailiang,

On 4/6/26 8:32 AM, XU Kailiang wrote:
> Hi,
> 
> This v2 simplifies the earlier series into one minimal, runnable example for
> the linux-user syscall filter API.
> 
> It adds:
> 
> - one plugin: contrib/plugins/passthrough.c
> - one matching in-tree example: contrib/plugins/passthrough-examples/ (zlib)
> 
> The plugin handles a small passthrough protocol over a magic syscall
> (load HTL module, resolve HTL symbol, invoke HTL entry). The zlib guest thunk
> library (GTL) uses this protocol to forward selected zlib calls to host-side
> HTL/native zlib.
> 
> Compared to v1 [1], this version narrows scope:
> 
> - drop the callback/qsort prototype
> - drop extra demo variants
> - keep only a single plugin + single matching example that is easy to build
>    and reproduce
> 
> Build/repro documentation is provided in:
> 
> - docs/about/emulation.rst
> - contrib/plugins/passthrough-examples/README.rst
> 
> Thanks,
> XU Kailiang
> 
> [1]: https://lore.kernel.org/qemu-devel/20260331173656.35305-1-xukl2019@sjtu.edu.cn/T/#t
> 
> ---
> 
> XU Kailiang (1):
>    contrib/plugins: add syscall-filter passthrough zlib demo
> 
>   contrib/plugins/meson.build                   |  11 ++
>   contrib/plugins/passthrough-examples/Makefile |  23 +++
>   .../plugins/passthrough-examples/README.rst   |  60 +++++++
>   .../plugins/passthrough-examples/meson.build  |  19 ++
>   .../passthrough-examples/passthrough-gtl.c    |  41 +++++
>   .../passthrough-examples/passthrough-gtl.h    |  17 ++
>   .../plugins/passthrough-examples/zlib-demo.c  |  90 ++++++++++
>   .../plugins/passthrough-examples/zlib-gtl.c   |  72 ++++++++
>   .../plugins/passthrough-examples/zlib-htl.c   |  37 ++++
>   contrib/plugins/passthrough-protocol.h        |  14 ++
>   contrib/plugins/passthrough.c                 | 162 ++++++++++++++++++
>   docs/about/emulation.rst                      |  33 ++++
>   12 files changed, 579 insertions(+)
>   create mode 100644 contrib/plugins/passthrough-examples/Makefile
>   create mode 100644 contrib/plugins/passthrough-examples/README.rst
>   create mode 100644 contrib/plugins/passthrough-examples/meson.build
>   create mode 100644 contrib/plugins/passthrough-examples/passthrough-gtl.c
>   create mode 100644 contrib/plugins/passthrough-examples/passthrough-gtl.h
>   create mode 100644 contrib/plugins/passthrough-examples/zlib-demo.c
>   create mode 100644 contrib/plugins/passthrough-examples/zlib-gtl.c
>   create mode 100644 contrib/plugins/passthrough-examples/zlib-htl.c
>   create mode 100644 contrib/plugins/passthrough-protocol.h
>   create mode 100644 contrib/plugins/passthrough.c
> 
> 
> base-commit: b6a7d06213e5d2f7d124d16418bc289c4a8a4b82

thanks for posting it.

It seems there has been a confusion with what we talked about 
previously, and I'm sorry about that.

When mentioning a minimal example, what I had in mind was the Lorelei 
plugin with a minimal example using it. The goal was *not* to show how 
Lorelei internals work (thunk libraries, etc), but how to use Lorelei 
itself.

 From our follow-up conversation on Discord, I understand that Lorelei 
is still in heavy development, so it might be a bit early to integrate 
this in QEMU. I understand also there might be other changes required on 
linux-user side for some specific applications. We would be happy to 
review those, if we can have an upstream plugin justifying this.

Thus, I would invite you to keep on working on Lorelei until you have a 
stable plugin covering all use cases, and see to upstream it if you need 
other changes on linux-user side. Else, I think it can stay downstream 
with Lorelei libraries also.

Keep us informed of the progress on Lorelei :)!

Cheers,
Pierrick