All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Smolov <smolov@ispras.ru>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] MIPS 'move' insn emulation
Date: Tue, 12 Sep 2017 17:53:55 +0300	[thread overview]
Message-ID: <59B7F503.8010703@ispras.ru> (raw)
In-Reply-To: <CAFEAcA-to=vWWBHoxZRX-ExcbDe0OTMwpHunE7HXaYA0GE+ccw@mail.gmail.com>


On 12.09.2017 17:32, Peter Maydell wrote:
> On 12 September 2017 at 15:14, Sergey Smolov <smolov@ispras.ru> wrote:
>> I've the code I probably need to modify in target/mips/translate.c:
>>
>> [code]
>>
>> static void gen_logic(DisasContext *ctx, uint32_t opc,
>>                        int rd, int rs, int rt)
>> {
>> ...
>> } else if (rs != 0 && rt == 0) {
>>              tcg_gen_mov_tl(cpu_gpr[rd], cpu_gpr[rs]);
>> }
>>
>> [/code]
>>
>> I suppose that for my assembler program cpu_gpr[rs] here should contain 0x7
>> value at runtime. Is it possible to extract this value somehow? I've tried
>> the following constructions:
>>
>> GET_TCG_I32(cpu_gpr[rs])
>> ((CPUMIPSState *)tcg_ctx.cpu)->active_tc.gpr[rs]
>>
>> but they do not provide me the correct value.
> You can't do this in this bit of the code. The functions in
> translate.c are called at "translate time", when we convert
> MIPS assembly into x86 code to run on the host. At this point
> we don't know what the values in MIPS registers are, because
> we're generating code that will later be run multiple times
> perhaps with different values. The register contents are only
> known later, at "run time".
>
> thanks
> -- PMM

Thank you, Peter.

Generally speaking, is it possible at "run time" to detect write 
accesses to MIPS GPR registers?
If true, which parts of code should I look in?

-- 
Sincerely yours,
Sergey Smolov

  reply	other threads:[~2017-09-12 14:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12 14:14 [Qemu-devel] MIPS 'move' insn emulation Sergey Smolov
2017-09-12 14:32 ` Peter Maydell
2017-09-12 14:53   ` Sergey Smolov [this message]
2017-09-12 15:06     ` Peter Maydell
2017-09-13  7:29       ` Sergey Smolov
2017-09-13 11:01         ` Peter Maydell
2017-09-13 14:20           ` Yongbok Kim
2017-09-14 13:49             ` Sergey Smolov
2017-09-14 13:58               ` Peter Maydell
2017-09-14 14:16                 ` Sergey Smolov
2017-09-14 14:23                   ` Yongbok Kim
2017-09-14 14:29                     ` Peter Maydell
2017-09-14 16:32                     ` Sergey Smolov

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=59B7F503.8010703@ispras.ru \
    --to=smolov@ispras.ru \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.