qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Xin Tong <xerox.time.tech@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] TCG register allocator
Date: Wed, 25 Jan 2012 10:55:27 -0500	[thread overview]
Message-ID: <CALKntY381bNqxsezuqyTxRzd1gcLMKe2kfybkJfHMWcdw=gYTA@mail.gmail.com> (raw)
In-Reply-To: <CALKntY22mt2ru4dxKpt4FjXZduGYfCzTgYZ_pYHpApyo+UWg1A@mail.gmail.com>

The segfault is caused by jumping to the middle of an instruction. so
i want to know which TB jumps here.

Thanks

Xin


On Wed, Jan 25, 2012 at 10:54 AM, Xin Tong <xerox.time.tech@gmail.com> wrote:
> I have a bug, it segfaults when executing a translation blocks. when i
> disable block chaining, the bug disappears.  However, with block
> chaining, i do not know which translation block jumps to the code
> which caused the segfault. I want to reserve a register and use it to
> record the last translation block executed.  So at entry, i assign the
> translation blocks address to the register and when the segfault
> happens, I can get the last translation block executed.
>
> Thanks
>
>
>
> On Wed, Jan 25, 2012 at 10:49 AM, Peter Maydell
> <peter.maydell@linaro.org> wrote:
>> On 25 January 2012 15:42, Xin Tong <xerox.time.tech@gmail.com> wrote:
>>> I tried to reserve a register in target-i386 with this code
>>>
>>> target-i386/translate.c    tb_env = tcg_global_reg_new_ptr(TCG_AREG1, "env");
>>
>> Why do you want to define a second global which holds the environment
>> variable? Just use TCG_AREG0 for that.
>>
>>> i386/tcg-target.h         #define TCG_AREG1 TCG_REG_R13
>>>
>>> i386/tcg-target.c         tcg_out_movi(s, TCG_TYPE_PTR, TCG_AREG1, args[0]);
>>>
>>> But when i looked into the dynamically generated code, the place which
>>> i use TCG_AREG1 becomes RBP and RBP is not reserved either.
>>
>> If the reason you're trying to reserve a register is so you can use
>> it as a temporary in tcg-target.c's codegen, then reserve it in
>> tcg_target_init(). (But x86-32 is very short on registers as it is,
>> so really it would be much better not to...)
>>
>> -- PMM

  reply	other threads:[~2012-01-25 15:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-25 14:24 [Qemu-devel] TCG register allocator Xin Tong
2012-01-25 15:19 ` Peter Maydell
2012-01-25 15:42   ` Xin Tong
2012-01-25 15:49     ` Peter Maydell
2012-01-25 15:54       ` Xin Tong
2012-01-25 15:55         ` Xin Tong [this message]
2012-01-25 16:22           ` Peter Maydell
2012-01-25 18:58             ` Xin Tong
2012-01-25 19:10               ` Xin Tong
2012-01-25 19:18                 ` James Greensky
2012-01-25 19:19                   ` Xin Tong
2012-01-25 19:23                 ` Peter Maydell
2012-01-25 19:25                   ` Xin Tong
2012-01-25 19:33                     ` Peter Maydell
2012-01-31  3:09               ` 陳韋任
2012-01-25 16:03         ` Max Filippov

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='CALKntY381bNqxsezuqyTxRzd1gcLMKe2kfybkJfHMWcdw=gYTA@mail.gmail.com' \
    --to=xerox.time.tech@gmail.com \
    --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).