[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v11 23/29] target/arm: [tcg] Port to translate_i
From: |
Lluís Vilanova |
Subject: |
Re: [Qemu-devel] [PATCH v11 23/29] target/arm: [tcg] Port to translate_insn |
Date: |
Fri, 07 Jul 2017 19:18:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Richard Henderson writes:
> 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.
There was no code being generated after this specific case, but I haven't
checked if DISAS_EXC is set in any other place that is not immediately followed
by a "goto done_generating".
Does this mean DISAS_EXC should be on the generic code and do a "goto
done_generating" whenever it is found? And if so, what are the correct places to
check for this? After ops->insn_start, ops->translate_insn, ops->tb_stop?
Thanks,
Lluis