|
From: | Alex Bennée |
Subject: | Re: [Qemu-devel] [Qemu-arm] [PATCH 03/13] target/arm/arm-semi: Make semihosting code hand out its own file descriptors |
Date: | Thu, 12 Sep 2019 12:02:16 +0100 |
User-agent: | mu4e 1.3.4; emacs 27.0.50 |
Peter Maydell <address@hidden> writes: > Currently the Arm semihosting code returns the guest file descriptors > (handles) which are simply the fd values from the host OS or the > remote gdbstub. Part of the semihosting 2.0 specification requires > that we implement special handling of opening a ":semihosting-features" > filename. Guest fds which result from opening the special file > won't correspond to host fds, so to ensure that we don't end up > with duplicate fds we need to have QEMU code control the allocation > of the fd values we give the guest. > > Add in an abstraction layer which lets us allocate new guest FD > values, and translate from a guest FD value back to the host one. > This also fixes an odd hole where a semihosting guest could > use the semihosting API to read, write or close file descriptors > that it had never allocated but which were being used by QEMU itself. I'm kind surprised QEMU doesn't already need this sort of facility for something else. I guess virtfs and 9p have their own thing? > > Signed-off-by: Peter Maydell <address@hidden> Anyway: Reviewed-by: Alex Bennée <address@hidden> -- Alex Bennée
[Prev in Thread] | Current Thread | [Next in Thread] |