On Thu, 2025-02-27 at 09:55 +0000, Peter Maydell wrote:
> On Thu, 27 Feb 2025 at 05:44, Yanfeng Liu <yfliu2...@qq.com> wrote:
> > I am wondering QEMU semihosting for ARM or RISCV targets allows user to
> > control
> > the set of functions available in semihosting? for example, I want give
> > read-
> > only host folder share and poweroff functions to a guest. Is this possible?
> 
> No, these are not things that the semihosting ABI includes.
> Semihosting does allow the guest to read and write *any*
> file on the host, so you mustn't give it to an untrusted
> guest. And there's no poweroff function in semihosting.
> (There is a SYS_EXIT, but this will exit the whole of QEMU
> in a pretty abrupt way; it's not like a powerdown.)
> 
> The semihosting ABI is provision of a specific set of
> functions defined in an external specification; it's not
> something that we created in QEMU. The main aim of
> semihosting is for debugging, especially debugging of
> standalone or lowlevel guest code. It's not intended
> or ever going to be something for providing arbitrary
> VM services to a full-featured guest OS.
> 
> -- PMM
Thanks for the clarification.
Regards,
yf


Reply via email to