来宾系统内部的qemu-system-aarch64出口 [英] qemu-system-aarch64 exit from within the guest system

查看:85
本文介绍了来宾系统内部的qemu-system-aarch64出口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法可以从aarch64版本的来宾系统中退出qemu.例如,x86具有用于此目的的isa-debug-exit设备.

I was wondering if there is a way to exit from qemu from within the guest system in the aarch64 version. For instance the x86 has the isa-debug-exit device which is used for this purpose.

有什么想法吗?

欢呼

推荐答案

此问题的一般答案是做任何在真实硬件上引起断电的事情".具体细节取决于QEMU在模拟哪台计算机.对于aarch64"virt"板,可以使用仿真的PSCI固件接口通过SYSTEM_OFF功能请求关闭电源.

The general answer to this question is "do whatever you would do on the real hardware to cause a power-off". The details of this depend on which machine QEMU is emulating. For the aarch64 "virt" board, you can use the emulated PSCI firmware interface to request a powerdown using the SYSTEM_OFF function.

PSCI API文档在这里: http://infocenter.arm.com/help/topic/com.arm.doc.den0022d/Power_State_Coordination_Interface_PDD_v1_1_DEN0022D.pdf

The PSCI API documentation is here: http://infocenter.arm.com/help/topic/com.arm.doc.den0022d/Power_State_Coordination_Interface_PDD_v1_1_DEN0022D.pdf

出于调试/测试目的,您可能还对半主机API( https://developer.arm.com/docs/dui0003/b ),它具有SYS_EXIT函数,但有一些警告:对于QEMU,如果仅通过-semihosting命令行参数启用半主机,则只能使用半主机,并且只能在内核模式下使用来宾,并且只有在您完全信任来宾代码的情况下,才可以使用它,因为它提供对允许来宾读取和写入任何主机文件的功能的访问.但是对于明确受信任的小型测试程序,这可能是进行轻松的调试打印并以给定退出状态退出的好方法.

For debug/test purposes you might also be interested in the semihosting API (https://developer.arm.com/docs/dui0003/b) which has a SYS_EXIT function, but some caveats: for QEMU you can only use semihosting if you enable it via the -semihosting commandline argument, and only from kernel mode in the guest, and you must only use it if you absolutely trust the guest code, because it provides access to functions that allow the guest to read and write any host file. But for explicitly trusted small test programs it can be a nice way to do easy debug printing and exit with a given exit status.

这篇关于来宾系统内部的qemu-system-aarch64出口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆