From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMpOt-0002UF-9W for qemu-devel@nongnu.org; Mon, 21 Dec 2009 16:02:43 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMpOs-0002U0-6R for qemu-devel@nongnu.org; Mon, 21 Dec 2009 16:02:42 -0500 Received: from [199.232.76.173] (port=38809 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMpOr-0002Ts-P7 for qemu-devel@nongnu.org; Mon, 21 Dec 2009 16:02:41 -0500 Received: from are.twiddle.net ([75.149.56.221]:48244) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMpOr-0001sB-5a for qemu-devel@nongnu.org; Mon, 21 Dec 2009 16:02:41 -0500 Message-ID: <4B2FE270.80007@twiddle.net> Date: Mon, 21 Dec 2009 13:02:40 -0800 From: Richard Henderson MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 3/3] linux-user: Initialize Alpha FPCR register. References: <2d2f4a285db07da0e453535318a463573c5397d4.1261264754.git.rth@twiddle.net> <9f33a8f00045c6cf1ba26be71b76ff84fb7e0eac.1261264754.git.rth@twiddle.net> <20091221103305.GB4990@volta.aurel32.net> In-Reply-To: <20091221103305.GB4990@volta.aurel32.net> Content-Type: multipart/mixed; boundary="------------060503050507070801020006" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------060503050507070801020006 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit On 12/21/2009 02:33 AM, Aurelien Jarno wrote: > On Sat, Dec 19, 2009 at 03:17:16PM -0800, Richard Henderson wrote: >> Signed-off-by: Richard Henderson >> --- >> linux-user/main.c | 2 ++ >> 1 files changed, 2 insertions(+), 0 deletions(-) >> >> diff --git a/linux-user/main.c b/linux-user/main.c >> index 12502ad..b67662c 100644 >> --- a/linux-user/main.c >> +++ b/linux-user/main.c >> @@ -3052,6 +3052,8 @@ int main(int argc, char **argv, char **envp) >> env->ir[30] = regs->usp; >> env->pc = regs->pc; >> env->unique = regs->unique; >> + cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD >> + | FPCR_UNFD | FPCR_INED | FPCR_DNOD)); >> } > > This cpu initialization which does not depends on the binary being run > is usually done in target-*/translate.c, using #if defined > (CONFIG_USER_ONLY). I didn't want to assume that bsd-user initializes the fpcr to the same value. However, they probably do. This appears to be what you wanted. r~ --------------060503050507070801020006 Content-Type: text/plain; name="commit-fpcr.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="commit-fpcr.txt" commit 033df7a558acdf39d81681f3858f13ebe2a92a6e Author: Richard Henderson Date: Mon Dec 21 12:48:43 2009 -0800 target-alpha: Initialize fpcr. Linux, at least, disables exceptions by default. Signed-off-by: Richard Henderson diff --git a/target-alpha/translate.c b/target-alpha/translate.c index 5e0647b..87813e7 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -2748,6 +2748,8 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model) env->ps = 0x1F00; #if defined (CONFIG_USER_ONLY) env->ps |= 1 << 3; + cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD + | FPCR_UNFD | FPCR_INED | FPCR_DNOD)); #endif pal_init(env); /* Initialize IPR */ --------------060503050507070801020006--