From: Tuomas Vainikka <tuomas.vainikka@aalto.fi>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linux/m68k <linux-m68k@vger.kernel.org>
Subject: Re: Atari TT (next)
Date: Mon, 9 Jan 2012 14:40:26 +0200 [thread overview]
Message-ID: <4F0AE03A.7050501@aalto.fi> (raw)
In-Reply-To: <CAMuHMdXjWyEEOS4fJEaY1dg_cZWLyTps85jaQzsvbO_44-UhqA@mail.gmail.com>
On 01/09/2012 02:14 PM, Geert Uytterhoeven wrote:
> On Mon, Jan 9, 2012 at 11:40, Andreas Schwab<schwab@linux-m68k.org> wrote:
>> Alan Hourihane<alanh@fairlite.co.uk> writes:
>>
>>> *** FORMAT ERROR *** FORMAT=0
>>> Current process id is 768
>>> BAD KERNEL TRAP: 00000000
>>> Modules linked in:
>>> PC: [<000029de>] flush_thread+0x8/0xe
>> void flush_thread(void)
>> {
>> unsigned long zero = 0;
>>
>> current->thread.fs = __USER_DS;
>> if (!FPU_IS_EMU)
>> asm volatile (".chip 68k/68881\n\t"
>> "frestore %0@\n\t"
>> ".chip 68k" : : "a" (&zero));
>> }
>>
>> GCC is optimizing away the initialisation of zero, since nothing visible
>> is using its value.
>>
>> Andreas.
>>
>> --------------------------->8----------------------------------------
>> From bbf7451db90fcec5eade9d8bc913b78829192b9c Mon Sep 17 00:00:00 2001
>> From: Andreas Schwab<schwab@linux-m68k.org>
>> Date: Mon, 9 Jan 2012 11:36:18 +0100
>> Subject: [PATCH] m68k: fix assembler constraint to prevent overeager gcc
>> optimisation
>>
>> Passing the address of a variable as an operand to an asm statement
>> doesn't mark the value of this variable as used, so gcc optimized its
>> initialisation away. Fix this by using a "m" constraint instead.
>> ---
>> arch/m68k/kernel/process_mm.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/m68k/kernel/process_mm.c b/arch/m68k/kernel/process_mm.c
>> index 1bc223a..aa4ffb8 100644
>> --- a/arch/m68k/kernel/process_mm.c
>> +++ b/arch/m68k/kernel/process_mm.c
>> @@ -189,8 +189,8 @@ void flush_thread(void)
>> current->thread.fs = __USER_DS;
>> if (!FPU_IS_EMU)
>> asm volatile (".chip 68k/68881\n\t"
>> - "frestore %0@\n\t"
>> - ".chip 68k" : : "a" (&zero));
>> + "frestore %0\n\t"
>> + ".chip 68k" : : "m" (zero));
>> }
>>
>> /*
>> --
>> 1.7.8.3
> Thanks!
>
> Tuomas: I think this will fix your problem, too?
>
I'll stop nagging if it works. :)
Tuomas
next prev parent reply other threads:[~2012-01-09 12:49 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-07 1:27 Atari TT (next) Alan Hourihane
2012-01-07 6:47 ` Michael Schmitz
2012-01-07 16:59 ` Alan Hourihane
2012-01-08 0:46 ` Alan Hourihane
2012-01-08 4:13 ` Michael Schmitz
2012-01-08 9:35 ` Andreas Schwab
2012-01-08 9:42 ` Alan Hourihane
2012-01-08 23:51 ` Michael Schmitz
2012-01-08 23:59 ` Alan Hourihane
2012-01-09 0:05 ` Michael Schmitz
2012-01-09 0:14 ` Alan Hourihane
2012-01-09 0:23 ` Andreas Schwab
2012-01-09 3:17 ` Michael Schmitz
2012-01-09 1:03 ` Alan Hourihane
2012-01-09 1:25 ` Alan Hourihane
2012-01-09 10:40 ` Andreas Schwab
2012-01-09 11:22 ` Alan Hourihane
2012-01-09 12:14 ` Geert Uytterhoeven
2012-01-09 12:40 ` Tuomas Vainikka [this message]
2012-01-09 14:10 ` [PATCH] m68k: fix assembler constraint to prevent overeager gcc optimisation Andreas Schwab
2012-01-22 10:15 ` Geert Uytterhoeven
2012-01-22 10:53 ` Geert Uytterhoeven
2012-01-22 12:42 ` Andreas Schwab
2012-01-09 3:16 ` Atari TT (next) Michael Schmitz
2012-01-27 17:01 ` Thorsten Glaser
2012-01-28 20:33 ` Michael Schmitz
2012-01-29 0:57 ` Thorsten Glaser
2012-01-29 9:42 ` Geert Uytterhoeven
2012-01-29 19:55 ` Thorsten Glaser
2012-01-29 21:56 ` Geert Uytterhoeven
2012-01-08 10:20 ` Geert Uytterhoeven
2012-01-08 19:21 ` Michael Schmitz
2012-01-08 19:53 ` Geert Uytterhoeven
2012-01-08 23:42 ` Michael Schmitz
2012-01-08 22:05 ` Andreas Schwab
2012-01-08 23:39 ` Michael Schmitz
2012-01-08 23:49 ` Alan Hourihane
2012-01-08 23:58 ` Michael Schmitz
2012-01-08 13:36 ` Andreas Schwab
2012-01-08 14:42 ` Alan Hourihane
2012-01-08 19:24 ` Michael Schmitz
2012-01-08 17:45 ` Geert Uytterhoeven
2012-01-08 19:50 ` Alan Hourihane
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=4F0AE03A.7050501@aalto.fi \
--to=tuomas.vainikka@aalto.fi \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@vger.kernel.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