From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNPRp-0002c4-C7 for qemu-devel@nongnu.org; Thu, 06 Aug 2015 13:59:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNPRm-0004Ot-6a for qemu-devel@nongnu.org; Thu, 06 Aug 2015 13:59:21 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNPRm-0004Nh-0W for qemu-devel@nongnu.org; Thu, 06 Aug 2015 13:59:18 -0400 Message-ID: <55C3A06F.7030406@codeaurora.org> Date: Thu, 06 Aug 2015 13:59:11 -0400 From: Christopher Covington MIME-Version: 1.0 References: <1438793483-12721-1-git-send-email-cov@codeaurora.org> <1438793483-12721-2-git-send-email-cov@codeaurora.org> <87twsckci6.fsf@linaro.org> In-Reply-To: <87twsckci6.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC 01/14] Make unknown semihosting calls non-fatal List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= Cc: qemu-devel@nongnu.org Hi Alex, Thanks for taking a look. On 08/06/2015 05:11 AM, Alex Benn=C3=A9e wrote: >=20 > Christopher Covington writes: >=20 >> Signed-off-by: Christopher Covington >> --- >> target-arm/arm-semi.c | 7 +++---- >> 1 file changed, 3 insertions(+), 4 deletions(-) >> >> diff --git a/target-arm/arm-semi.c b/target-arm/arm-semi.c >> index a8b83e6..bcc70ec 100644 >> --- a/target-arm/arm-semi.c >> +++ b/target-arm/arm-semi.c >> @@ -186,8 +186,6 @@ static void arm_semi_flen_cb(CPUState *cs, target_= ulong ret, target_ulong err) >> #define SET_ARG(n, val) put_user_ual(val, args + (n) * 4) >> uint32_t do_arm_semihosting(CPUARMState *env) >> { >> - ARMCPU *cpu =3D arm_env_get_cpu(env); >> - CPUState *cs =3D CPU(cpu); >> target_ulong args; >> target_ulong arg0, arg1, arg2, arg3; >> char * s; >> @@ -195,6 +193,8 @@ uint32_t do_arm_semihosting(CPUARMState *env) >> uint32_t ret; >> uint32_t len; >> #ifdef CONFIG_USER_ONLY >> + ARMCPU *cpu =3D arm_env_get_cpu(env); >> + CPUState *cs =3D CPU(cpu); >> TaskState *ts =3D cs->opaque; >> #else >> CPUARMState *ts =3D env; >> @@ -562,7 +562,6 @@ uint32_t do_arm_semihosting(CPUARMState *env) >> exit(ret); >> default: >> fprintf(stderr, "qemu: Unsupported SemiHosting SWI 0x%02x\n",= nr); >> - cpu_dump_state(cs, stderr, fprintf, 0); >> - abort(); >> + return -1; >=20 > Do SemiHosting calls return anything to the guest? If so removing the > abort means the guest may go unpredictable if the call is just ignored. > If so the argument would be to leave the abort() in and just add the > missing semihosting calls. If were to pursue this further, I would want to review how external debug= gers supporting semihosting on hardware behave. However my current thinking is= that there are more commonly used mechanisms than semihosting that we can move= to for equivalent functionality. Functionality: standard mechanism Guest-initiated host filesystem access: VirtIO 9P passthrough filesystem Guest-initiated exit: poweroff (PSCI) Guest-initiated instruction counting: perf stat -e instructions:u (PMU) Guest-initiated checkpoint dump: [maybe QMP over guest agent VirtIO seria= l?] Thanks, Christopher Covington --=20 Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum= , a Linux Foundation Collaborative Project