From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUL1j-000374-4A for qemu-devel@nongnu.org; Tue, 25 Aug 2015 16:41:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUL1f-0003ip-Vj for qemu-devel@nongnu.org; Tue, 25 Aug 2015 16:41:03 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUL1f-0003hu-QW for qemu-devel@nongnu.org; Tue, 25 Aug 2015 16:40:59 -0400 Message-ID: <55DCD2D9.6040003@codeaurora.org> Date: Tue, 25 Aug 2015 16:40:57 -0400 From: Christopher Covington MIME-Version: 1.0 References: <1439483745-28752-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1439483745-28752-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/9] target-arm: Implement A64 semihosting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Christopher Covington , patches@linaro.org Hi Peter, On 08/13/2015 12:35 PM, Peter Maydell wrote: > 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... Your work on this is greatly appreciated. Tested-by: Christopher Covington This works for simple Linux userspace angel-load, angel-store, and angel-exit utilities as well as at least one newlib/libgloss test. Some more complicated newlib/libgloss binaries don't run, but that appears to be because of attempted vbar_el3 accesses. If it's not much trouble, adding your semihosting tests to kvm-unit-tests might be nice. Thanks, Christopher Covington -- Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project