From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTV94-00083d-EF for qemu-devel@nongnu.org; Fri, 07 Jul 2017 11:26:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTV93-0007zv-LN for qemu-devel@nongnu.org; Fri, 07 Jul 2017 11:26:14 -0400 Sender: Richard Henderson References: <149865219962.17063.10630533069463266646.stgit@frigg.lan> <149865776960.17063.4875279139522061160.stgit@frigg.lan> <2bfdb883-f19b-7fcf-c28b-7ce39115937e@twiddle.net> <87podcebyi.fsf@frigg.lan> From: Richard Henderson Message-ID: <3745ae02-3fb0-1503-9c99-98dce369f697@twiddle.net> Date: Fri, 7 Jul 2017 05:26:03 -1000 MIME-Version: 1.0 In-Reply-To: <87podcebyi.fsf@frigg.lan> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v11 23/29] target/arm: [tcg] Port to translate_insn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Peter Maydell , Peter Crosthwaite , "Emilio G. Cota" , "open list:ARM" , Paolo Bonzini , =?UTF-8?Q?Alex_Benn=c3=a9e?= On 07/07/2017 01:13 AM, LluĂ­s Vilanova wrote: >>> + if (dc->ss_active && !dc->pstate_ss) { >>> + /* Singlestep state is Active-pending. >>> + * If we're in this state at the start of a TB then either >>> + * a) we just took an exception to an EL which is being debugged >>> + * and this is the first insn in the exception handler >>> + * b) debug exceptions were masked and we just unmasked them >>> + * without changing EL (eg by clearing PSTATE.D) >>> + * In either case we're going to take a swstep exception in the >>> + * "did not step an insn" case, and so the syndrome ISV and EX >>> + * bits should be zero. >>> + */ >>> + assert(dc->base.num_insns == 1); >>> + gen_exception(EXCP_UDEF, syn_swstep(dc->ss_same_el, 0, 0), >>> + default_exception_el(dc)); >>> + dc->base.is_jmp = DISAS_SKIP; > >> This is surely DISAS_EXC -- see gen_step_complete_exception. >> Why introduce a new name? > > The original code goes straight to done_generating here, and that's the purpose > of DISAS_SKIP (skip the code executed between the end of the loop and the > done_generating label). That is the purpose of DISAS_EXC too. We've called a noreturn helper to raise an exception and all following code is unreached. If there *was* any code being emitted afterward, that is arguably a bug. r~