All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang S <gang.chen@sunrus.com.cn>
To: Richard Henderson <rth@twiddle.net>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Chris Metcalf <cmetcalf@ezchip.com>,
	Riku Voipio <riku.voipio@iki.fi>,
	qemu-devel <qemu-devel@nongnu.org>,
	"walt@tilera.com" <walt@tilera.com>
Subject: Re: [Qemu-devel] [PATCH] target-tilegx: Execute _start and reach to __libc_start_main successfully
Date: Fri, 27 Feb 2015 07:30:14 +0800	[thread overview]
Message-ID: <54EFAC86.7010101@sunrus.com.cn> (raw)
In-Reply-To: <54EF4A7B.20107@twiddle.net>

On 02/27/2015 12:31 AM, Richard Henderson wrote:
> On 02/25/2015 03:44 PM, Chen Gang S wrote:
>> OK, thanks. After check ISA document again, for me, we have to still use
>> "y0, y1, y2", e.g. de5e598034ac3000 { fnop ; jalr r12 ; st r10, r11 }
>>
>>  If y0 -> y1 -> y2:
>>
>>  - if jalr succeeds, it will write pc to sp stack, but sp is not changed
>>    (just like lr, pc, they are buffered to tcg temporary variables).
>>
>>  - if st fails, as the result, we can still say the whole bundle is not
>>    execute (it has already written pc to sp stack, but sp isn't changed,
>>    so it is still OK).
>>
>>  If y0 -> y2 -> y1:
>>
>>  - if st succeeds, it will write data to the useful memory.
>>
>>  - if jalr fails (e.g. sp stack is full, which may cause memory access
>>    issue), we can not restore the bundle.
> 
> You need to re-check the ISA document.  JALR does not write to the "real" stack
> at all, and cannot raise any kind of exception.
> 
> Section 2.1.2.3 clearly defines pushReturnStack as part of the branch
> prediction mechanism on the cpu.  It can be completely ignored for QEMU.
> 

OK, thanks. What you said above sounds reasonable to me.


Thanks.
-- 
Open, share, and attitude like air, water, and life which God blessed.

  reply	other threads:[~2015-02-26 23:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24  7:53 [Qemu-devel] [PATCH] target-tilegx: Execute _start and reach to __libc_start_main successfully Chen Gang S
2015-02-24  8:07 ` Chen Gang S
2015-02-24 14:21 ` Chris Metcalf
2015-02-24 14:38   ` Peter Maydell
2015-02-24 15:39     ` Chen Gang S
2015-02-24 16:42       ` Richard Henderson
2015-02-24 17:08         ` Chen Gang S
2015-02-24 16:31   ` Chen Gang S
2015-02-24 16:46     ` Chris Metcalf
2015-02-24 17:25       ` Chen Gang S
2015-02-24 18:18         ` Chris Metcalf
2015-02-25  1:01           ` Chen Gang S
2015-02-24 17:55 ` Richard Henderson
2015-02-25  3:40   ` Chen Gang S
2015-02-25 17:19     ` Richard Henderson
2015-02-26  1:44       ` Chen Gang S
2015-02-26 16:31         ` Richard Henderson
2015-02-26 23:30           ` Chen Gang S [this message]
2015-02-27  3:01         ` Chris Metcalf
2015-02-27  3:41           ` Chen Gang S

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=54EFAC86.7010101@sunrus.com.cn \
    --to=gang.chen@sunrus.com.cn \
    --cc=cmetcalf@ezchip.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=rth@twiddle.net \
    --cc=walt@tilera.com \
    /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.