public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* warning: read-write constraint -- 2.6.15-git8 onwards
@ 2006-01-18 18:25 Andy Whitcroft
  2006-01-19  3:03 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Whitcroft @ 2006-01-18 18:25 UTC (permalink / raw)
  To: Andi Kleen, Linux Kernel Mailing List

It seems that the following commit causes a bunch of warnings out of
most of the files in the kernel tree (see below for examples).  Backing
this out seems to cure them?

diff-tree 92934bcbf96bc9dc931c40ca5f1a57685b7b813b (from
636aab5ce332d88a76362797a55804c7da643467)`
tree eb9690ca6b23b5603429a8b3d290d6ca2545bcaf
parent 636aab5ce332d88a76362797a55804c7da643467
author Andi Kleen <ak@suse.de> 1137015752 +0100
committer Linus Torvalds <torvalds@g5.osdl.org> 1137034871 -0800

    [PATCH] i386/x86-64: Use input/output dependencies for bitops

    Noticed by Andreas Schwab

    Signed-off-by: Andi Kleen <ak@suse.de>
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Compiled with:

    gcc version 3.3.4 (Debian 1:3.3.4-6sarge1)

-apw

  CC      arch/x86_64/kernel/process.o
include/asm/bitops.h: In function `default_idle':
include/asm/bitops.h:65: warning: read-write constraint does not allow a
register
include/asm/bitops.h:65: warning: read-write constraint does not allow a
register
include/asm/bitops.h:30: warning: read-write constraint does not allow a
register
include/asm/bitops.h:30: warning: read-write constraint does not allow a
register
include/asm/bitops.h: In function `cpu_idle_wait':
include/asm/bitops.h:30: warning: read-write constraint does not allow a
register
include/asm/bitops.h:30: warning: read-write constraint does not allow a
register
include/asm/bitops.h:30: warning: read-write constraint does not allow a
register
include/asm/bitops.h:30: warning: read-write constraint does not allow a
register
include/asm/bitops.h:65: warning: read-write constraint does not allow a
register
include/asm/bitops.h:65: warning: read-write constraint does not allow a
register
include/asm/bitops.h: In function `cpu_idle':
include/asm/bitops.h:30: warning: read-write constraint does not allow a
register
include/asm/bitops.h:30: warning: read-write constraint does not allow a
register
include/asm/bitops.h: In function `set_personality_64bit':
include/asm/bitops.h:65: warning: read-write constraint does not allow a
register
include/asm/bitops.h:65: warning: read-write constraint does not allow a
register
include/asm/bitops.h: In function `copy_thread':
include/asm/bitops.h:30: warning: read-write constraint does not allow a
register
include/asm/bitops.h:30: warning: read-write constraint does not allow a
register
  CC      arch/x86_64/kernel/signal.o
include/asm/bitops.h: In function `do_notify_resume':
include/asm/bitops.h:65: warning: read-write constraint does not allow a
register
include/asm/bitops.h:65: warning: read-write constraint does not allow a
register

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: warning: read-write constraint -- 2.6.15-git8 onwards
  2006-01-18 18:25 warning: read-write constraint -- 2.6.15-git8 onwards Andy Whitcroft
@ 2006-01-19  3:03 ` Andi Kleen
  2006-01-20 10:02   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2006-01-19  3:03 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: Linux Kernel Mailing List, jbeulich, schwab

On Wednesday 18 January 2006 19:25, Andy Whitcroft wrote:
> It seems that the following commit causes a bunch of warnings out of
> most of the files in the kernel tree (see below for examples).  Backing
> this out seems to cure them?




> Compiled with:
> 
>     gcc version 3.3.4 (Debian 1:3.3.4-6sarge1)
> 
> -apw
> 
>   CC      arch/x86_64/kernel/process.o
> include/asm/bitops.h: In function `default_idle':
> include/asm/bitops.h:65: warning: read-write constraint does not allow a
> register
> include/asm/bitops.h:65: warning: read-write constraint does not allow a
> register
> include/asm/bitops.h:30: warning: read-write constraint does not allow a
> register
> include/asm/bitops.h:30: warning: read-write constraint does not allow a
> register

I only tested with gcc 4.0 and 4.1 prereleases where it worked just fine.

 __asm__ __volatile__( LOCK_PREFIX
                "btrl %1,%0"
                :"+m" (ADDR)
                :"dIr" (nr));

I tried to covert them from +m to explicit input/output
arguments ("=m" (ADDR) : "0" (ADDR)) to fix your compiler 
but with that I get the the same warning as you with 3.4 with 4.0.
Don't know how else it could be written. 

Ok one could just pass the address and do a full memory clobber, but 
that would be a overly large sledgehammer for the problem.

Jan or Andreas - do you have any suggestions how to fix this or should
we revert back to the old (technically wrong) state which was

    __asm__ __volatile__( LOCK_PREFIX
                "btrl %1,%0"
                :"=m" (ADDR)
                :"dIr" (nr));


Thanks,
-Andi



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: warning: read-write constraint -- 2.6.15-git8 onwards
  2006-01-19  3:03 ` Andi Kleen
@ 2006-01-20 10:02   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2006-01-20 10:02 UTC (permalink / raw)
  To: Andy Whitcroft, Andi Kleen; +Cc: Andreas Schwab, Linux Kernel Mailing List

Looking at the official 3.4.x, 4.0.x, and the prerelease 4.1 sources I can't see such a warning, nor am I getting it
with 3.3.3 when building on SLES9 (which makes me assume unmodified 3.3.3 doesn't have this either). I thus wonder
whether the compiler used there has an extra, ill patch (after all there's generally nothing wrong for a read-write
constraint to only allow memory on x86). Jan

>>> Andi Kleen <ak@suse.de> 19.01.06 04:03:58 >>>
On Wednesday 18 January 2006 19:25, Andy Whitcroft wrote:
> It seems that the following commit causes a bunch of warnings out of
> most of the files in the kernel tree (see below for examples).  Backing
> this out seems to cure them?




> Compiled with:
> 
>     gcc version 3.3.4 (Debian 1:3.3.4-6sarge1)
> 
> -apw
> 
>   CC      arch/x86_64/kernel/process.o
> include/asm/bitops.h: In function `default_idle':
> include/asm/bitops.h:65: warning: read-write constraint does not allow a
> register
> include/asm/bitops.h:65: warning: read-write constraint does not allow a
> register
> include/asm/bitops.h:30: warning: read-write constraint does not allow a
> register
> include/asm/bitops.h:30: warning: read-write constraint does not allow a
> register

I only tested with gcc 4.0 and 4.1 prereleases where it worked just fine.

 __asm__ __volatile__( LOCK_PREFIX
                "btrl %1,%0"
                :"+m" (ADDR)
                :"dIr" (nr));

I tried to covert them from +m to explicit input/output
arguments ("=m" (ADDR) : "0" (ADDR)) to fix your compiler 
but with that I get the the same warning as you with 3.4 with 4.0.
Don't know how else it could be written. 

Ok one could just pass the address and do a full memory clobber, but 
that would be a overly large sledgehammer for the problem.

Jan or Andreas - do you have any suggestions how to fix this or should
we revert back to the old (technically wrong) state which was

    __asm__ __volatile__( LOCK_PREFIX
                "btrl %1,%0"
                :"=m" (ADDR)
                :"dIr" (nr));


Thanks,
-Andi



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-20 10:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-18 18:25 warning: read-write constraint -- 2.6.15-git8 onwards Andy Whitcroft
2006-01-19  3:03 ` Andi Kleen
2006-01-20 10:02   ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox