qemu-devel.nongnu.org archive mirror
 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] QEMU+Aarch64: in_asm log skips instructions of loop-programs
Date: Thu, 3 Sep 2015 11:09:13 +0400	[thread overview]
Message-ID: <55E7F219.9020408@ispras.ru> (raw)
In-Reply-To: <CAFEAcA-CBGYUuSi766x=i7D6zMKv+_e3b+2OBe6dgKybeVjTMA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2377 bytes --]



03.09.2015 10:33, Peter Maydell пишет:
> On 3 September 2015 at 06:27, Sergey Smolov <smolov@ispras.ru> wrote:
>> I mean that in this example QEMU does not write to log "intermediate" SUBS
>> instructions which appear in loop-unrolling process.
>> For me it woulb be ok if QEMU generate the following in_asm log:
>>
>> [log]
>> IN:
>> 0x0000000000000000:  94000001      bl #+0x4 (addr 0x4)
>>
>> ----------------
>> IN:
>> 0x0000000000000004:  d2800140      mov x0, #0xa
>>
>> ----------------
>> IN:
>> 0x0000000000000008:  f1000400      subs x0, x0, #0x1 (1)
>>
>> ----------------
>> IN:
>> 0x000000000000000c:  54000040      b.eq #+0x8 (addr 0x14)
>>
>> ----------------
>> IN:
>> 0x0000000000000008:  f1000400      subs x0, x0, #0x1 (1)
> QEMU's in_asm logging doesn't work like that. We log the
> instructions that we *translate*, not instructions that we
> *execute*. Generally we translate basic blocks and then
> cache them so they can be executed multiple times. (It's
> not actually guaranteed that a translated block will ever
> be executed, though it almost always will be.) The
> logging of input instructions happens at the translate phase.
> When we execute we don't have any information about the
> guest instructions involved.
>
> This has nothing to do with "loop-unrolling", which QEMU
> doesn't try to do at all.
>
> You might find the 'exec' logging helpful for tracking
> which translated blocks get executed.
>
> thanks
> -- PMM
>

Peter,

Thank you for your answer!

I've tested 'exec' logging and it does not contain unrolled llops too. 
For my sample it looks like:

[log]
Trace 0x7f999385a000 [0000000000000000]
Trace 0x7f999385a050 [0000000000000004]
Trace 0x7f999385a090 [*0000000000000008*]
Trace 0x7f999385a120 [000000000000000c]
Trace 0x7f999385a190 [0000000000000010]
Trace 0x7f999385a090 [*0000000000000008*]
Trace 0x7f999385a1d0 [0000000000000014]
Trace 0x7f999385a210 [0000000000000200]
Trace 0x7f999385a210 [0000000000000200]
...
[/log]

and contains only two records related to 'subs' instruction (it is 
situated on 0x0000000000000008 addresses whcih i've highlighted).

Also, is it true that after translation to internal representation 
(TCG-representation, yes?) there is no possibility at all to restore 
guest instructions?

Thanks,

Sergey Smolov

[-- Attachment #2: Type: text/html, Size: 3101 bytes --]

  reply	other threads:[~2015-09-03  8:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 12:55 [Qemu-devel] QEMU+Aarch64: in_asm log skips instructions of loop-programs Sergey Smolov
2015-09-02 13:50 ` Sergey Smolov
2015-09-02 16:39   ` Peter Maydell
2015-09-03  5:27     ` Sergey Smolov
2015-09-03  6:33       ` Peter Maydell
2015-09-03  7:09         ` Sergey Smolov [this message]
2015-09-03 14:28         ` Richard Henderson
     [not found] <7cd03581b882e28ef904a35a4ce1e374@ispras.ru>
2015-09-03 14:31 ` [Qemu-devel] Fwd: " Sergey Smolov
2015-09-03 15:35   ` [Qemu-devel] " Peter Maydell
2015-09-04  6:37     ` Sergey Smolov
2015-09-04 16:38       ` Sergey Smolov
2015-09-17 22:02         ` Christopher Covington
2015-09-18  8:15           ` Sergey Smolov
2015-09-18 14:26             ` Christopher Covington
2015-11-03 12:15               ` 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=55E7F219.9020408@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 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).