qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ziyang Zhang <functioner@sjtu.edu.cn>
To: richard henderson <richard.henderson@linaro.org>
Cc: Pierrick Bouvier <pierrick.bouvier@linaro.org>,
	 qemu-devel <qemu-devel@nongnu.org>,
	Riku Voipio <riku.voipio@iki.fi>,
	 Laurent Vivier <laurent@vivier.eu>,
	alex bennee <alex.bennee@linaro.org>,
	 Alexandre Iooss <erdnaxe@crans.org>,
	 Mahmoud Mandour <ma.mandourr@gmail.com>,
	 Zhengwei Qi <qizhwei@sjtu.edu.cn>,
	Yun Wang <yunwang94@sjtu.edu.cn>,
	 Mingyuan Xia <xiamy@ultrarisc.com>,
	Kailiang Xu <xukl2019@sjtu.edu.cn>
Subject: Re: [RFC PATCH V2 1/2] linux-user: add a plugin API to filter syscalls
Date: Thu, 30 Oct 2025 21:29:10 +0800 (CST)	[thread overview]
Message-ID: <1366034969.7416052.1761830950658.JavaMail.zimbra@sjtu.edu.cn> (raw)
In-Reply-To: <0359cbb1-d6ec-4d65-9ef1-2dc9fca6c038@linaro.org>

On 10/28/25 19:17, Richard Henderson wrote:
>>
>> Thanks for the review.
>> Beyond the code style, are you open to accept such a functionality as part of API plugins?
>
> Yes.

Thank you for your agreement!

Considering that our ultimate goal is to enable QEMU to support all features
of Lorelei, the current syscall filter can only play a limited role.

Here are some features currently required by Lorelei:

1. We need to bypass checks such as `pageflags` in `accel/tcg/user-exec.c`.
This is because the host library may provide memory blocks to the guest
program, and these memory blocks cannot be recorded by the page tables
emulated by `qemu-user`. As a result, errors may occur when invoking syscalls
like `read/write`.

2. The `cpu_loop` should support recursive invocation and exit. This is
necessary when the host library needs to execute guest callbacks, and the
recursively invoked `cpu_loop` should be able to return after the
callback finishes.

3. Since the host library may create new threads and execute guest callbacks
within those threads, the `thread_cpu` is `NULL` when the callback is first
executed. Therefore, a mechanism is required to create a `CPUState` when
`thread_cpu` is NULL.

Do you have any suggestions about how to implement these features?


  reply	other threads:[~2025-10-30 13:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22  6:52 [RFC PATCH V2 0/2] linux-user: add a syscall-filter plugin API Ziyang Zhang
2025-10-22  6:53 ` [RFC PATCH V2 1/2] linux-user: add a plugin API to filter syscalls Ziyang Zhang
2025-10-22 16:00   ` Richard Henderson
2025-10-27  7:14     ` Pierrick Bouvier
2025-10-28 11:17       ` Richard Henderson
2025-10-30 13:29         ` Ziyang Zhang [this message]
2025-10-22  6:54 ` [RFC PATCH V2 2/2] tcg tests: add a test to verify the syscall filter plugin API Ziyang Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366034969.7416052.1761830950658.JavaMail.zimbra@sjtu.edu.cn \
    --to=functioner@sjtu.edu.cn \
    --cc=alex.bennee@linaro.org \
    --cc=erdnaxe@crans.org \
    --cc=laurent@vivier.eu \
    --cc=ma.mandourr@gmail.com \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qizhwei@sjtu.edu.cn \
    --cc=richard.henderson@linaro.org \
    --cc=riku.voipio@iki.fi \
    --cc=xiamy@ultrarisc.com \
    --cc=xukl2019@sjtu.edu.cn \
    --cc=yunwang94@sjtu.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).