From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: david.brenken@efs-auto.de
Subject: Re: [Qemu-devel] [PATCH 3/3] target/tricore: Use translate_loop
Date: Tue, 18 Jun 2019 14:06:11 +0200 [thread overview]
Message-ID: <9d2149ef-57f5-c4b7-220c-81483b108f24@mail.uni-paderborn.de> (raw)
In-Reply-To: <b2f6e776-90e4-3809-350f-ce2bf6d69017@linaro.org>
On 6/17/19 6:45 PM, Richard Henderson wrote:
> On 6/17/19 7:35 AM, Bastian Koppelmann wrote:
>> +static void tricore_tr_init_disas_context(DisasContextBase *dcbase,
>> + CPUState *cs)
>> {
>> + DisasContext *ctx = container_of(dcbase, DisasContext, base);
>> CPUTriCoreState *env = cs->env_ptr;
>> + ctx->base.pc_next = ctx->base.pc_first;
> This is already done in generic code.
>
> I don't see an initialization of hflags & saved_hflags?
> Although I don't see that either before or afterward...
Yes, I mentioned this problem in David's patch
(https://lists.gnu.org/archive/html/qemu-devel/2019-06/msg01058.html).
If he doesn't fix it, I will in a follow-up patch.
>
>> +static bool tricore_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cpu,
>> + const CPUBreakpoint *bp)
>> +{
>> + return true;
>> +}
> Not supporting breakpoints, I think it's better to return false here.
>
> Although it's not difficult -- just raise EXCP_DEBUG as an exception.
> It'd be nice to follow up and fix this afterward.
Yes, I will do that.
>
>> +static void tricore_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
>> +{
>> + DisasContext *ctx = container_of(dcbase, DisasContext, base);
>> + CPUTriCoreState *env = cpu->env_ptr;
>> +
>> + ctx->opcode = cpu_ldl_code(env, ctx->base.pc_next);
>> + decode_opc(ctx);
>> + ctx->base.pc_next = ctx->pc_succ_insn;
>> +
>> + if (ctx->base.is_jmp == DISAS_NEXT) {
>> + target_ulong page_start;
>> +
>> + page_start = ctx->base.pc_first & TARGET_PAGE_MASK;
>> + if (ctx->base.pc_next - page_start >= TARGET_PAGE_SIZE) {
>> + ctx->base.is_jmp = DISAS_TOO_MANY;
>> }
> This isn't perfect as an ending, but you didn't seem to have one at all before,
> so I guess improvements can come incrementally afterward.
>
> Have a look at the end of thumb_tr_translate_insn & insn_crosses_page to see
> how to handle this properly.
I copied it more or less from target/riscv. I guess that needs fixing as
well :)
Cheers,
Bastian
next prev parent reply other threads:[~2019-06-18 12:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 14:35 [Qemu-devel] [PATCH 0/3] tricore: Convert to translate_loop Bastian Koppelmann
2019-06-17 14:35 ` [Qemu-devel] [PATCH 1/3] target/tricore: Use DisasContextBase API Bastian Koppelmann
2019-06-17 16:06 ` Richard Henderson
2019-06-17 14:35 ` [Qemu-devel] [PATCH 2/3] target-tricore: Make env a member of DisasContext Bastian Koppelmann
2019-06-17 16:11 ` Richard Henderson
2019-06-17 14:35 ` [Qemu-devel] [PATCH 3/3] target/tricore: Use translate_loop Bastian Koppelmann
2019-06-17 16:45 ` Richard Henderson
2019-06-18 12:06 ` Bastian Koppelmann [this message]
2019-06-18 14:28 ` Richard Henderson
2019-06-17 16:51 ` Richard Henderson
2019-06-17 19:07 ` [Qemu-devel] [PATCH 0/3] tricore: Convert to translate_loop no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9d2149ef-57f5-c4b7-220c-81483b108f24@mail.uni-paderborn.de \
--to=kbastian@mail.uni-paderborn.de \
--cc=david.brenken@efs-auto.de \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).