如何将退出代码从 QEMU 来宾传送到 arm64 / aarch64 上的主机(相当于 isa-debug-exit)

how to communicate an exit code from the QEMU guest to the host on arm64 / aarch64 (equivalent to isa-debug-exit)

我发现我可以让来宾写入由命令行标志指定的端口 isa-debug-exit,写入端口的值被用作 QEMU 的退出代码(经过一些可预测的转换). aarch64 / arm64 是否有等效机制?

您可以为此使用半主机 API:请参阅 qemu-system-aarch64 exit from within the guest system 了解详细信息(以及使用时需要信任来宾代码的注意事项)。