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?
