From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YR7sn-0004be-EA for qemu-devel@nongnu.org; Thu, 26 Feb 2015 18:30:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YR7si-0006gw-Fu for qemu-devel@nongnu.org; Thu, 26 Feb 2015 18:30:17 -0500 Received: from out1134-243.mail.aliyun.com ([42.120.134.243]:57726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YR7si-0006fG-4s for qemu-devel@nongnu.org; Thu, 26 Feb 2015 18:30:12 -0500 Message-ID: <54EFAC86.7010101@sunrus.com.cn> Date: Fri, 27 Feb 2015 07:30:14 +0800 From: Chen Gang S MIME-Version: 1.0 References: <54EC2DEE.8050809@sunrus.com.cn> <54ECBB02.1080801@redhat.com> <54ED443B.7040207@sunrus.com.cn> <54EE0433.3070101@twiddle.net> <54EE7A6D.6000704@sunrus.com.cn> <54EF4A7B.20107@twiddle.net> In-Reply-To: <54EF4A7B.20107@twiddle.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-tilegx: Execute _start and reach to __libc_start_main successfully List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Peter Maydell , Chris Metcalf , Riku Voipio , qemu-devel , "walt@tilera.com" 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.