This patch series implements support for semihosting for the 64-bit ARM instruction set.
It owes a significant debt to the patches sent earlier by Christopher Covington (and with code written by Derek Hower). However, it is a full from-scratch rewrite (since there were several things which I felt those patches didn't take the right approach on). I mostly just looked at the earlier patches to check I hadn't missed anything. The changes in the A64 API compared to the A32/T32 one are: * input syscall number is in register W0 * return result is in register X0 * all argument parameter blocks are 64 bits wide, not 32 * there is a new SyncCacheRange syscall * the SYS_EXIT syscall takes a parameter block and is able to pass a guest exit status out * the insn used to trigger semihosting is a HLT, not an SVC or BKPT. I've tested this for A32, T32 and A64 semihosting, for both usermode and system emulation, with and without gdb remote syscalls. The test code I wrote to do the testing is here: https://git.linaro.org/people/peter.maydell/semihosting-tests.git/ (not very exciting, but might be handy if anybody needs a basic "how to run C code starting with bare metal system emulation" template.) The test series also includes a bugfix: we haven't correctly forwarded SYS_WRITE0 (print string to terminal) to gdb since the gdb hosted syscall support was added to QEMU back in 2007... Christopher Covington (1): target-arm: Improve semihosting debug prints Peter Maydell (8): target-arm/arm-semi.c: Fix broken SYS_WRITE0 via gdb gdbstub: Implement gdb_do_syscallv() target-arm/arm-semi.c: Factor out repeated 'return env->regs[0]' include/exec/softmmu-semi.h: Add support for 64-bit values target-arm/arm-semi.c: Support widening APIs to 64 bits target-arm/arm-semi.c: Implement A64 specific SyncCacheRange call target-arm/arm-semi.c: SYS_EXIT on A64 takes a parameter block target-arm: Wire up HLT 0xf000 as the A64 semihosting instruction gdbstub.c | 14 ++-- include/exec/gdbstub.h | 27 +++++++ include/exec/softmmu-semi.h | 18 +++++ linux-user/main.c | 3 + target-arm/arm-semi.c | 171 +++++++++++++++++++++++++++++++++----------- target-arm/cpu.h | 3 +- target-arm/helper-a64.c | 6 ++ target-arm/helper.c | 12 +++- target-arm/internals.h | 2 + target-arm/translate-a64.c | 14 +++- 10 files changed, 217 insertions(+), 53 deletions(-) -- 1.9.1