linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux 2.6.32-rc1
@ 2009-09-27 22:34 Linus Torvalds
  2009-09-27 23:44 ` Stephen Rothwell
                   ` (3 more replies)
  0 siblings, 4 replies; 79+ messages in thread
From: Linus Torvalds @ 2009-09-27 22:34 UTC (permalink / raw)
  To: Linux Kernel Mailing List


It's been two weeks (and then some - but with last week being LinuxCon and 
Plumbers conf I extended it by a few days), and as usual that means that 
the merge window is all over and done with. 2.6.32-rc1 is out, so give it 
a whirl.

What can I say? 67% drivers (the bulk of which is from 'staging', but 
there's driver changes all over), 10% firmware, 10% arch updates 
(dominated by arm, but MIPS, POWER, SH and x86 updates are there too, 
along with the new 'SCore' architecture), 5% Documentation, and a random 
smattering of other things (ie the normal filesystem, kernel, networking 
etc updates).

For a change, I don't think we have a single new filesystem this time 
around, but we do have updates to existing ones (ocfs2, btrfs, nfs, nilfs, 
xfs, gfs2, ext4 - you name it).

Some of the more interesting changes (but perhaps that's just me) are some 
of the VM updates (ZERO_PAGE is back!) and the writeback work by Jens and 
others to spread out writeback by backing store. 

Go wild, test it out, and let us know about any regressions you find,

		Linus

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

* Re: Linux 2.6.32-rc1
  2009-09-27 22:34 Linux 2.6.32-rc1 Linus Torvalds
@ 2009-09-27 23:44 ` Stephen Rothwell
  2009-09-27 23:48   ` Diego Calleja
  2009-09-27 23:52   ` Linus Torvalds
  2009-09-28  7:07 ` Eric Dumazet
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 79+ messages in thread
From: Stephen Rothwell @ 2009-09-27 23:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

Hi Linus,

On Sun, 27 Sep 2009 15:34:53 -0700 (PDT) Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> It's been two weeks (and then some - but with last week being LinuxCon and 
> Plumbers conf I extended it by a few days), and as usual that means that 
> the merge window is all over and done with. 2.6.32-rc1 is out, so give it 
> a whirl.

Of course, you realise that you set EXTRAVERSION to -rc2  :-(
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: Linux 2.6.32-rc1
  2009-09-27 23:44 ` Stephen Rothwell
@ 2009-09-27 23:48   ` Diego Calleja
  2009-09-27 23:52   ` Linus Torvalds
  1 sibling, 0 replies; 79+ messages in thread
From: Diego Calleja @ 2009-09-27 23:48 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Linus Torvalds, Linux Kernel Mailing List

On Lunes 28 Septiembre 2009 01:44:58 Stephen Rothwell escribió:

> Of course, you realise that you set EXTRAVERSION to -rc2  :-(

Not a big problem i guess, except that the kernel.org files are "-rc1"

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

* Re: Linux 2.6.32-rc1
  2009-09-27 23:44 ` Stephen Rothwell
  2009-09-27 23:48   ` Diego Calleja
@ 2009-09-27 23:52   ` Linus Torvalds
  2009-09-28  0:17     ` Stephen Rothwell
  1 sibling, 1 reply; 79+ messages in thread
From: Linus Torvalds @ 2009-09-27 23:52 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Linux Kernel Mailing List



On Mon, 28 Sep 2009, Stephen Rothwell wrote:

> Hi Linus,
> 
> On Sun, 27 Sep 2009 15:34:53 -0700 (PDT) Linus Torvalds <torvalds@linux-foundation.org> wrote:
> >
> > It's been two weeks (and then some - but with last week being LinuxCon and 
> > Plumbers conf I extended it by a few days), and as usual that means that 
> > the merge window is all over and done with. 2.6.32-rc1 is out, so give it 
> > a whirl.
> 
> Of course, you realise that you set EXTRAVERSION to -rc2  :-(

Oh nnooooooooooooo-(takes breath)-ooooooo...

Damn. I hadn't realized. I'm a moron.

Ok, so it's an extra-special -rc1. It's the "short bus" kind of special 
-rc1 release. But quite frankly, I'll just let it be. The git tags etc 
look to be ok, it's just my editing of the Makefile itself that was too 
complicated for my little mind.

I'll try not to do that again,

		Linus

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

* Re: Linux 2.6.32-rc1
  2009-09-27 23:52   ` Linus Torvalds
@ 2009-09-28  0:17     ` Stephen Rothwell
  0 siblings, 0 replies; 79+ messages in thread
From: Stephen Rothwell @ 2009-09-28  0:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

On Sun, 27 Sep 2009 16:52:56 -0700 (PDT) Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> Ok, so it's an extra-special -rc1. It's the "short bus" kind of special 
> -rc1 release. But quite frankly, I'll just let it be. The git tags etc 
> look to be ok, it's just my editing of the Makefile itself that was too 
> complicated for my little mind.

I was going to apply a patch to -next to set it to -rc1, but I won't
do that either.  This way all bug reports are consistently confusing :-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: Linux 2.6.32-rc1
  2009-09-27 22:34 Linux 2.6.32-rc1 Linus Torvalds
  2009-09-27 23:44 ` Stephen Rothwell
@ 2009-09-28  7:07 ` Eric Dumazet
  2009-09-28 15:39   ` Linus Torvalds
  2009-09-28 14:34 ` Linux 2.6.32-rc1 compile error Wolfgang Erig
  2009-09-28 16:25 ` [PATCH] isdn: fix netjet/isdnhdlc build errors Randy Dunlap
  3 siblings, 1 reply; 79+ messages in thread
From: Eric Dumazet @ 2009-09-28  7:07 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

Linus Torvalds a écrit :
> 
> Go wild, test it out, and let us know about any regressions you find,
> 
>
Hi Linus

Something seems wrong with process time accounting.

Following program should consume 10*8 seconds of cpu on a 8 cpu machine, but
with 2.6.32-rc1 numbers are crazy.

$ gcc -O2 -o process process.c -lpthread
$ ./process
  PID TTY      STAT   TIME COMMAND
 5532 pts/1    -      0:08 ./process
    - -        Sl+    0:00 -
    - -        Rl+    0:05 -
    - -        Rl+    0:05 -
    - -        Rl+    0:09 -
    - -        Rl+    0:05 -
    - -        Rl+    0:05 -
    - -        Rl+    0:05 -
    - -        Rl+    0:05 -
    - -        Rl+    0:01 -
  PID TTY      STAT   TIME COMMAND
 5532 pts/1    -      0:16 ./process
    - -        Sl+    0:00 -
    - -        Rl+    0:14 -
    - -        Rl+    0:06 -
    - -        Rl+    0:14 -
    - -        Rl+    0:10 -
    - -        Rl+    0:06 -
    - -        Rl+    0:06 -
    - -        Rl+    0:10 -
    - -        Rl+    0:02 -
  PID TTY      STAT   TIME COMMAND
 5532 pts/1    -      0:24 ./process
    - -        Sl+    0:00 -
    - -        Rl+    0:20 -
    - -        Rl+    0:11 -
    - -        Rl+    0:24 -
    - -        Rl+    0:15 -
    - -        Rl+    0:07 -
    - -        Rl+    0:07 -
    - -        Rl+    0:24 -
    - -        Rl+    0:03 -
  PID TTY      STAT   TIME COMMAND
 5532 pts/1    -      0:32 ./process
    - -        Sl+    0:00 -
    - -        Rl+    0:29 -
    - -        Rl+    0:12 -
    - -        Rl+    0:29 -
    - -        Rl+    0:21 -
    - -        Rl+    0:08 -
    - -        Rl+    0:08 -
    - -        Rl+    0:29 -
    - -        Rl+    0:04 -
  PID TTY      STAT   TIME COMMAND
 5532 pts/1    -      0:40 ./process
    - -        Sl+    0:00 -
    - -        Rl+    0:35 -
    - -        Rl+    0:13 -
    - -        Rl+    0:35 -
    - -        Rl+    0:26 -
    - -        Rl+    0:09 -
    - -        Rl+    0:09 -
    - -        Rl+    0:35 -
    - -        Rl+    0:05 -
  PID TTY      STAT   TIME COMMAND
 5532 pts/1    -      0:48 ./process
    - -        Sl+    0:00 -
    - -        Rl+    0:40 -
    - -        Rl+    0:14 -
    - -        Rl+    0:40 -
    - -        Rl+    0:31 -
    - -        Rl+    0:10 -
    - -        Rl+    0:10 -
    - -        Rl+    0:40 -
    - -        Rl+    0:06 -
  PID TTY      STAT   TIME COMMAND
 5532 pts/1    -      0:56 ./process
    - -        Sl+    0:00 -
    - -        Rl+    0:45 -
    - -        Rl+    0:15 -
    - -        Rl+    0:45 -
    - -        Rl+    0:37 -
    - -        Rl+    0:11 -
    - -        Rl+    0:11 -
    - -        Rl+    0:45 -
    - -        Rl+    0:07 -
  PID TTY      STAT   TIME COMMAND
 5532 pts/1    -      1:05 ./process
    - -        Sl+    0:00 -
    - -        Rl+    0:51 -
    - -        Rl+    0:21 -
    - -        Rl+    0:55 -
    - -        Rl+    0:46 -
    - -        Rl+    0:12 -
    - -        Rl+    0:12 -
    - -        Rl+    0:59 -
    - -        Rl+    0:08 -
  PID TTY      STAT   TIME COMMAND
 5532 pts/1    -      1:13 ./process
    - -        Sl+    0:00 -
    - -        Rl+    0:56 -
    - -        Rl+    0:22 -
    - -        Rl+    1:00 -
    - -        Rl+    0:52 -
    - -        Rl+    0:13 -
    - -        Rl+    0:13 -
    - -        Rl+    1:04 -
    - -        Rl+    0:09 -
  PID TTY      STAT   TIME COMMAND
 5532 pts/1    -      5:13 ./process
    - -        S+     5:13 -


$ cat process.c
#include <pthread.h>
#include <time.h>
#include <stdio.h>

/*
 * Burn cpu cycles for about 10 seconds
 */
static void *do_unit(void *arg)
{
        time_t t0,t1;

        t0 = time(NULL);
        do {
                t1 = time(NULL);
        } while (t1 - t0 <= 10);
        return NULL;
}




int main(int argc, char *argv[])
{
        pthread_t tids[8];
        int i;
        char cmd[128];

        sprintf(cmd, "ps m -p %d", getpid());
        for (i = 0; i < 8 ; i++)
                pthread_create(&tids[i], NULL, do_unit, NULL);
        for (i = 0; i < 9; i++) {
                sleep(1);
                system(cmd);
        }
        for (i = 0; i < 8 ; i++)
                pthread_join(tids[i], NULL);
        system(cmd);
        return 0;
}

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

* Linux 2.6.32-rc1 compile error
  2009-09-27 22:34 Linux 2.6.32-rc1 Linus Torvalds
  2009-09-27 23:44 ` Stephen Rothwell
  2009-09-28  7:07 ` Eric Dumazet
@ 2009-09-28 14:34 ` Wolfgang Erig
  2009-09-28 15:10   ` Jaswinder Singh Rajput
  2009-09-28 16:25 ` [PATCH] isdn: fix netjet/isdnhdlc build errors Randy Dunlap
  3 siblings, 1 reply; 79+ messages in thread
From: Wolfgang Erig @ 2009-09-28 14:34 UTC (permalink / raw)
  To: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1140 bytes --]

------------ snip ------------
  CC      kernel/time/tick-oneshot.o
  CC      kernel/time/tick-sched.o
  LD      kernel/time/built-in.o
  CC      kernel/futex.o
  CC      kernel/rtmutex.o
  CC      kernel/dma.o
  CC      kernel/smp.o
  CC      kernel/spinlock.o
  CC      kernel/uid16.o
  CC      kernel/module.o
kernel/module.c:1995: warning: type defaults to ‘int’ in declaration of ‘Elf_Hdr’
kernel/module.c:1995: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
kernel/module.c: In function ‘load_module’:
kernel/module.c:2203: error: ‘strmap’ undeclared (first use in this function)
kernel/module.c:2203: error: (Each undeclared identifier is reported only once
kernel/module.c:2203: error: for each function it appears in.)
kernel/module.c:2239: error: ‘symoffs’ undeclared (first use in this function)
kernel/module.c:2239: error: implicit declaration of function ‘layout_symtab’
kernel/module.c:2240: error: ‘stroffs’ undeclared (first use in this function)
make[1]: *** [kernel/module.o] Fehler 1
make: *** [kernel] Fehler 2

seemed to be a strange .config, which is attached.

Wolfgang

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 10120 bytes --]

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

* Re: Linux 2.6.32-rc1 compile error
  2009-09-28 14:34 ` Linux 2.6.32-rc1 compile error Wolfgang Erig
@ 2009-09-28 15:10   ` Jaswinder Singh Rajput
  2009-09-28 15:32     ` Wolfgang Erig
  0 siblings, 1 reply; 79+ messages in thread
From: Jaswinder Singh Rajput @ 2009-09-28 15:10 UTC (permalink / raw)
  To: Wolfgang Erig, Jan Beulich, Rusty Russell; +Cc: Linux Kernel Mailing List

Hello Wolfgang,

Can you please check, following patch fix your problem. (This is
untested)

On Mon, 2009-09-28 at 16:34 +0200, Wolfgang Erig wrote:
> ------------ snip ------------
>   CC      kernel/time/tick-oneshot.o
>   CC      kernel/time/tick-sched.o
>   LD      kernel/time/built-in.o
>   CC      kernel/futex.o
>   CC      kernel/rtmutex.o
>   CC      kernel/dma.o
>   CC      kernel/smp.o
>   CC      kernel/spinlock.o
>   CC      kernel/uid16.o
>   CC      kernel/module.o
> kernel/module.c:1995: warning: type defaults to ‘int’ in declaration of ‘Elf_Hdr’
> kernel/module.c:1995: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
> kernel/module.c: In function ‘load_module’:
> kernel/module.c:2203: error: ‘strmap’ undeclared (first use in this function)
> kernel/module.c:2203: error: (Each undeclared identifier is reported only once
> kernel/module.c:2203: error: for each function it appears in.)
> kernel/module.c:2239: error: ‘symoffs’ undeclared (first use in this function)
> kernel/module.c:2239: error: implicit declaration of function ‘layout_symtab’
> kernel/module.c:2240: error: ‘stroffs’ undeclared (first use in this function)
> make[1]: *** [kernel/module.o] Fehler 1
> make: *** [kernel] Fehler 2
> 
> seemed to be a strange .config, which is attached.
> 

From: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Date: Mon, 28 Sep 2009 20:14:37 +0530
Subject: [PATCH] module: fix compilation errors

Fix following compilation errors :
  kernel/module.c:1995: warning: type defaults to ‘int’ in declaration of ‘Elf_Hdr’
  kernel/module.c:1995: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
  kernel/module.c: In function ‘load_module’:
  kernel/module.c:2203: error: ‘strmap’ undeclared (first use in this function)
  kernel/module.c:2203: error: (Each undeclared identifier is reported only once
  kernel/module.c:2203: error: for each function it appears in.)
  kernel/module.c:2239: error: ‘symoffs’ undeclared (first use in this function)
  kernel/module.c:2239: error: implicit declaration of function ‘layout_symtab’
  kernel/module.c:2240: error: ‘stroffs’ undeclared (first use in this function)
  make[1]: *** [kernel/module.o] Fehler 1
  make: *** [kernel] Fehler 2

Reported-by: Wolfgang Erig <Wolfgang.Erig@gmx.de>
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Jan Beulich <jbeulich@novell.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
---
 kernel/module.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index 5a29397..0034621 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1992,7 +1992,7 @@ static inline unsigned long layout_symtab(struct module *mod,
 					  Elf_Shdr *sechdrs,
 					  unsigned int symindex,
 					  unsigned int strindex,
-					  const Elf_Hdr *hdr,
+				   	  const Elf_Ehdr *hdr,
 					  const char *secstrings,
 					  unsigned long *pstroffs,
 					  unsigned long *strmap)
@@ -2081,9 +2081,8 @@ static noinline struct module *load_module(void __user *umod,
 	struct module *mod;
 	long err = 0;
 	void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */
-#ifdef CONFIG_KALLSYMS
 	unsigned long symoffs, stroffs, *strmap;
-#endif
+
 	mm_segment_t old_fs;
 
 	DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n",
-- 
1.6.0.6




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

* Re: Linux 2.6.32-rc1 compile error
  2009-09-28 15:10   ` Jaswinder Singh Rajput
@ 2009-09-28 15:32     ` Wolfgang Erig
  0 siblings, 0 replies; 79+ messages in thread
From: Wolfgang Erig @ 2009-09-28 15:32 UTC (permalink / raw)
  To: Jaswinder Singh Rajput
  Cc: Jan Beulich, Rusty Russell, Linux Kernel Mailing List

Hello Jaswinder,

On Mon, Sep 28, 2009 at 08:40:09PM +0530, Jaswinder Singh Rajput wrote:
> 
> Can you please check, following patch fix your problem. (This is
> untested)

compilation ist fixed, kernel is running.

Thx, Wolfgang

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

* Re: Linux 2.6.32-rc1
  2009-09-28  7:07 ` Eric Dumazet
@ 2009-09-28 15:39   ` Linus Torvalds
  2009-09-28 17:15     ` Martin Schwidefsky
  0 siblings, 1 reply; 79+ messages in thread
From: Linus Torvalds @ 2009-09-28 15:39 UTC (permalink / raw)
  To: Eric Dumazet, Thomas Gleixner, Martin Schwidefsky, John Stultz
  Cc: Linux Kernel Mailing List




On Mon, 28 Sep 2009, Eric Dumazet wrote:
> Linus Torvalds a écrit :
> > 
> > Go wild, test it out, and let us know about any regressions you find,
> 
> Something seems wrong with process time accounting.
> 
> Following program should consume 10*8 seconds of cpu on a 8 cpu machine, but
> with 2.6.32-rc1 numbers are crazy.

Ok, so the top-level process time looks sane _while_ the thing is running 
(sum of all threads), but the per-thread times look broken (as if they had 
randomly had the times of the other threads added into them - looks to me 
like they on average had half the other threads' time accounted into 
them).

And then at the end, it looks like the time of the threads (which was 
over-accounted) get re-accounted back into the main process, so the final 
time is indeed wildly inflated.

IOW, looks like we're adding thread times multiple times to other threads 
(and then finally to the parent).

I'm adding the usual suspects to the cc, and leaving your results and 
test-program quoted here for them.. Thomas, Martin, John - if you're not 
the people I should blame for this, let me know.

		Linus

---
> $ gcc -O2 -o process process.c -lpthread
> $ ./process
>   PID TTY      STAT   TIME COMMAND
>  5532 pts/1    -      0:08 ./process
>     - -        Sl+    0:00 -
>     - -        Rl+    0:05 -
>     - -        Rl+    0:05 -
>     - -        Rl+    0:09 -
>     - -        Rl+    0:05 -
>     - -        Rl+    0:05 -
>     - -        Rl+    0:05 -
>     - -        Rl+    0:05 -
>     - -        Rl+    0:01 -
>   PID TTY      STAT   TIME COMMAND
>  5532 pts/1    -      0:16 ./process
>     - -        Sl+    0:00 -
>     - -        Rl+    0:14 -
>     - -        Rl+    0:06 -
>     - -        Rl+    0:14 -
>     - -        Rl+    0:10 -
>     - -        Rl+    0:06 -
>     - -        Rl+    0:06 -
>     - -        Rl+    0:10 -
>     - -        Rl+    0:02 -
>   PID TTY      STAT   TIME COMMAND
>  5532 pts/1    -      0:24 ./process
>     - -        Sl+    0:00 -
>     - -        Rl+    0:20 -
>     - -        Rl+    0:11 -
>     - -        Rl+    0:24 -
>     - -        Rl+    0:15 -
>     - -        Rl+    0:07 -
>     - -        Rl+    0:07 -
>     - -        Rl+    0:24 -
>     - -        Rl+    0:03 -
>   PID TTY      STAT   TIME COMMAND
>  5532 pts/1    -      0:32 ./process
>     - -        Sl+    0:00 -
>     - -        Rl+    0:29 -
>     - -        Rl+    0:12 -
>     - -        Rl+    0:29 -
>     - -        Rl+    0:21 -
>     - -        Rl+    0:08 -
>     - -        Rl+    0:08 -
>     - -        Rl+    0:29 -
>     - -        Rl+    0:04 -
>   PID TTY      STAT   TIME COMMAND
>  5532 pts/1    -      0:40 ./process
>     - -        Sl+    0:00 -
>     - -        Rl+    0:35 -
>     - -        Rl+    0:13 -
>     - -        Rl+    0:35 -
>     - -        Rl+    0:26 -
>     - -        Rl+    0:09 -
>     - -        Rl+    0:09 -
>     - -        Rl+    0:35 -
>     - -        Rl+    0:05 -
>   PID TTY      STAT   TIME COMMAND
>  5532 pts/1    -      0:48 ./process
>     - -        Sl+    0:00 -
>     - -        Rl+    0:40 -
>     - -        Rl+    0:14 -
>     - -        Rl+    0:40 -
>     - -        Rl+    0:31 -
>     - -        Rl+    0:10 -
>     - -        Rl+    0:10 -
>     - -        Rl+    0:40 -
>     - -        Rl+    0:06 -
>   PID TTY      STAT   TIME COMMAND
>  5532 pts/1    -      0:56 ./process
>     - -        Sl+    0:00 -
>     - -        Rl+    0:45 -
>     - -        Rl+    0:15 -
>     - -        Rl+    0:45 -
>     - -        Rl+    0:37 -
>     - -        Rl+    0:11 -
>     - -        Rl+    0:11 -
>     - -        Rl+    0:45 -
>     - -        Rl+    0:07 -
>   PID TTY      STAT   TIME COMMAND
>  5532 pts/1    -      1:05 ./process
>     - -        Sl+    0:00 -
>     - -        Rl+    0:51 -
>     - -        Rl+    0:21 -
>     - -        Rl+    0:55 -
>     - -        Rl+    0:46 -
>     - -        Rl+    0:12 -
>     - -        Rl+    0:12 -
>     - -        Rl+    0:59 -
>     - -        Rl+    0:08 -
>   PID TTY      STAT   TIME COMMAND
>  5532 pts/1    -      1:13 ./process
>     - -        Sl+    0:00 -
>     - -        Rl+    0:56 -
>     - -        Rl+    0:22 -
>     - -        Rl+    1:00 -
>     - -        Rl+    0:52 -
>     - -        Rl+    0:13 -
>     - -        Rl+    0:13 -
>     - -        Rl+    1:04 -
>     - -        Rl+    0:09 -
>   PID TTY      STAT   TIME COMMAND
>  5532 pts/1    -      5:13 ./process
>     - -        S+     5:13 -
> 
> 
> $ cat process.c
> #include <pthread.h>
> #include <time.h>
> #include <stdio.h>
> 
> /*
>  * Burn cpu cycles for about 10 seconds
>  */
> static void *do_unit(void *arg)
> {
>         time_t t0,t1;
> 
>         t0 = time(NULL);
>         do {
>                 t1 = time(NULL);
>         } while (t1 - t0 <= 10);
>         return NULL;
> }
> 
> 
> 
> 
> int main(int argc, char *argv[])
> {
>         pthread_t tids[8];
>         int i;
>         char cmd[128];
> 
>         sprintf(cmd, "ps m -p %d", getpid());
>         for (i = 0; i < 8 ; i++)
>                 pthread_create(&tids[i], NULL, do_unit, NULL);
>         for (i = 0; i < 9; i++) {
>                 sleep(1);
>                 system(cmd);
>         }
>         for (i = 0; i < 8 ; i++)
>                 pthread_join(tids[i], NULL);
>         system(cmd);
>         return 0;
> }
> 

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

* [PATCH] isdn: fix netjet/isdnhdlc build errors
  2009-09-27 22:34 Linux 2.6.32-rc1 Linus Torvalds
                   ` (2 preceding siblings ...)
  2009-09-28 14:34 ` Linux 2.6.32-rc1 compile error Wolfgang Erig
@ 2009-09-28 16:25 ` Randy Dunlap
  2009-09-28 19:47   ` David Miller
  3 siblings, 1 reply; 79+ messages in thread
From: Randy Dunlap @ 2009-09-28 16:25 UTC (permalink / raw)
  To: Linus Torvalds, davem; +Cc: Linux Kernel Mailing List, Karsten Keil, netdev

From: Randy Dunlap <randy.dunlap@oracle.com>

Commit cb3824bade2549d7ad059d5802da43312540fdee didn't fix this problem.

Fix build errors in netjet, using isdnhdlc module:

drivers/built-in.o: In function `mode_tiger':
netjet.c:(.text+0x1ca0c7): undefined reference to `isdnhdlc_rcv_init'
netjet.c:(.text+0x1ca0d4): undefined reference to `isdnhdlc_out_init'
drivers/built-in.o: In function `fill_dma':
netjet.c:(.text+0x1ca2bd): undefined reference to `isdnhdlc_encode'
drivers/built-in.o: In function `read_dma':
netjet.c:(.text+0x1ca614): undefined reference to `isdnhdlc_decode'
drivers/built-in.o: In function `nj_irq':
netjet.c:(.text+0x1cb07a): undefined reference to `isdnhdlc_encode'

drivers/built-in.o: In function `isdnhdlc_decode':
(.text+0x1c2088): undefined reference to `crc_ccitt_table'
drivers/built-in.o: In function `isdnhdlc_encode':
(.text+0x1c2339): undefined reference to `crc_ccitt_table'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Karsten Keil <keil@b1-systems.de>
---
 drivers/isdn/hardware/mISDN/Kconfig |    1 +
 drivers/isdn/i4l/Kconfig            |    3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

--- lnx-2632-rc1.orig/drivers/isdn/hardware/mISDN/Kconfig
+++ lnx-2632-rc1/drivers/isdn/hardware/mISDN/Kconfig
@@ -78,6 +78,7 @@ config MISDN_NETJET
 	depends on PCI
 	select MISDN_IPAC
 	select ISDN_HDLC
+	select ISDN_I4L
 	help
 	  Enable support for Traverse Technologies NETJet PCI cards.
 
--- lnx-2632-rc1.orig/drivers/isdn/i4l/Kconfig
+++ lnx-2632-rc1/drivers/isdn/i4l/Kconfig
@@ -141,8 +141,7 @@ endmenu
 endif
 
 config ISDN_HDLC
-	tristate 
-	depends on HISAX_ST5481
+	tristate
 	select CRC_CCITT
 	select BITREVERSE
 

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

* Re: Linux 2.6.32-rc1
  2009-09-28 15:39   ` Linus Torvalds
@ 2009-09-28 17:15     ` Martin Schwidefsky
  2009-09-28 18:41       ` Eric Dumazet
  0 siblings, 1 reply; 79+ messages in thread
From: Martin Schwidefsky @ 2009-09-28 17:15 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Thomas Gleixner, John Stultz, Linux Kernel Mailing List

On Mon, 28 Sep 2009 08:39:31 -0700 (PDT)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Mon, 28 Sep 2009, Eric Dumazet wrote:
> > Linus Torvalds a écrit :
> > > 
> > > Go wild, test it out, and let us know about any regressions you find,
> > 
> > Something seems wrong with process time accounting.
> > 
> > Following program should consume 10*8 seconds of cpu on a 8 cpu machine, but
> > with 2.6.32-rc1 numbers are crazy.
> 
> Ok, so the top-level process time looks sane _while_ the thing is running 
> (sum of all threads), but the per-thread times look broken (as if they had 
> randomly had the times of the other threads added into them - looks to me 
> like they on average had half the other threads' time accounted into 
> them).
> 
> And then at the end, it looks like the time of the threads (which was 
> over-accounted) get re-accounted back into the main process, so the final 
> time is indeed wildly inflated.
> 
> IOW, looks like we're adding thread times multiple times to other threads 
> (and then finally to the parent).
> 
> I'm adding the usual suspects to the cc, and leaving your results and 
> test-program quoted here for them.. Thomas, Martin, John - if you're not 
> the people I should blame for this, let me know.

Uh-oh.. usual suspects, eh?

For starters I run the test program on an s390 with
VIRT_CPU_ACCOUNTING=y:

time ./burn-cpu 
  PID TTY      STAT   TIME COMMAND 
 2979 pts/0    -      0:08 ./burn-cpu
    - -        Sl+    0:00 -         
    - -        Rl+    0:01 -         
    - -        Rl+    0:01 -         
    - -        Rl+    0:01 -         
    - -        Rl+    0:01 -         
    - -        Rl+    0:01 -         
    - -        Rl+    0:01 -         
    - -        Rl+    0:01 -         
    - -        Rl+    0:01 -         
  PID TTY      STAT   TIME COMMAND   
 2979 pts/0    -      0:16 ./burn-cpu
    - -        Sl+    0:00 -         
    - -        Rl+    0:02 -         
    - -        Rl+    0:02 -         
    - -        Rl+    0:02 -         
    - -        Rl+    0:02 -         
    - -        Rl+    0:02 -         
    - -        Rl+    0:02 -         
    - -        Rl+    0:02 -         
    - -        Rl+    0:02 -         
  PID TTY      STAT   TIME COMMAND   
 2979 pts/0    -      0:25 ./burn-cpu
    - -        Sl+    0:00 -         
    - -        Rl+    0:03 -         
    - -        Rl+    0:03 -         
    - -        Rl+    0:03 -         
    - -        Rl+    0:03 -         
    - -        Rl+    0:03 -         
    - -        Rl+    0:03 -         
    - -        Rl+    0:03 -         
    - -        Rl+    0:03 -         
  PID TTY      STAT   TIME COMMAND   
 2979 pts/0    -      0:33 ./burn-cpu
    - -        Sl+    0:00 -         
    - -        Rl+    0:04 -         
    - -        Rl+    0:04 -         
    - -        Rl+    0:04 -         
    - -        Rl+    0:04 -         
    - -        Rl+    0:04 -         
    - -        Rl+    0:04 -         
    - -        Rl+    0:04 -         
    - -        Rl+    0:04 -         
  PID TTY      STAT   TIME COMMAND   
 2979 pts/0    -      0:41 ./burn-cpu
    - -        Sl+    0:00 -         
    - -        Rl+    0:05 -         
    - -        Rl+    0:05 -         
    - -        Rl+    0:05 -         
    - -        Rl+    0:05 -         
    - -        Rl+    0:05 -         
    - -        Rl+    0:05 -         
    - -        Rl+    0:05 -         
    - -        Rl+    0:05 -         
  PID TTY      STAT   TIME COMMAND   
 2979 pts/0    -      0:50 ./burn-cpu
    - -        Sl+    0:00 -
    - -        Rl+    0:06 -
    - -        Rl+    0:06 -
    - -        Rl+    0:06 -
    - -        Rl+    0:06 -
    - -        Rl+    0:06 -
    - -        Rl+    0:06 -
    - -        Rl+    0:06 -
    - -        Rl+    0:06 -
  PID TTY      STAT   TIME COMMAND
 2979 pts/0    -      0:58 ./burn-cpu
    - -        Sl+    0:00 -
    - -        Rl+    0:07 -
    - -        Rl+    0:07 -
    - -        Rl+    0:07 -
    - -        Rl+    0:07 -
    - -        Rl+    0:07 -
    - -        Rl+    0:07 -
    - -        Rl+    0:07 -
    - -        Rl+    0:07 -
  PID TTY      STAT   TIME COMMAND
 2979 pts/0    -      1:07 ./burn-cpu
    - -        Sl+    0:00 -
    - -        Rl+    0:08 -
    - -        Rl+    0:08 -
    - -        Rl+    0:08 -
    - -        Rl+    0:08 -
    - -        Rl+    0:08 -
    - -        Rl+    0:08 -
    - -        Rl+    0:08 -
    - -        Rl+    0:08 -
  PID TTY      STAT   TIME COMMAND
 2979 pts/0    -      1:15 ./burn-cpu
    - -        Sl+    0:00 -
    - -        Rl+    0:09 -
    - -        Rl+    0:09 -
    - -        Rl+    0:09 -
    - -        Rl+    0:09 -
    - -        Rl+    0:09 -
    - -        Rl+    0:09 -
    - -        Rl+    0:09 -
    - -        Rl+    0:09 -
  PID TTY      STAT   TIME COMMAND
 2979 pts/0    -      1:25 ./burn-cpu
    - -        S+     1:25 -

real    0m10.708s
user    1m25.051s
sys     0m0.174s

looks better, gives an average of 10.63 seconds per thread and the per
thread numbers are fine. I'll see what happens with the test case on my
pc@home.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


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

* Re: Linux 2.6.32-rc1
  2009-09-28 17:15     ` Martin Schwidefsky
@ 2009-09-28 18:41       ` Eric Dumazet
  2009-09-28 20:56         ` Martin Schwidefsky
  2009-09-29 20:42         ` Eric Dumazet
  0 siblings, 2 replies; 79+ messages in thread
From: Eric Dumazet @ 2009-09-28 18:41 UTC (permalink / raw)
  To: Martin Schwidefsky
  Cc: Linus Torvalds, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar,
	Arjan van de Ven

[-- Attachment #1: Type: text/plain, Size: 9045 bytes --]

Martin Schwidefsky a écrit :
> On Mon, 28 Sep 2009 08:39:31 -0700 (PDT)
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
>> On Mon, 28 Sep 2009, Eric Dumazet wrote:
>>> Linus Torvalds a écrit :
>>>> Go wild, test it out, and let us know about any regressions you find,
>>> Something seems wrong with process time accounting.
>>>
>>> Following program should consume 10*8 seconds of cpu on a 8 cpu machine, but
>>> with 2.6.32-rc1 numbers are crazy.
>> Ok, so the top-level process time looks sane _while_ the thing is running 
>> (sum of all threads), but the per-thread times look broken (as if they had 
>> randomly had the times of the other threads added into them - looks to me 
>> like they on average had half the other threads' time accounted into 
>> them).
>>
>> And then at the end, it looks like the time of the threads (which was 
>> over-accounted) get re-accounted back into the main process, so the final 
>> time is indeed wildly inflated.
>>
>> IOW, looks like we're adding thread times multiple times to other threads 
>> (and then finally to the parent).
>>
>> I'm adding the usual suspects to the cc, and leaving your results and 
>> test-program quoted here for them.. Thomas, Martin, John - if you're not 
>> the people I should blame for this, let me know.
> 
> Uh-oh.. usual suspects, eh?
> 
> For starters I run the test program on an s390 with
> VIRT_CPU_ACCOUNTING=y:
> 
> time ./burn-cpu 
>   PID TTY      STAT   TIME COMMAND 
>  2979 pts/0    -      0:08 ./burn-cpu
>     - -        Sl+    0:00 -         
>     - -        Rl+    0:01 -         
>     - -        Rl+    0:01 -         
>     - -        Rl+    0:01 -         
>     - -        Rl+    0:01 -         
>     - -        Rl+    0:01 -         
>     - -        Rl+    0:01 -         
>     - -        Rl+    0:01 -         
>     - -        Rl+    0:01 -         
>   PID TTY      STAT   TIME COMMAND   
>  2979 pts/0    -      0:16 ./burn-cpu
>     - -        Sl+    0:00 -         
>     - -        Rl+    0:02 -         
>     - -        Rl+    0:02 -         
>     - -        Rl+    0:02 -         
>     - -        Rl+    0:02 -         
>     - -        Rl+    0:02 -         
>     - -        Rl+    0:02 -         
>     - -        Rl+    0:02 -         
>     - -        Rl+    0:02 -         
>   PID TTY      STAT   TIME COMMAND   
>  2979 pts/0    -      0:25 ./burn-cpu
>     - -        Sl+    0:00 -         
>     - -        Rl+    0:03 -         
>     - -        Rl+    0:03 -         
>     - -        Rl+    0:03 -         
>     - -        Rl+    0:03 -         
>     - -        Rl+    0:03 -         
>     - -        Rl+    0:03 -         
>     - -        Rl+    0:03 -         
>     - -        Rl+    0:03 -         
>   PID TTY      STAT   TIME COMMAND   
>  2979 pts/0    -      0:33 ./burn-cpu
>     - -        Sl+    0:00 -         
>     - -        Rl+    0:04 -         
>     - -        Rl+    0:04 -         
>     - -        Rl+    0:04 -         
>     - -        Rl+    0:04 -         
>     - -        Rl+    0:04 -         
>     - -        Rl+    0:04 -         
>     - -        Rl+    0:04 -         
>     - -        Rl+    0:04 -         
>   PID TTY      STAT   TIME COMMAND   
>  2979 pts/0    -      0:41 ./burn-cpu
>     - -        Sl+    0:00 -         
>     - -        Rl+    0:05 -         
>     - -        Rl+    0:05 -         
>     - -        Rl+    0:05 -         
>     - -        Rl+    0:05 -         
>     - -        Rl+    0:05 -         
>     - -        Rl+    0:05 -         
>     - -        Rl+    0:05 -         
>     - -        Rl+    0:05 -         
>   PID TTY      STAT   TIME COMMAND   
>  2979 pts/0    -      0:50 ./burn-cpu
>     - -        Sl+    0:00 -
>     - -        Rl+    0:06 -
>     - -        Rl+    0:06 -
>     - -        Rl+    0:06 -
>     - -        Rl+    0:06 -
>     - -        Rl+    0:06 -
>     - -        Rl+    0:06 -
>     - -        Rl+    0:06 -
>     - -        Rl+    0:06 -
>   PID TTY      STAT   TIME COMMAND
>  2979 pts/0    -      0:58 ./burn-cpu
>     - -        Sl+    0:00 -
>     - -        Rl+    0:07 -
>     - -        Rl+    0:07 -
>     - -        Rl+    0:07 -
>     - -        Rl+    0:07 -
>     - -        Rl+    0:07 -
>     - -        Rl+    0:07 -
>     - -        Rl+    0:07 -
>     - -        Rl+    0:07 -
>   PID TTY      STAT   TIME COMMAND
>  2979 pts/0    -      1:07 ./burn-cpu
>     - -        Sl+    0:00 -
>     - -        Rl+    0:08 -
>     - -        Rl+    0:08 -
>     - -        Rl+    0:08 -
>     - -        Rl+    0:08 -
>     - -        Rl+    0:08 -
>     - -        Rl+    0:08 -
>     - -        Rl+    0:08 -
>     - -        Rl+    0:08 -
>   PID TTY      STAT   TIME COMMAND
>  2979 pts/0    -      1:15 ./burn-cpu
>     - -        Sl+    0:00 -
>     - -        Rl+    0:09 -
>     - -        Rl+    0:09 -
>     - -        Rl+    0:09 -
>     - -        Rl+    0:09 -
>     - -        Rl+    0:09 -
>     - -        Rl+    0:09 -
>     - -        Rl+    0:09 -
>     - -        Rl+    0:09 -
>   PID TTY      STAT   TIME COMMAND
>  2979 pts/0    -      1:25 ./burn-cpu
>     - -        S+     1:25 -
> 
> real    0m10.708s
> user    1m25.051s
> sys     0m0.174s
> 
> looks better, gives an average of 10.63 seconds per thread and the per
> thread numbers are fine. I'll see what happens with the test case on my
> pc@home.
> 


I did a bisection and found commit def0a9b2573e00ab0b486cb5382625203ab4c4a6
was the origin of the problem on my x86_32 machine.

def0a9b2573e00ab0b486cb5382625203ab4c4a6 is first bad commit
commit def0a9b2573e00ab0b486cb5382625203ab4c4a6
Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
Date:   Fri Sep 18 20:14:01 2009 +0200

    sched_clock: Make it NMI safe

    Arjan complained about the suckyness of TSC on modern machines, and
    asked if we could do something about that for PERF_SAMPLE_TIME.

    Make cpu_clock() NMI safe by removing the spinlock and using
    cmpxchg. This also makes it smaller and more robust.

    Affects architectures that use HAVE_UNSTABLE_SCHED_CLOCK, i.e. IA64
    and x86.

    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

git bisect start
# bad: [17d857be649a21ca90008c6dc425d849fa83db5c] Linux 2.6.32-rc1
git bisect bad 17d857be649a21ca90008c6dc425d849fa83db5c
# good: [74fca6a42863ffacaf7ba6f1936a9f228950f657] Linux 2.6.31
git bisect good 74fca6a42863ffacaf7ba6f1936a9f228950f657
# good: [74fca6a42863ffacaf7ba6f1936a9f228950f657] Linux 2.6.31
git bisect good 74fca6a42863ffacaf7ba6f1936a9f228950f657
# good: [5d1fe0c98f2aef99fb57aaf6dd25e793c186cea3] Staging: vt6656: Integrate vt6656 into build system.
git bisect good 5d1fe0c98f2aef99fb57aaf6dd25e793c186cea3
# good: [5d1fe0c98f2aef99fb57aaf6dd25e793c186cea3] Staging: vt6656: Integrate vt6656 into build system.
git bisect good 5d1fe0c98f2aef99fb57aaf6dd25e793c186cea3
# bad: [c720f5655df159a630fa0290a0bd67c93e92b0bf] Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
git bisect bad c720f5655df159a630fa0290a0bd67c93e92b0bf
# good: [a03fdb7612874834d6847107198712d18b5242c7] Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
git bisect good a03fdb7612874834d6847107198712d18b5242c7
# good: [3530c1886291df061e3972c55590777ef1cb67f8] Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
git bisect good 3530c1886291df061e3972c55590777ef1cb67f8
# good: [84d6ae431f315e8973aac3c3fe1d550fc9240ef3] V4L/DVB (13033): pt1: Don't use a deprecated DMA_BIT_MASK macro
git bisect good 84d6ae431f315e8973aac3c3fe1d550fc9240ef3
# bad: [ebc79c4f8da0f92efa968e0328f32334a2ce80cf] Merge git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6
git bisect bad ebc79c4f8da0f92efa968e0328f32334a2ce80cf
# good: [7bd032dc2793afcbaf4a350056768da84cdbd89b] USB serial: update the console driver
git bisect good 7bd032dc2793afcbaf4a350056768da84cdbd89b
# good: [1281a49b7aa865a1f0d60e2b28410e6234fc686b] perf trace: Sample timestamp and cpu when using record flag
git bisect good 1281a49b7aa865a1f0d60e2b28410e6234fc686b
# bad: [e11c675ede0d42a405ae595528bf0b29ce1ae56f] Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
git bisect bad e11c675ede0d42a405ae595528bf0b29ce1ae56f
# bad: [6161352142d5fed4cd753b32e5ccde66e705b14e] tracing, perf: Convert the power tracer into an event tracer
git bisect bad 6161352142d5fed4cd753b32e5ccde66e705b14e
# bad: [929bf0d0156562ce631728b6fa53d68004d456d2] Merge branch 'linus' into perfcounters/core
git bisect bad 929bf0d0156562ce631728b6fa53d68004d456d2
# good: [5622f295b53fb60dbf9bed3e2c89d182490a8b7f] x86, perf_counter, bts: Optimize BTS overflow handling
git bisect good 5622f295b53fb60dbf9bed3e2c89d182490a8b7f
# bad: [def0a9b2573e00ab0b486cb5382625203ab4c4a6] sched_clock: Make it NMI safe
git bisect bad def0a9b2573e00ab0b486cb5382625203ab4c4a6


My .config file is attached to this mail


[-- Attachment #2: .config --]
[-- Type: application/xml, Size: 58848 bytes --]

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

* Re: [PATCH] isdn: fix netjet/isdnhdlc build errors
  2009-09-28 16:25 ` [PATCH] isdn: fix netjet/isdnhdlc build errors Randy Dunlap
@ 2009-09-28 19:47   ` David Miller
  0 siblings, 0 replies; 79+ messages in thread
From: David Miller @ 2009-09-28 19:47 UTC (permalink / raw)
  To: randy.dunlap; +Cc: torvalds, linux-kernel, keil, netdev

From: Randy Dunlap <randy.dunlap@oracle.com>
Date: Mon, 28 Sep 2009 09:25:20 -0700

> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> Commit cb3824bade2549d7ad059d5802da43312540fdee didn't fix this problem.
> 
> Fix build errors in netjet, using isdnhdlc module:
...
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>

Since Karsten has been unresonspive to ISDN stuff for weeks,
I'm going to apply this directly.

Thanks!

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

* Re: Linux 2.6.32-rc1
  2009-09-28 18:41       ` Eric Dumazet
@ 2009-09-28 20:56         ` Martin Schwidefsky
  2009-09-29 20:42         ` Eric Dumazet
  1 sibling, 0 replies; 79+ messages in thread
From: Martin Schwidefsky @ 2009-09-28 20:56 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Linus Torvalds, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar,
	Arjan van de Ven

On Mon, 28 Sep 2009 20:41:41 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> I did a bisection and found commit def0a9b2573e00ab0b486cb5382625203ab4c4a6
> was the origin of the problem on my x86_32 machine.
> 
> def0a9b2573e00ab0b486cb5382625203ab4c4a6 is first bad commit
> commit def0a9b2573e00ab0b486cb5382625203ab4c4a6
> Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Date:   Fri Sep 18 20:14:01 2009 +0200
> 
>     sched_clock: Make it NMI safe
> 
>     Arjan complained about the suckyness of TSC on modern machines, and
>     asked if we could do something about that for PERF_SAMPLE_TIME.
> 
>     Make cpu_clock() NMI safe by removing the spinlock and using
>     cmpxchg. This also makes it smaller and more robust.
> 
>     Affects architectures that use HAVE_UNSTABLE_SCHED_CLOCK, i.e. IA64
>     and x86.
> 
>     Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
>     LKML-Reference: <new-submission>
>     Signed-off-by: Ingo Molnar <mingo@elte.hu>

Confirmed. The bisect run on my machine gave me the same bad commit.
The new logic in sched_clock_remove seems racy: the old code got the
locks for the sched_clock_data of the local and the remove cpu before
it changed any value. The new code tries to get to the same result with
a single cmpxchg. Bad things happen if two cpus try to update the clock
values crosswise, no?

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


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

* Re: Linux 2.6.32-rc1
  2009-09-28 18:41       ` Eric Dumazet
  2009-09-28 20:56         ` Martin Schwidefsky
@ 2009-09-29 20:42         ` Eric Dumazet
  2009-09-29 21:17           ` Linus Torvalds
  1 sibling, 1 reply; 79+ messages in thread
From: Eric Dumazet @ 2009-09-29 20:42 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar,
	Arjan van de Ven

Eric Dumazet a écrit :
> Martin Schwidefsky a écrit :
>> On Mon, 28 Sep 2009 08:39:31 -0700 (PDT)
>> Linus Torvalds <torvalds@linux-foundation.org> wrote:
>>
>>> On Mon, 28 Sep 2009, Eric Dumazet wrote:
>>>> Linus Torvalds a écrit :
>>>>> Go wild, test it out, and let us know about any regressions you find,
>>>> Something seems wrong with process time accounting.
>>>>
>>>> Following program should consume 10*8 seconds of cpu on a 8 cpu machine, but
>>>> with 2.6.32-rc1 numbers are crazy.
>>> Ok, so the top-level process time looks sane _while_ the thing is running 
>>> (sum of all threads), but the per-thread times look broken (as if they had 
>>> randomly had the times of the other threads added into them - looks to me 
>>> like they on average had half the other threads' time accounted into 
>>> them).
>>>
>>> And then at the end, it looks like the time of the threads (which was 
>>> over-accounted) get re-accounted back into the main process, so the final 
>>> time is indeed wildly inflated.
>>>
>>> IOW, looks like we're adding thread times multiple times to other threads 
>>> (and then finally to the parent).
>>>
>>> I'm adding the usual suspects to the cc, and leaving your results and 
>>> test-program quoted here for them.. Thomas, Martin, John - if you're not 
>>> the people I should blame for this, let me know.
>> Uh-oh.. usual suspects, eh?
>>
>> For starters I run the test program on an s390 with
>> VIRT_CPU_ACCOUNTING=y:
>>
>> time ./burn-cpu 
>>   PID TTY      STAT   TIME COMMAND 
>>  2979 pts/0    -      0:08 ./burn-cpu
>>     - -        Sl+    0:00 -         
>>     - -        Rl+    0:01 -         
>>     - -        Rl+    0:01 -         
>>     - -        Rl+    0:01 -         
>>     - -        Rl+    0:01 -         
>>     - -        Rl+    0:01 -         
>>     - -        Rl+    0:01 -         
>>     - -        Rl+    0:01 -         
>>     - -        Rl+    0:01 -         
>>   PID TTY      STAT   TIME COMMAND   
>>  2979 pts/0    -      0:16 ./burn-cpu
>>     - -        Sl+    0:00 -         
>>     - -        Rl+    0:02 -         
>>     - -        Rl+    0:02 -         
>>     - -        Rl+    0:02 -         
>>     - -        Rl+    0:02 -         
>>     - -        Rl+    0:02 -         
>>     - -        Rl+    0:02 -         
>>     - -        Rl+    0:02 -         
>>     - -        Rl+    0:02 -         
>>   PID TTY      STAT   TIME COMMAND   
>>  2979 pts/0    -      0:25 ./burn-cpu
>>     - -        Sl+    0:00 -         
>>     - -        Rl+    0:03 -         
>>     - -        Rl+    0:03 -         
>>     - -        Rl+    0:03 -         
>>     - -        Rl+    0:03 -         
>>     - -        Rl+    0:03 -         
>>     - -        Rl+    0:03 -         
>>     - -        Rl+    0:03 -         
>>     - -        Rl+    0:03 -         
>>   PID TTY      STAT   TIME COMMAND   
>>  2979 pts/0    -      0:33 ./burn-cpu
>>     - -        Sl+    0:00 -         
>>     - -        Rl+    0:04 -         
>>     - -        Rl+    0:04 -         
>>     - -        Rl+    0:04 -         
>>     - -        Rl+    0:04 -         
>>     - -        Rl+    0:04 -         
>>     - -        Rl+    0:04 -         
>>     - -        Rl+    0:04 -         
>>     - -        Rl+    0:04 -         
>>   PID TTY      STAT   TIME COMMAND   
>>  2979 pts/0    -      0:41 ./burn-cpu
>>     - -        Sl+    0:00 -         
>>     - -        Rl+    0:05 -         
>>     - -        Rl+    0:05 -         
>>     - -        Rl+    0:05 -         
>>     - -        Rl+    0:05 -         
>>     - -        Rl+    0:05 -         
>>     - -        Rl+    0:05 -         
>>     - -        Rl+    0:05 -         
>>     - -        Rl+    0:05 -         
>>   PID TTY      STAT   TIME COMMAND   
>>  2979 pts/0    -      0:50 ./burn-cpu
>>     - -        Sl+    0:00 -
>>     - -        Rl+    0:06 -
>>     - -        Rl+    0:06 -
>>     - -        Rl+    0:06 -
>>     - -        Rl+    0:06 -
>>     - -        Rl+    0:06 -
>>     - -        Rl+    0:06 -
>>     - -        Rl+    0:06 -
>>     - -        Rl+    0:06 -
>>   PID TTY      STAT   TIME COMMAND
>>  2979 pts/0    -      0:58 ./burn-cpu
>>     - -        Sl+    0:00 -
>>     - -        Rl+    0:07 -
>>     - -        Rl+    0:07 -
>>     - -        Rl+    0:07 -
>>     - -        Rl+    0:07 -
>>     - -        Rl+    0:07 -
>>     - -        Rl+    0:07 -
>>     - -        Rl+    0:07 -
>>     - -        Rl+    0:07 -
>>   PID TTY      STAT   TIME COMMAND
>>  2979 pts/0    -      1:07 ./burn-cpu
>>     - -        Sl+    0:00 -
>>     - -        Rl+    0:08 -
>>     - -        Rl+    0:08 -
>>     - -        Rl+    0:08 -
>>     - -        Rl+    0:08 -
>>     - -        Rl+    0:08 -
>>     - -        Rl+    0:08 -
>>     - -        Rl+    0:08 -
>>     - -        Rl+    0:08 -
>>   PID TTY      STAT   TIME COMMAND
>>  2979 pts/0    -      1:15 ./burn-cpu
>>     - -        Sl+    0:00 -
>>     - -        Rl+    0:09 -
>>     - -        Rl+    0:09 -
>>     - -        Rl+    0:09 -
>>     - -        Rl+    0:09 -
>>     - -        Rl+    0:09 -
>>     - -        Rl+    0:09 -
>>     - -        Rl+    0:09 -
>>     - -        Rl+    0:09 -
>>   PID TTY      STAT   TIME COMMAND
>>  2979 pts/0    -      1:25 ./burn-cpu
>>     - -        S+     1:25 -
>>
>> real    0m10.708s
>> user    1m25.051s
>> sys     0m0.174s
>>
>> looks better, gives an average of 10.63 seconds per thread and the per
>> thread numbers are fine. I'll see what happens with the test case on my
>> pc@home.
>>
> 
> 
> I did a bisection and found commit def0a9b2573e00ab0b486cb5382625203ab4c4a6
> was the origin of the problem on my x86_32 machine.
> 
> def0a9b2573e00ab0b486cb5382625203ab4c4a6 is first bad commit
> commit def0a9b2573e00ab0b486cb5382625203ab4c4a6
> Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Date:   Fri Sep 18 20:14:01 2009 +0200
> 
>     sched_clock: Make it NMI safe
> 
>     Arjan complained about the suckyness of TSC on modern machines, and
>     asked if we could do something about that for PERF_SAMPLE_TIME.
> 
>     Make cpu_clock() NMI safe by removing the spinlock and using
>     cmpxchg. This also makes it smaller and more robust.
> 
>     Affects architectures that use HAVE_UNSTABLE_SCHED_CLOCK, i.e. IA64
>     and x86.
> 
>     Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
>     LKML-Reference: <new-submission>
>     Signed-off-by: Ingo Molnar <mingo@elte.hu>
> 

Pretty calm lkml these days... must be some kind of event in the states ? :)

Checking this commit, I believe problem comes from cmpxchg(), which doesnt 
handle 64 bit on X86_32 (no compilation error, and  null operation :( )

We have two (or three choices) :

1) Use cmpxchg64()

2) Fix cmpxchg() to handle 64bit as well (or issue a compilation error)

3) Revert Peter patch :(

Here is the patch I used to get proper operation.

[PATCH] sched_clock: Use cmpxchg64()

Commit def0a9b2573e00ab0b486cb5382625203ab4c4a6 
(sched_clock: Make it NMI safe) assumed cmpxchg() of 64bit values was available on X86_32

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---

diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index ac2e1dc..479ce56 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -127,7 +127,7 @@ again:
 	clock = wrap_max(clock, min_clock);
 	clock = wrap_min(clock, max_clock);
 
-	if (cmpxchg(&scd->clock, old_clock, clock) != old_clock)
+	if (cmpxchg64(&scd->clock, old_clock, clock) != old_clock)
 	goto again;
 
 	return clock;
@@ -163,7 +163,7 @@ again:
 	val = remote_clock;
 	}
 
-	if (cmpxchg(ptr, old_val, val) != old_val)
+	if (cmpxchg64(ptr, old_val, val) != old_val)
 		goto again;
 
 	return val;

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

* Re: Linux 2.6.32-rc1
  2009-09-29 20:42         ` Eric Dumazet
@ 2009-09-29 21:17           ` Linus Torvalds
  2009-09-29 21:22             ` Arjan van de Ven
  2009-10-05 16:00             ` [PATCH] x86: Generate cmpxchg build failures Peter Zijlstra
  0 siblings, 2 replies; 79+ messages in thread
From: Linus Torvalds @ 2009-09-29 21:17 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar,
	Arjan van de Ven



On Tue, 29 Sep 2009, Eric Dumazet wrote:
> 
> Checking this commit, I believe problem comes from cmpxchg(), which doesnt 
> handle 64 bit on X86_32 (no compilation error, and  null operation :( )

Wow. That's broken. Very nasty silent failure.

> 1) Use cmpxchg64()

Clearly better than what we have now, although cmpxchg64 does result is 
some really disgusting code. We will use a bare CMPXCHG64 only if you 
compile for PAE right now - so even if you tell Kconfig that you want to 
compile for a modern CPU, we won't be doing that whole cmpxchg64b thing 
directly, we'll inline some really disgusting code.

So we really need to fix that up before it would be acceptable to use 
cmpxchg64(). 

And regardless, we should fix the silent cmpxchg failure, even if it's 
just a link-time failure or something. 64-bit things in the kernel used to 
be rare and special, but they aren't any more.

Ingo, Peter, comments?

		Linus

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

* Re: Linux 2.6.32-rc1
  2009-09-29 21:17           ` Linus Torvalds
@ 2009-09-29 21:22             ` Arjan van de Ven
  2009-09-29 21:56               ` Linus Torvalds
  2009-10-05 16:00             ` [PATCH] x86: Generate cmpxchg build failures Peter Zijlstra
  1 sibling, 1 reply; 79+ messages in thread
From: Arjan van de Ven @ 2009-09-29 21:22 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar

On Tue, 29 Sep 2009 14:17:58 -0700 (PDT)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Tue, 29 Sep 2009, Eric Dumazet wrote:
> > 
> > Checking this commit, I believe problem comes from cmpxchg(), which
> > doesnt handle 64 bit on X86_32 (no compilation error, and  null
> > operation :( )
> 
> Wow. That's broken. Very nasty silent failure.
> 
> > 1) Use cmpxchg64()
> 
> Clearly better than what we have now, although cmpxchg64 does result
> is some really disgusting code. We will use a bare CMPXCHG64 only if
> you compile for PAE right now - so even if you tell Kconfig that you
> want to compile for a modern CPU, we won't be doing that whole
> cmpxchg64b thing directly, we'll inline some really disgusting code.

can't we use alternatives() for this, to patch cmpxchg64 in ?
I mean.. it'll be commonly supported nowadays.. the fallback to it not
being supported could be a bit slower by now...


-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

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

* Re: Linux 2.6.32-rc1
  2009-09-29 21:22             ` Arjan van de Ven
@ 2009-09-29 21:56               ` Linus Torvalds
  2009-09-30 15:07                 ` Arjan van de Ven
  0 siblings, 1 reply; 79+ messages in thread
From: Linus Torvalds @ 2009-09-29 21:56 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Eric Dumazet, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar



On Tue, 29 Sep 2009, Arjan van de Ven wrote:
> 
> can't we use alternatives() for this, to patch cmpxchg64 in ?
> I mean.. it'll be commonly supported nowadays.. the fallback to it not
> being supported could be a bit slower by now...

Yes, we could. It would limit us to some fixed address format, probably

	cmpxchg8b (%esi)

or something. Use something like this as a starting point, perhaps?

NOTE! Totally untested! And you'd actually need to implement the 
"cmpxchg8b_emu" function that takes it's arguments in %eax:%edx, %ebx:%ecx 
and %esi and doesn't trash any other registers..

		Linus

---
 arch/x86/include/asm/cmpxchg_32.h |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index 82ceb78..d16a486 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -312,19 +312,20 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
 
 extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
 
-#define cmpxchg64(ptr, o, n)						\
-({									\
-	__typeof__(*(ptr)) __ret;					\
-	if (likely(boot_cpu_data.x86 > 4))				\
-		__ret = (__typeof__(*(ptr)))__cmpxchg64((ptr),		\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	else								\
-		__ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr),	\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	__ret;								\
-})
+#define cmpxchg64(ptr, o, n)					\
+({								\
+	__typeof__(*(ptr)) __ret;				\
+	__typeof__(*(ptr)) __old = (o);				\
+	__typeof__(*(ptr)) __new = (n);				\
+	alternative_io(LOCK_PREFIX "cmpxchg8b (%%esi)",		\
+		       "call cmpxchg8b_emu",			\
+		       X86_FEATURE_CMPXCHG8B,			\
+		       "=A" (__ret),				\
+		       "m" (*(ptr)), "0" (__old),		\
+		       "b" ((unsigned int)__new),		\
+		       "c" ((unsigned int)(__new>>32)) );	\
+	__ret; })
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	__typeof__(*(ptr)) __ret;					\

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

* Re: Linux 2.6.32-rc1
  2009-09-29 21:56               ` Linus Torvalds
@ 2009-09-30 15:07                 ` Arjan van de Ven
  2009-09-30 15:27                   ` Eric Dumazet
                                     ` (13 more replies)
  0 siblings, 14 replies; 79+ messages in thread
From: Arjan van de Ven @ 2009-09-30 15:07 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar

On Tue, 29 Sep 2009 14:56:28 -0700 (PDT)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Tue, 29 Sep 2009, Arjan van de Ven wrote:
> > 
> > can't we use alternatives() for this, to patch cmpxchg64 in ?
> > I mean.. it'll be commonly supported nowadays.. the fallback to it
> > not being supported could be a bit slower by now...
> 
> Yes, we could. It would limit us to some fixed address format,
> probably
> 
> 	cmpxchg8b (%esi)
> 
> or something. Use something like this as a starting point, perhaps?
> 
> NOTE! Totally untested! And you'd actually need to implement the 
> "cmpxchg8b_emu" function that takes it's arguments in %eax:%edx,
> %ebx:%ecx and %esi and doesn't trash any other registers..

so I debugged this guy (had a few bugs ;-)

patch, including a new cmpxchg8b_emu below:

>From 5a76986c5dd272ea16a9b8abb7349ff3d6791c2b Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Wed, 30 Sep 2009 17:04:35 +0200
Subject: [PATCH] x86: Provide an alternative() based cmpxchg64()

Based on Linus' patch, this patch provides cmpxchg64() using
the alternative() infrastructure.

Note: the fallback is NOT smp safe, just like the current fallback
is not SMP safe.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 arch/x86/include/asm/cmpxchg_32.h |   29 ++++++++++--------
 arch/x86/kernel/i386_ksyms_32.c   |    3 ++
 arch/x86/lib/Makefile             |    2 +-
 arch/x86/lib/cmpxchg8b_emu.S      |   61 +++++++++++++++++++++++++++++++++++++
 4 files changed, 81 insertions(+), 14 deletions(-)
 create mode 100644 arch/x86/lib/cmpxchg8b_emu.S

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index 82ceb78..3b21afa 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -312,19 +312,22 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
 
 extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
 
-#define cmpxchg64(ptr, o, n)						\
-({									\
-	__typeof__(*(ptr)) __ret;					\
-	if (likely(boot_cpu_data.x86 > 4))				\
-		__ret = (__typeof__(*(ptr)))__cmpxchg64((ptr),		\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	else								\
-		__ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr),	\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	__ret;								\
-})
+#define cmpxchg64(ptr, o, n)					\
+({								\
+	__typeof__(*(ptr)) __ret;				\
+	__typeof__(*(ptr)) __old = (o);				\
+	__typeof__(*(ptr)) __new = (n);				\
+	alternative_io("call cmpxchg8b_emu",			\
+			"lock; cmpxchg8b (%%esi)" ,		\
+		       X86_FEATURE_CX8,				\
+		       "=A" (__ret),				\
+		       "S" ((ptr)), "0" (__old),		\
+		       "b" ((unsigned int)__new),		\
+		       "c" ((unsigned int)(__new>>32)));	\
+	__ret; })
+
+
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	__typeof__(*(ptr)) __ret;					\
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 43cec6b..f17930e 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -10,6 +10,9 @@
 EXPORT_SYMBOL(mcount);
 #endif
 
+extern void cmpxchg8b_emu(void); /* dummy proto */
+EXPORT_SYMBOL(cmpxchg8b_emu);
+
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_generic);
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 9e60920..3e549b8 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -15,7 +15,7 @@ ifeq ($(CONFIG_X86_32),y)
         obj-y += atomic64_32.o
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += semaphore_32.o string_32.o
+        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
 
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S
new file mode 100644
index 0000000..b8af4c7
--- /dev/null
+++ b/arch/x86/lib/cmpxchg8b_emu.S
@@ -0,0 +1,61 @@
+/*
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; version 2
+ *	of the License.
+ *
+ */
+
+#include <linux/linkage.h>
+#include <asm/alternative-asm.h>
+#include <asm/frame.h>
+#include <asm/dwarf2.h>
+
+
+.text
+
+/*
+ * Inputs:
+ * %esi : memory location to compare
+ * %eax : low 32 bits of old value
+ * %edx : high 32 bits of old value
+ * %ebx : low 32 bits of new value
+ * %ecx : high 32 bits of new value
+ */
+ENTRY(cmpxchg8b_emu)
+	CFI_STARTPROC
+
+	push %edi
+	push %ebx
+	push %ecx
+	/* disable interrupts */
+	pushf
+	pop %edi
+	cli
+
+	cmpl %edx, 4(%esi)
+	jne 1f
+	cmpl %eax, (%esi)
+	jne 1f
+
+	xchg (%esi), %ebx
+	xchg 4(%esi), %ecx
+	mov %ebx, %eax
+	mov %ecx, %edx
+
+2:
+	/* restore interrupts */
+	push %edi
+	popf
+
+	pop %ecx
+	pop %ebx
+	pop %edi
+	ret
+1:
+	mov (%esi), %eax
+	mov 4(%esi), %edx
+	jmp 2b
+	CFI_ENDPROC
+ENDPROC(cmpxchg8b_emu)
+
-- 
1.6.2.5


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

* Re: Linux 2.6.32-rc1
  2009-09-30 15:07                 ` Arjan van de Ven
@ 2009-09-30 15:27                   ` Eric Dumazet
  2009-09-30 15:31                     ` Arjan van de Ven
  2009-09-30 15:57                   ` Eric Dumazet
                                     ` (12 subsequent siblings)
  13 siblings, 1 reply; 79+ messages in thread
From: Eric Dumazet @ 2009-09-30 15:27 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Linus Torvalds, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar

Arjan van de Ven a écrit :
> On Tue, 29 Sep 2009 14:56:28 -0700 (PDT)
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
>>
>> On Tue, 29 Sep 2009, Arjan van de Ven wrote:
>>> can't we use alternatives() for this, to patch cmpxchg64 in ?
>>> I mean.. it'll be commonly supported nowadays.. the fallback to it
>>> not being supported could be a bit slower by now...
>> Yes, we could. It would limit us to some fixed address format,
>> probably
>>
>> 	cmpxchg8b (%esi)
>>
>> or something. Use something like this as a starting point, perhaps?
>>
>> NOTE! Totally untested! And you'd actually need to implement the 
>> "cmpxchg8b_emu" function that takes it's arguments in %eax:%edx,
>> %ebx:%ecx and %esi and doesn't trash any other registers..
> 
> so I debugged this guy (had a few bugs ;-)
> 
> patch, including a new cmpxchg8b_emu below:
> 
> From 5a76986c5dd272ea16a9b8abb7349ff3d6791c2b Mon Sep 17 00:00:00 2001
> From: Arjan van de Ven <arjan@linux.intel.com>
> Date: Wed, 30 Sep 2009 17:04:35 +0200
> Subject: [PATCH] x86: Provide an alternative() based cmpxchg64()
> 
> Based on Linus' patch, this patch provides cmpxchg64() using
> the alternative() infrastructure.
> 
> Note: the fallback is NOT smp safe, just like the current fallback
> is not SMP safe.
> 
> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
> ---
>  arch/x86/include/asm/cmpxchg_32.h |   29 ++++++++++--------
>  arch/x86/kernel/i386_ksyms_32.c   |    3 ++
>  arch/x86/lib/Makefile             |    2 +-
>  arch/x86/lib/cmpxchg8b_emu.S      |   61 +++++++++++++++++++++++++++++++++++++
>  4 files changed, 81 insertions(+), 14 deletions(-)
>  create mode 100644 arch/x86/lib/cmpxchg8b_emu.S
> 
> diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
> index 82ceb78..3b21afa 100644
> --- a/arch/x86/include/asm/cmpxchg_32.h
> +++ b/arch/x86/include/asm/cmpxchg_32.h
> @@ -312,19 +312,22 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
>  
>  extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
>  
> -#define cmpxchg64(ptr, o, n)						\
> -({									\
> -	__typeof__(*(ptr)) __ret;					\
> -	if (likely(boot_cpu_data.x86 > 4))				\
> -		__ret = (__typeof__(*(ptr)))__cmpxchg64((ptr),		\
> -				(unsigned long long)(o),		\
> -				(unsigned long long)(n));		\
> -	else								\
> -		__ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr),	\
> -				(unsigned long long)(o),		\
> -				(unsigned long long)(n));		\
> -	__ret;								\
> -})
> +#define cmpxchg64(ptr, o, n)					\
> +({								\
> +	__typeof__(*(ptr)) __ret;				\
> +	__typeof__(*(ptr)) __old = (o);				\
> +	__typeof__(*(ptr)) __new = (n);				\
> +	alternative_io("call cmpxchg8b_emu",			\
> +			"lock; cmpxchg8b (%%esi)" ,		\
> +		       X86_FEATURE_CX8,				\
> +		       "=A" (__ret),				\
> +		       "S" ((ptr)), "0" (__old),		\
> +		       "b" ((unsigned int)__new),		\
> +		       "c" ((unsigned int)(__new>>32)));	\
> +	__ret; })
> +
> +
> +
>  #define cmpxchg64_local(ptr, o, n)					\
>  ({									\
>  	__typeof__(*(ptr)) __ret;					\
> diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
> index 43cec6b..f17930e 100644
> --- a/arch/x86/kernel/i386_ksyms_32.c
> +++ b/arch/x86/kernel/i386_ksyms_32.c
> @@ -10,6 +10,9 @@
>  EXPORT_SYMBOL(mcount);
>  #endif
>  
> +extern void cmpxchg8b_emu(void); /* dummy proto */
> +EXPORT_SYMBOL(cmpxchg8b_emu);
> +
>  /* Networking helper routines. */
>  EXPORT_SYMBOL(csum_partial_copy_generic);
>  
> diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
> index 9e60920..3e549b8 100644
> --- a/arch/x86/lib/Makefile
> +++ b/arch/x86/lib/Makefile
> @@ -15,7 +15,7 @@ ifeq ($(CONFIG_X86_32),y)
>          obj-y += atomic64_32.o
>          lib-y += checksum_32.o
>          lib-y += strstr_32.o
> -        lib-y += semaphore_32.o string_32.o
> +        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
>  
>          lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
>  else
> diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S
> new file mode 100644
> index 0000000..b8af4c7
> --- /dev/null
> +++ b/arch/x86/lib/cmpxchg8b_emu.S
> @@ -0,0 +1,61 @@
> +/*
> + *	This program is free software; you can redistribute it and/or
> + *	modify it under the terms of the GNU General Public License
> + *	as published by the Free Software Foundation; version 2
> + *	of the License.
> + *
> + */
> +
> +#include <linux/linkage.h>
> +#include <asm/alternative-asm.h>
> +#include <asm/frame.h>
> +#include <asm/dwarf2.h>
> +
> +
> +.text
> +
> +/*
> + * Inputs:
> + * %esi : memory location to compare
> + * %eax : low 32 bits of old value
> + * %edx : high 32 bits of old value
> + * %ebx : low 32 bits of new value
> + * %ecx : high 32 bits of new value
> + */
> +ENTRY(cmpxchg8b_emu)
> +	CFI_STARTPROC
> +
> +	push %edi
> +	push %ebx
> +	push %ecx
> +	/* disable interrupts */
> +	pushf

> +	pop %edi
Why do you pop flags in edi, to later re-push them ?

> +	cli
> +
> +	cmpl %edx, 4(%esi)
> +	jne 1f
> +	cmpl %eax, (%esi)
> +	jne 1f
> +

So we dont have irq fro this cpu, ok.

And other cpus allowed, and xchg implies lock prefix, ok.


> +	xchg (%esi), %ebx
> +	xchg 4(%esi), %ecx
How this sequence is guaranteed to be atomic with other cpus ?

If it is a !SMP implementation, then you could replace xchg by mov instructions.

	mov %ebx,(%esi)
	mov %ecx,4(%esi)

> +	mov %ebx, %eax
> +	mov %ecx, %edx
and avoid these of course


> +
> +2:
> +	/* restore interrupts */
> +	push %edi
> +	popf
> +
> +	pop %ecx
> +	pop %ebx
> +	pop %edi
> +	ret
> +1:
> +	mov (%esi), %eax
> +	mov 4(%esi), %edx
> +	jmp 2b
> +	CFI_ENDPROC
> +ENDPROC(cmpxchg8b_emu)
> +


So I suggest :


ENTRY(cmpxchg8b_emu)
	CFI_STARTPROC

	/* disable interrupts */
	pushf
	cli

	cmpl  %eax,(%esi)
	jne   1f
	cmpl  %edx,4(%esi)
	jne   2f

	mov   %ebx,(%esi)
	mov   %ecx,4(%esi)

	/* restore interrupts */
	popf
	ret
1:
	mov (%esi), %eax
2:
	mov 4(%esi), %edx
	popf
	ret
	CFI_ENDPROC
ENDPROC(cmpxchg8b_emu)

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

* Re: Linux 2.6.32-rc1
  2009-09-30 15:27                   ` Eric Dumazet
@ 2009-09-30 15:31                     ` Arjan van de Ven
  2009-10-01  0:42                       ` Yuhong Bao
  0 siblings, 1 reply; 79+ messages in thread
From: Arjan van de Ven @ 2009-09-30 15:31 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Linus Torvalds, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar

On Wed, 30 Sep 2009 17:27:05 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> 
> > +	pop %edi
> Why do you pop flags in edi, to later re-push them ?
> 
> > +	cli

because here I disable interrupts

(basically this is local_irq_save() )
> 
> 
> > +	xchg (%esi), %ebx
> > +	xchg 4(%esi), %ecx
> How this sequence is guaranteed to be atomic with other cpus ?

it is not. this is the 486 implementation which is !SMP
(just like the current cmpxchg64() fallback)

> 
> If it is a !SMP implementation, then you could replace xchg by mov
> instructions.

that is not equivalent. I need to also store the old values
and return them....


> 
> So I suggest :
> 
> 
> ENTRY(cmpxchg8b_emu)
> 	CFI_STARTPROC
> 
> 	/* disable interrupts */
> 	pushf
> 	cli
> 
> 	cmpl  %eax,(%esi)
> 	jne   1f
> 	cmpl  %edx,4(%esi)
> 	jne   2f
> 
> 	mov   %ebx,(%esi)
> 	mov   %ecx,4(%esi)

this is not equivalent since you don't return the "prev" value.



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

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

* Re: Linux 2.6.32-rc1
  2009-09-30 15:07                 ` Arjan van de Ven
  2009-09-30 15:27                   ` Eric Dumazet
@ 2009-09-30 15:57                   ` Eric Dumazet
  2009-09-30 16:13                     ` Arjan van de Ven
                                       ` (2 more replies)
  2009-09-30 16:55                   ` Stefan Richter
                                     ` (11 subsequent siblings)
  13 siblings, 3 replies; 79+ messages in thread
From: Eric Dumazet @ 2009-09-30 15:57 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Linus Torvalds, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar

Arjan van de Ven a écrit :
> On Tue, 29 Sep 2009 14:56:28 -0700 (PDT)
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
>>
>> On Tue, 29 Sep 2009, Arjan van de Ven wrote:
>>> can't we use alternatives() for this, to patch cmpxchg64 in ?
>>> I mean.. it'll be commonly supported nowadays.. the fallback to it
>>> not being supported could be a bit slower by now...
>> Yes, we could. It would limit us to some fixed address format,
>> probably
>>
>> 	cmpxchg8b (%esi)
>>
>> or something. Use something like this as a starting point, perhaps?
>>
>> NOTE! Totally untested! And you'd actually need to implement the 
>> "cmpxchg8b_emu" function that takes it's arguments in %eax:%edx,
>> %ebx:%ecx and %esi and doesn't trash any other registers..
> 
> so I debugged this guy (had a few bugs ;-)
> 
> patch, including a new cmpxchg8b_emu below:
> 
>>From 5a76986c5dd272ea16a9b8abb7349ff3d6791c2b Mon Sep 17 00:00:00 2001
> From: Arjan van de Ven <arjan@linux.intel.com>
> Date: Wed, 30 Sep 2009 17:04:35 +0200
> Subject: [PATCH] x86: Provide an alternative() based cmpxchg64()
> 
> Based on Linus' patch, this patch provides cmpxchg64() using
> the alternative() infrastructure.
> 
> Note: the fallback is NOT smp safe, just like the current fallback
> is not SMP safe.
> 
> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>

> +#define cmpxchg64(ptr, o, n)					\
> +({								\
> +	__typeof__(*(ptr)) __ret;				\
> +	__typeof__(*(ptr)) __old = (o);				\
> +	__typeof__(*(ptr)) __new = (n);				\
> +	alternative_io("call cmpxchg8b_emu",			\
> +			"lock; cmpxchg8b (%%esi)" ,		\
> +		       X86_FEATURE_CX8,				\
> +		       "=A" (__ret),				\
> +		       "S" ((ptr)), "0" (__old),		\
> +		       "b" ((unsigned int)__new),		\
> +		       "c" ((unsigned int)(__new>>32)));	\


Note:

lock; cmpxchg8b (%%esi)

gives 4 bytes opcode : f0 0f c7 0e
Because alternative (call cmpxchg8b_emu) uses 5 bytes, a nop will be added.

Choosing ".byte 0xf0, 0x0f, 0xc7, 0x4e, 0x00"  aka "lock cmpxchg8b 0x0(%esi)" is a litle bit better ?


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

* Re: Linux 2.6.32-rc1
  2009-09-30 15:57                   ` Eric Dumazet
@ 2009-09-30 16:13                     ` Arjan van de Ven
  2009-09-30 16:14                     ` Linus Torvalds
  2009-09-30 16:14                     ` Linux 2.6.32-rc1 Cyrill Gorcunov
  2 siblings, 0 replies; 79+ messages in thread
From: Arjan van de Ven @ 2009-09-30 16:13 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Linus Torvalds, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar

On Wed, 30 Sep 2009 17:57:25 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> 
> Note:
> 
> lock; cmpxchg8b (%%esi)
> 
> gives 4 bytes opcode : f0 0f c7 0e
> Because alternative (call cmpxchg8b_emu) uses 5 bytes, a nop will be
> added.
> 
> Choosing ".byte 0xf0, 0x0f, 0xc7, 0x4e, 0x00"  aka "lock cmpxchg8b
> 0x0(%esi)" is a litle bit better ?

doesn't matter normally.. nops fall out quickly in the execution path ;)



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

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

* Re: Linux 2.6.32-rc1
  2009-09-30 15:57                   ` Eric Dumazet
  2009-09-30 16:13                     ` Arjan van de Ven
@ 2009-09-30 16:14                     ` Linus Torvalds
  2009-09-30 18:53                       ` Ingo Molnar
  2009-09-30 16:14                     ` Linux 2.6.32-rc1 Cyrill Gorcunov
  2 siblings, 1 reply; 79+ messages in thread
From: Linus Torvalds @ 2009-09-30 16:14 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Arjan van de Ven, Martin Schwidefsky, Thomas Gleixner,
	John Stultz, Linux Kernel Mailing List, Peter Zijlstra,
	Ingo Molnar



On Wed, 30 Sep 2009, Eric Dumazet wrote:
> 
> lock; cmpxchg8b (%%esi)
> 
> gives 4 bytes opcode : f0 0f c7 0e
> Because alternative (call cmpxchg8b_emu) uses 5 bytes, a nop will be added.
> 
> Choosing ".byte 0xf0, 0x0f, 0xc7, 0x4e, 0x00"  aka "lock cmpxchg8b 0x0(%esi)" is a litle bit better ?

And if you want to be really clever, you would want to handle the non-SMP 
case too, where you have just "cmpxchgb (%%esi)" (three bytes) without the 
lock prefix.

However, at this point I think Arjan's patch is already way superior to 
what we have now (feel free to take a look at what we generate on 32-bit 
without PAE today - just have a barf-bag handy), so all I'd really want is 
a few "tested-by"s to make me feel happier about it, and a few more people 
looking at the emulation routine to all say "ok, looks sane, ACK".

And at that point we can then either make "cmpxchg()" just do the 8-byte 
case natively, or just take your patch to change sched_clock.c to now use 
the no-longer-entirely-disgusting cmpxchg64().

Ingo - I suspect both those patches should just go through you. You do 
both x86 and scheduler, so I'll happily pull the end result.

			Linus

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

* Re: Linux 2.6.32-rc1
  2009-09-30 15:57                   ` Eric Dumazet
  2009-09-30 16:13                     ` Arjan van de Ven
  2009-09-30 16:14                     ` Linus Torvalds
@ 2009-09-30 16:14                     ` Cyrill Gorcunov
  2 siblings, 0 replies; 79+ messages in thread
From: Cyrill Gorcunov @ 2009-09-30 16:14 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Arjan van de Ven, Linus Torvalds, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra, Ingo Molnar

[Eric Dumazet - Wed, Sep 30, 2009 at 05:57:25PM +0200]
...
| 
| > +#define cmpxchg64(ptr, o, n)					\
| > +({								\
| > +	__typeof__(*(ptr)) __ret;				\
| > +	__typeof__(*(ptr)) __old = (o);				\
| > +	__typeof__(*(ptr)) __new = (n);				\
| > +	alternative_io("call cmpxchg8b_emu",			\
| > +			"lock; cmpxchg8b (%%esi)" ,		\
| > +		       X86_FEATURE_CX8,				\
| > +		       "=A" (__ret),				\
| > +		       "S" ((ptr)), "0" (__old),		\
| > +		       "b" ((unsigned int)__new),		\
| > +		       "c" ((unsigned int)(__new>>32)));	\
| 
| 
| Note:
| 
| lock; cmpxchg8b (%%esi)
| 
| gives 4 bytes opcode : f0 0f c7 0e
| Because alternative (call cmpxchg8b_emu) uses 5 bytes, a nop will be added.
| 
| Choosing ".byte 0xf0, 0x0f, 0xc7, 0x4e, 0x00"  aka "lock cmpxchg8b 0x0(%esi)" is a litle bit better ?
| 

Just curious why not "nop; lock; cmpxchg8b (%esi)"? lock itself is destructive
instruction with causes write buffers to flush data back and NOP itself will
be discarded by cpu internals so I suppose this form should be better. Though
I could miss something, and OTOH it's not a big deal. But still curious :)

	-- Cyrill

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

* Re: Linux 2.6.32-rc1
  2009-09-30 15:07                 ` Arjan van de Ven
  2009-09-30 15:27                   ` Eric Dumazet
  2009-09-30 15:57                   ` Eric Dumazet
@ 2009-09-30 16:55                   ` Stefan Richter
  2009-09-30 17:08                     ` Linus Torvalds
  2009-09-30 19:32                   ` Ingo Molnar
                                     ` (10 subsequent siblings)
  13 siblings, 1 reply; 79+ messages in thread
From: Stefan Richter @ 2009-09-30 16:55 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Linus Torvalds, Eric Dumazet, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra, Ingo Molnar

Arjan van de Ven wrote:
> Subject: [PATCH] x86: Provide an alternative() based cmpxchg64()
> 
> Based on Linus' patch, this patch provides cmpxchg64() using
> the alternative() infrastructure.
> 
> Note: the fallback is NOT smp safe, just like the current fallback
> is not SMP safe.

As long as it can't be turned into an atomic access, shouldn't cmpxchg64
be hidden from the common kernel coder?  Almost everybody will assume
that it is an atomic operation and happily use it in unsafe places.
-- 
Stefan Richter
-=====-==--= =--= ====-
http://arcgraph.de/sr/

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

* Re: Linux 2.6.32-rc1
  2009-09-30 16:55                   ` Stefan Richter
@ 2009-09-30 17:08                     ` Linus Torvalds
  2009-09-30 17:40                       ` Stefan Richter
  0 siblings, 1 reply; 79+ messages in thread
From: Linus Torvalds @ 2009-09-30 17:08 UTC (permalink / raw)
  To: Stefan Richter
  Cc: Arjan van de Ven, Eric Dumazet, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra, Ingo Molnar



On Wed, 30 Sep 2009, Stefan Richter wrote:
> 
> As long as it can't be turned into an atomic access, shouldn't cmpxchg64
> be hidden from the common kernel coder?  Almost everybody will assume
> that it is an atomic operation and happily use it in unsafe places.

But it _is_ atomic. We don't support SMP on the platforms that we have to 
do it with emulation on.

There's a theoretical problem with NMI, but it's not one we can solve or 
that is really all that interesting, so might as well ignore it.

		Linus

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

* Re: Linux 2.6.32-rc1
  2009-09-30 17:08                     ` Linus Torvalds
@ 2009-09-30 17:40                       ` Stefan Richter
  0 siblings, 0 replies; 79+ messages in thread
From: Stefan Richter @ 2009-09-30 17:40 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Arjan van de Ven, Eric Dumazet, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra, Ingo Molnar

Linus Torvalds wrote:
> On Wed, 30 Sep 2009, Stefan Richter wrote:
>> As long as it can't be turned into an atomic access, shouldn't cmpxchg64
>> be hidden from the common kernel coder?  Almost everybody will assume
>> that it is an atomic operation and happily use it in unsafe places.
> 
> But it _is_ atomic. We don't support SMP on the platforms that we have to 
> do it with emulation on.
> 
> There's a theoretical problem with NMI, but it's not one we can solve or 
> that is really all that interesting, so might as well ignore it.

Ah, right, I could have taken a hint from /* disable interrupts */ in
Arjan's cmpxchg8b_emu.
-- 
Stefan Richter
-=====-==--= =--= ====-
http://arcgraph.de/sr/

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

* Re: Linux 2.6.32-rc1
  2009-09-30 16:14                     ` Linus Torvalds
@ 2009-09-30 18:53                       ` Ingo Molnar
  2009-09-30 22:03                         ` [GIT PULL] scheduler fixes Ingo Molnar
  0 siblings, 1 reply; 79+ messages in thread
From: Ingo Molnar @ 2009-09-30 18:53 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, 30 Sep 2009, Eric Dumazet wrote:
> > 
> > lock; cmpxchg8b (%%esi)
> > 
> > gives 4 bytes opcode : f0 0f c7 0e
> > Because alternative (call cmpxchg8b_emu) uses 5 bytes, a nop will be added.
> > 
> > Choosing ".byte 0xf0, 0x0f, 0xc7, 0x4e, 0x00"  aka "lock cmpxchg8b 0x0(%esi)" is a litle bit better ?
> 
> And if you want to be really clever, you would want to handle the 
> non-SMP case too, where you have just "cmpxchgb (%%esi)" (three bytes) 
> without the lock prefix.
> 
> However, at this point I think Arjan's patch is already way superior 
> to what we have now (feel free to take a look at what we generate on 
> 32-bit without PAE today - just have a barf-bag handy), so all I'd 
> really want is a few "tested-by"s to make me feel happier about it, 
> and a few more people looking at the emulation routine to all say "ok, 
> looks sane, ACK".
> 
> And at that point we can then either make "cmpxchg()" just do the 
> 8-byte case natively, or just take your patch to change sched_clock.c 
> to now use the no-longer-entirely-disgusting cmpxchg64().
> 
> Ingo - I suspect both those patches should just go through you. You do 
> both x86 and scheduler, so I'll happily pull the end result.

Yeah - working on it - just got back from a trip. It's two risky patches 
and if that place breaks everyone will be affected so i'll probably send 
the pull request tomorrow.

	Ingo

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

* Re: Linux 2.6.32-rc1
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (2 preceding siblings ...)
  2009-09-30 16:55                   ` Stefan Richter
@ 2009-09-30 19:32                   ` Ingo Molnar
  2009-09-30 19:35                     ` Ingo Molnar
  2009-09-30 20:16                     ` Eric Dumazet
  2009-09-30 19:37                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
                                     ` (9 subsequent siblings)
  13 siblings, 2 replies; 79+ messages in thread
From: Ingo Molnar @ 2009-09-30 19:32 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Linus Torvalds, Eric Dumazet, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra

[-- Attachment #1: Type: text/plain, Size: 17733 bytes --]


* Arjan van de Ven <arjan@infradead.org> wrote:

> From 5a76986c5dd272ea16a9b8abb7349ff3d6791c2b Mon Sep 17 00:00:00 2001
> From: Arjan van de Ven <arjan@linux.intel.com>
> Date: Wed, 30 Sep 2009 17:04:35 +0200
> Subject: [PATCH] x86: Provide an alternative() based cmpxchg64()
> 
> Based on Linus' patch, this patch provides cmpxchg64() using
> the alternative() infrastructure.
> 
> Note: the fallback is NOT smp safe, just like the current fallback
> is not SMP safe.
> 
> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
> ---
>  arch/x86/include/asm/cmpxchg_32.h |   29 ++++++++++--------
>  arch/x86/kernel/i386_ksyms_32.c   |    3 ++
>  arch/x86/lib/Makefile             |    2 +-
>  arch/x86/lib/cmpxchg8b_emu.S      |   61 +++++++++++++++++++++++++++++++++++++
>  4 files changed, 81 insertions(+), 14 deletions(-)
>  create mode 100644 arch/x86/lib/cmpxchg8b_emu.S

The two patches cause hangs on 32-bit, in sched_clock_cpu(). I attached 
the hang serial log plus the two patches as i applied them. 

Bug in cmpxchg8b_emu()?

	Ingo

[   45.800000] i2c-core: driver [tw9910] registered
[   45.810000] initcall tw9910_module_init+0x0/0x2e returned 0 after 9765 usecs
[   45.810000] BUG: spinlock lockup on CPU#1, swapper/1, 7be09ec0
[   45.810000] Pid: 1, comm: swapper Tainted: G        W  2.6.32-rc2-tip-00990-g6139d57-dirty #19124
[   45.810000] Call Trace:
[   45.810000]  [<79ebce42>] ? printk+0x22/0x35
[   45.810000]  [<794356c7>] _raw_spin_lock+0x103/0x13f
[   45.810000]  [<79ebf84d>] _spin_lock+0x3c/0x55
[   45.810000]  [<790673e0>] ? scheduler_tick+0x44/0x20e
[   45.810000]  [<790673e0>] scheduler_tick+0x44/0x20e
[   45.810000]  [<790793fc>] update_process_times+0x4a/0x68
[   45.810000]  [<7909354c>] tick_periodic+0x7a/0x8d
[   45.810000]  [<79093588>] tick_handle_periodic+0x29/0x91
[   45.810000]  [<7909398f>] tick_do_broadcast+0x42/0x7d
[   45.810000]  [<79093b17>] tick_do_periodic_broadcast+0x3c/0x59
[   45.810000]  [<79093fb0>] tick_handle_periodic_broadcast+0x20/0x70
[   45.810000]  [<7902fac1>] timer_interrupt+0x4d/0x85
[   45.810000]  [<790ab402>] handle_IRQ_event+0x65/0x13b
[   45.810000]  [<790ad1fc>] handle_edge_irq+0xbe/0x111
[   45.810000]  [<7902f553>] handle_irq+0x2f/0x46
[   45.810000]  [<7902ee8b>] do_IRQ+0x51/0xb8
[   45.810000]  [<7902d435>] common_interrupt+0x35/0x40
[   45.810000]  [<7906afe2>] ? vprintk+0x3a8/0x3fa
[   45.810000]  [<79090020>] ? ntp_clear+0x22/0x7d
[   45.810000]  [<79ebdf6c>] ? __mutex_unlock_slowpath+0x10e/0x12f
[   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
[   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
[   45.810000]  [<79ebce42>] printk+0x22/0x35
[   45.810000]  [<790010ed>] do_one_initcall+0xc4/0x183
[   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
[   45.810000]  [<7a562474>] do_basic_setup+0x50/0x72
[   45.810000]  [<7a562509>] kernel_init+0x73/0xc5
[   45.810000]  [<7a562496>] ? kernel_init+0x0/0xc5
[   45.810000]  [<7902d997>] kernel_thread_helper+0x7/0x10
[   45.810000] sending NMI to all CPUs:
[   45.810000] NMI backtrace for cpu 1
[   45.810000] 
[   45.810000] Pid: 1, comm: swapper Tainted: G        W  (2.6.32-rc2-tip-00990-g6139d57-dirty #19124) System Product Name
[   45.810000] EIP: 0060:[<79097b38>] EFLAGS: 00000046 CPU: 1
[   45.810000] EIP is at trace_hardirqs_off_caller+0x3f/0xbd
[   45.810000] EAX: 82f26dd9 EBX: b78c8000 ECX: 00000000 EDX: 790412fc
[   45.810000] ESI: 790412fc EDI: 00000002 EBP: b78c3d10 ESP: b78c3d04
[   45.810000]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[   45.810000] CR0: 8005003b CR2: 00000000 CR3: 02664000 CR4: 00000690
[   45.810000] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[   45.810000] DR6: ffff0ff0 DR7: 00000400
[   45.810000] Call Trace:
[   45.810000]  [<79097bcf>] trace_hardirqs_off+0x19/0x2c
[   45.810000]  [<790412fc>] default_send_IPI_mask_logical+0x8f/0xb1
[   45.810000]  [<79041084>] default_send_IPI_all+0x35/0x87
[   45.810000]  [<790416bc>] arch_trigger_all_cpu_backtrace+0x40/0x73
[   45.810000]  [<794356cc>] _raw_spin_lock+0x108/0x13f
[   45.810000]  [<79ebf84d>] _spin_lock+0x3c/0x55
[   45.810000]  [<790673e0>] ? scheduler_tick+0x44/0x20e
[   45.810000]  [<790673e0>] scheduler_tick+0x44/0x20e
[   45.810000]  [<790793fc>] update_process_times+0x4a/0x68
[   45.810000]  [<7909354c>] tick_periodic+0x7a/0x8d
[   45.810000]  [<79093588>] tick_handle_periodic+0x29/0x91
[   45.810000]  [<7909398f>] tick_do_broadcast+0x42/0x7d
[   45.810000]  [<79093b17>] tick_do_periodic_broadcast+0x3c/0x59
[   45.810000]  [<79093fb0>] tick_handle_periodic_broadcast+0x20/0x70
[   45.810000]  [<7902fac1>] timer_interrupt+0x4d/0x85
[   45.810000]  [<790ab402>] handle_IRQ_event+0x65/0x13b
[   45.810000]  [<790ad1fc>] handle_edge_irq+0xbe/0x111
[   45.810000]  [<7902f553>] handle_irq+0x2f/0x46
[   45.810000]  [<7902ee8b>] do_IRQ+0x51/0xb8
[   45.810000]  [<7902d435>] common_interrupt+0x35/0x40
[   45.810000]  [<7906afe2>] ? vprintk+0x3a8/0x3fa
[   45.810000]  [<79090020>] ? ntp_clear+0x22/0x7d
[   45.810000]  [<79ebdf6c>] ? __mutex_unlock_slowpath+0x10e/0x12f
[   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
[   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
[   45.810000]  [<79ebce42>] printk+0x22/0x35
[   45.810000]  [<790010ed>] do_one_initcall+0xc4/0x183
[   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
[   45.810000]  [<7a562474>] do_basic_setup+0x50/0x72
[   45.810000]  [<7a562509>] kernel_init+0x73/0xc5
[   45.810000]  [<7a562496>] ? kernel_init+0x0/0xc5
[   45.810000]  [<7902d997>] kernel_thread_helper+0x7/0x10
[   45.810000] Pid: 1, comm: swapper Tainted: G        W  2.6.32-rc2-tip-00990-g6139d57-dirty #19124
[   45.810000] Call Trace:
[   45.810000]  [<7902bce1>] ? show_regs+0x34/0x4b
[   45.810000]  [<7904188d>] nmi_watchdog_tick+0xa4/0x181
[   45.810000]  [<7902e941>] default_do_nmi+0x64/0x21e
[   45.810000]  [<790412fc>] ? default_send_IPI_mask_logical+0x8f/0xb1
[   45.810000]  [<7902eb5d>] do_nmi+0x62/0xad
[   45.810000]  [<79ec0080>] nmi_stack_correct+0x2f/0x34
[   45.810000]  [<790412fc>] ? default_send_IPI_mask_logical+0x8f/0xb1
[   45.810000]  [<790412fc>] ? default_send_IPI_mask_logical+0x8f/0xb1
[   45.810000]  [<79097b38>] ? trace_hardirqs_off_caller+0x3f/0xbd
[   45.810000]  [<79097bcf>] trace_hardirqs_off+0x19/0x2c
[   45.810000]  [<790412fc>] default_send_IPI_mask_logical+0x8f/0xb1
[   45.810000]  [<79041084>] default_send_IPI_all+0x35/0x87
[   45.810000]  [<790416bc>] arch_trigger_all_cpu_backtrace+0x40/0x73
[   45.810000]  [<794356cc>] _raw_spin_lock+0x108/0x13f
[   45.810000]  [<79ebf84d>] _spin_lock+0x3c/0x55
[   45.810000]  [<790673e0>] ? scheduler_tick+0x44/0x20e
[   45.810000]  [<790673e0>] scheduler_tick+0x44/0x20e
[   45.810000]  [<790793fc>] update_process_times+0x4a/0x68
[   45.810000]  [<7909354c>] tick_periodic+0x7a/0x8d
[   45.810000]  [<79093588>] tick_handle_periodic+0x29/0x91
[   45.810000]  [<7909398f>] tick_do_broadcast+0x42/0x7d
[   45.810000]  [<79093b17>] tick_do_periodic_broadcast+0x3c/0x59
[   45.810000]  [<79093fb0>] tick_handle_periodic_broadcast+0x20/0x70
[   45.810000]  [<7902fac1>] timer_interrupt+0x4d/0x85
[   45.810000]  [<790ab402>] handle_IRQ_event+0x65/0x13b
[   45.810000]  [<790ad1fc>] handle_edge_irq+0xbe/0x111
[   45.810000]  [<7902f553>] handle_irq+0x2f/0x46
[   45.810000]  [<7902ee8b>] do_IRQ+0x51/0xb8
[   45.810000]  [<7902d435>] common_interrupt+0x35/0x40
[   45.810000]  [<7906afe2>] ? vprintk+0x3a8/0x3fa
[   45.810000]  [<79090020>] ? ntp_clear+0x22/0x7d
[   45.810000]  [<79ebdf6c>] ? __mutex_unlock_slowpath+0x10e/0x12f
[   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
[   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
[   45.810000]  [<79ebce42>] printk+0x22/0x35
[   45.810000]  [<790010ed>] do_one_initcall+0xc4/0x183
[   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
[   45.810000]  [<7a562474>] do_basic_setup+0x50/0x72
[   45.810000]  [<7a562509>] kernel_init+0x73/0xc5
[   45.810000]  [<7a562496>] ? kernel_init+0x0/0xc5
[   45.810000]  [<7902d997>] kernel_thread_helper+0x7/0x10
[   45.810000] NMI backtrace for cpu 0
[   45.810000] 
[   45.810000] Pid: 0, comm: swapper Tainted: G        W  (2.6.32-rc2-tip-00990-g6139d57-dirty #19124) System Product Name
[   45.810000] EIP: 0060:[<7908c649>] EFLAGS: 00000086 CPU: 0
[   45.810000] EIP is at sched_clock_cpu+0x120/0x159
[   45.810000] EAX: aa7d20b2 EBX: aa7d20b2 ECX: 0000000a EDX: 0000000a
[   45.810000] ESI: 7be0a450 EDI: 00000001 EBP: 7a42de1c ESP: 7a42ddd8
[   45.810000]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[   45.810000] CR0: 8005003b CR2: ffcff000 CR3: 02664000 CR4: 00000690
[   45.810000] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[   45.810000] DR6: ffff0ff0 DR7: 00000400
[   45.810000] Call Trace:
[   45.810000]  [<7905f54b>] update_rq_clock+0x24/0x45
[   45.810000]  [<7905f5d3>] double_rq_lock+0x67/0x7d
[   45.810000]  [<79066bc4>] load_balance+0x116/0x355
[   45.810000]  [<79098b07>] ? trace_hardirqs_on_caller+0x106/0x159
[   45.810000]  [<79066ec6>] rebalance_domains+0xc3/0x134
[   45.810000]  [<79066f78>] run_rebalance_domains+0x41/0xc2
[   45.810000]  [<79071154>] __do_softirq+0xd2/0x1a0
[   45.810000]  [<79071260>] do_softirq+0x3e/0x68
[   45.810000]  [<79071423>] irq_exit+0x4b/0x9f
[   45.810000]  [<790409e3>] smp_apic_timer_interrupt+0x81/0xa0
[   45.810000]  [<7902d7f6>] apic_timer_interrupt+0x36/0x40
[   45.810000]  [<7903377c>] ? test_ti_thread_flag+0x1/0x30
[   45.810000]  [<79033878>] ? need_resched+0x27/0x42
[   45.810000]  [<790338c2>] poll_idle+0x2f/0x76
[   45.810000]  [<7902bd98>] cpu_idle+0xa0/0xd4
[   45.810000]  [<79e2b392>] rest_init+0x7a/0x8d
[   45.810000]  [<7a562ab2>] start_kernel+0x33a/0x350
[   45.810000]  [<7a56209f>] i386_start_kernel+0x9f/0xb5
[   45.810000] Pid: 0, comm: swapper Tainted: G        W  2.6.32-rc2-tip-00990-g6139d57-dirty #19124
[   45.810000] Call Trace:
[   45.810000]  [<7902bce1>] ? show_regs+0x34/0x4b
[   45.810000]  [<7904188d>] nmi_watchdog_tick+0xa4/0x181
[   45.810000]  [<7902e941>] default_do_nmi+0x64/0x21e
[   45.810000]  [<7902eb5d>] do_nmi+0x62/0xad
[   45.810000]  [<79ec0080>] nmi_stack_correct+0x2f/0x34
[   45.810000]  [<7908c649>] ? sched_clock_cpu+0x120/0x159
[   45.810000]  [<7905f54b>] update_rq_clock+0x24/0x45
[   45.810000]  [<7905f5d3>] double_rq_lock+0x67/0x7d
[   45.810000]  [<79066bc4>] load_balance+0x116/0x355
[   45.810000]  [<79098b07>] ? trace_hardirqs_on_caller+0x106/0x159
[   45.810000]  [<79066ec6>] rebalance_domains+0xc3/0x134
[   45.810000]  [<79066f78>] run_rebalance_domains+0x41/0xc2
[   45.810000]  [<79071154>] __do_softirq+0xd2/0x1a0
[   45.810000]  [<79071260>] do_softirq+0x3e/0x68
[   45.810000]  [<79071423>] irq_exit+0x4b/0x9f
[   45.810000]  [<790409e3>] smp_apic_timer_interrupt+0x81/0xa0
[   45.810000]  [<7902d7f6>] apic_timer_interrupt+0x36/0x40
[   45.810000]  [<7903377c>] ? test_ti_thread_flag+0x1/0x30
[   45.810000]  [<79033878>] ? need_resched+0x27/0x42
[   45.810000]  [<790338c2>] poll_idle+0x2f/0x76
[   45.810000]  [<7902bd98>] cpu_idle+0xa0/0xd4
[   45.810000]  [<79e2b392>] rest_init+0x7a/0x8d
[   45.810000]  [<7a562ab2>] start_kernel+0x33a/0x350
[   45.810000]  [<7a56209f>] i386_start_kernel+0x9f/0xb5

commit 1cb9955464ad248c79c48e9c8be6669020fe178c
Author: Arjan van de Ven <arjan@infradead.org>
Date:   Wed Sep 30 20:36:19 2009 +0200

    sched_clock: Fix atomicity/continuity bug by using cmpxchg64()
    
    Commit def0a9b2573 (sched_clock: Make it NMI safe) assumed
    cmpxchg() of 64bit values was available on X86_32.
    
    That is not so - and causes some subtle scheduler misbehavior due
    to incorrect timestamps off to up by ~4 seconds.
    
    Two symptoms are known right now:
    
     - interactivity problems seen by Arjan: up to 600 msecs
       latencies instead of the expected 20-40 msecs. These
       latencies are very visible on the desktop.
    
     - incorrect CPU stats: occasionally too high percentages in 'top',
       and crazy CPU usage stats.
    
    Reported-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: John Stultz <johnstul@us.ibm.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    LKML-Reference: <20090930170754.0886ff2e@infradead.org>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index ac2e1dc..479ce56 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -127,7 +127,7 @@ again:
 	clock = wrap_max(clock, min_clock);
 	clock = wrap_min(clock, max_clock);
 
-	if (cmpxchg(&scd->clock, old_clock, clock) != old_clock)
+	if (cmpxchg64(&scd->clock, old_clock, clock) != old_clock)
 		goto again;
 
 	return clock;
@@ -163,7 +163,7 @@ again:
 		val = remote_clock;
 	}
 
-	if (cmpxchg(ptr, old_val, val) != old_val)
+	if (cmpxchg64(ptr, old_val, val) != old_val)
 		goto again;
 
 	return val;

commit 8da752098d4e584fbcc149046e5c716f5d356db4
Author: Arjan van de Ven <arjan@infradead.org>
Date:   Wed Sep 30 17:07:54 2009 +0200

    x86: Provide an alternative() based cmpxchg64()
    
    cmpxchg64() today generates, to quote Linus, "barf bag" code.
    
    cmpxchg64() is about to get used in the scheduler to a bug there,
    but it's a prerequisite that cmpxchg64() first be made non-sucking.
    
    This patch turns cmpxchg64() into an efficient implementation that
    uses the alternative() mechanism to just use the raw instruction on
    all modern systens
    
    Note: the fallback is NOT smp safe, just like the current fallback
    is not SMP safe. (Interested parties with i486 based SMP systems
    are welcome to submit fix patches for that.)
    
    Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Eric Dumazet <eric.dumazet@gmail.com>
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Cc: John Stultz <johnstul@us.ibm.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    LKML-Reference: <20090930170754.0886ff2e@infradead.org>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index 82ceb78..3b21afa 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -312,19 +312,22 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
 
 extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
 
-#define cmpxchg64(ptr, o, n)						\
-({									\
-	__typeof__(*(ptr)) __ret;					\
-	if (likely(boot_cpu_data.x86 > 4))				\
-		__ret = (__typeof__(*(ptr)))__cmpxchg64((ptr),		\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	else								\
-		__ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr),	\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	__ret;								\
-})
+#define cmpxchg64(ptr, o, n)					\
+({								\
+	__typeof__(*(ptr)) __ret;				\
+	__typeof__(*(ptr)) __old = (o);				\
+	__typeof__(*(ptr)) __new = (n);				\
+	alternative_io("call cmpxchg8b_emu",			\
+			"lock; cmpxchg8b (%%esi)" ,		\
+		       X86_FEATURE_CX8,				\
+		       "=A" (__ret),				\
+		       "S" ((ptr)), "0" (__old),		\
+		       "b" ((unsigned int)__new),		\
+		       "c" ((unsigned int)(__new>>32)));	\
+	__ret; })
+
+
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	__typeof__(*(ptr)) __ret;					\
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 43cec6b..1736c5a 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -10,6 +10,14 @@
 EXPORT_SYMBOL(mcount);
 #endif
 
+/*
+ * Note, this is a prototype to get at the symbol for
+ * the export, but dont use it from C code, it is used
+ * by assembly code and is not using C calling convention!
+ */
+extern void cmpxchg8b_emu(void);
+EXPORT_SYMBOL(cmpxchg8b_emu);
+
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_generic);
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 9e60920..3e549b8 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -15,7 +15,7 @@ ifeq ($(CONFIG_X86_32),y)
         obj-y += atomic64_32.o
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += semaphore_32.o string_32.o
+        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
 
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S
new file mode 100644
index 0000000..b8af4c7
--- /dev/null
+++ b/arch/x86/lib/cmpxchg8b_emu.S
@@ -0,0 +1,61 @@
+/*
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; version 2
+ *	of the License.
+ *
+ */
+
+#include <linux/linkage.h>
+#include <asm/alternative-asm.h>
+#include <asm/frame.h>
+#include <asm/dwarf2.h>
+
+
+.text
+
+/*
+ * Inputs:
+ * %esi : memory location to compare
+ * %eax : low 32 bits of old value
+ * %edx : high 32 bits of old value
+ * %ebx : low 32 bits of new value
+ * %ecx : high 32 bits of new value
+ */
+ENTRY(cmpxchg8b_emu)
+	CFI_STARTPROC
+
+	push %edi
+	push %ebx
+	push %ecx
+	/* disable interrupts */
+	pushf
+	pop %edi
+	cli
+
+	cmpl %edx, 4(%esi)
+	jne 1f
+	cmpl %eax, (%esi)
+	jne 1f
+
+	xchg (%esi), %ebx
+	xchg 4(%esi), %ecx
+	mov %ebx, %eax
+	mov %ecx, %edx
+
+2:
+	/* restore interrupts */
+	push %edi
+	popf
+
+	pop %ecx
+	pop %ebx
+	pop %edi
+	ret
+1:
+	mov (%esi), %eax
+	mov 4(%esi), %edx
+	jmp 2b
+	CFI_ENDPROC
+ENDPROC(cmpxchg8b_emu)
+

[-- Attachment #2: config --]
[-- Type: text/plain, Size: 78129 bytes --]

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.32-rc2
# Wed Sep 30 21:27:55 2009
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_64 is not set
CONFIG_X86=y
CONFIG_OUTPUT_FORMAT="elf32-i386"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_FAST_CMPXCHG_LOCAL=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_GPIO=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
# CONFIG_GENERIC_TIME_VSYSCALL is not set
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
# CONFIG_ZONE_DMA32 is not set
CONFIG_ARCH_POPULATES_NODE_MAP=y
# CONFIG_AUDIT_ARCH is not set
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_USE_GENERIC_SMP_HELPERS=y
CONFIG_X86_32_SMP=y
CONFIG_X86_HT=y
CONFIG_X86_TRAMPOLINE=y
CONFIG_KTIME_SCALAR=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_CONSTRUCTORS=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
# CONFIG_KERNEL_GZIP is not set
CONFIG_KERNEL_BZIP2=y
# CONFIG_KERNEL_LZMA is not set
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_TASKSTATS=y
# CONFIG_TASK_DELAY_ACCT is not set
# CONFIG_TASK_XACCT is not set
# CONFIG_AUDIT is not set

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_TREE_PREEMPT_RCU is not set
# CONFIG_TINY_RCU is not set
CONFIG_RCU_TRACE=y
CONFIG_RCU_FANOUT=32
CONFIG_RCU_FANOUT_EXACT=y
CONFIG_TREE_RCU_TRACE=y
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=20
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_USER_SCHED=y
# CONFIG_CGROUP_SCHED is not set
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
# CONFIG_CPUSETS is not set
# CONFIG_CGROUP_CPUACCT is not set
# CONFIG_RESOURCE_COUNTERS is not set
# CONFIG_SYSFS_DEPRECATED_V2 is not set
CONFIG_RELAY=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
# CONFIG_USER_NS is not set
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
# CONFIG_RD_LZMA is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_EMBEDDED=y
CONFIG_UID16=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_EXTRA_PASS=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
# CONFIG_SIGNALFD is not set
# CONFIG_TIMERFD is not set
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
# CONFIG_AIO is not set
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
CONFIG_EVENT_PROFILE=y
CONFIG_PERF_COUNTERS=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PCI_QUIRKS=y
CONFIG_SLUB_DEBUG=y
CONFIG_COMPAT_BRK=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
CONFIG_TRACEPOINTS=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y

#
# GCOV-based kernel profiling
#
CONFIG_SLOW_WORK=y
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
# CONFIG_MODULES is not set
CONFIG_STOP_MACHINE=y
CONFIG_BLOCK=y
CONFIG_LBDAF=y
CONFIG_BLK_DEV_BSG=y
# CONFIG_BLK_DEV_INTEGRITY is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_AS is not set
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"
CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_FREEZER=y

#
# Processor type and features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_SMP=y
CONFIG_SPARSE_IRQ=y
CONFIG_X86_MPPARSE=y
# CONFIG_X86_BIGSMP is not set
# CONFIG_X86_EXTENDED_PLATFORM is not set
# CONFIG_SCHED_OMIT_FRAME_POINTER is not set
# CONFIG_PARAVIRT_GUEST is not set
# CONFIG_MEMTEST is not set
# CONFIG_M386 is not set
# CONFIG_M486 is not set
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUMM is not set
# CONFIG_MPENTIUM4 is not set
CONFIG_MK6=y
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MEFFICEON is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MGEODEGX1 is not set
# CONFIG_MGEODE_LX is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set
# CONFIG_MVIAC7 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
# CONFIG_GENERIC_CPU is not set
# CONFIG_X86_GENERIC is not set
CONFIG_X86_CPU=y
CONFIG_X86_L1_CACHE_BYTES=64
CONFIG_X86_INTERNODE_CACHE_BYTES=64
CONFIG_X86_CMPXCHG=y
CONFIG_X86_L1_CACHE_SHIFT=5
CONFIG_X86_XADD=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INVLPG=y
CONFIG_X86_BSWAP=y
CONFIG_X86_POPAD_OK=y
CONFIG_X86_ALIGNMENT_16=y
CONFIG_X86_USE_PPRO_CHECKSUM=y
CONFIG_X86_TSC=y
CONFIG_X86_MINIMUM_CPU_FAMILY=4
CONFIG_PROCESSOR_SELECT=y
CONFIG_CPU_SUP_INTEL=y
# CONFIG_CPU_SUP_CYRIX_32 is not set
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_CPU_SUP_TRANSMETA_32=y
# CONFIG_CPU_SUP_UMC_32 is not set
# CONFIG_HPET_TIMER is not set
CONFIG_DMI=y
# CONFIG_IOMMU_HELPER is not set
# CONFIG_IOMMU_API is not set
CONFIG_NR_CPUS=8
# CONFIG_SCHED_SMT is not set
# CONFIG_SCHED_MC is not set
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
# CONFIG_X86_MCE is not set
CONFIG_VM86=y
# CONFIG_TOSHIBA is not set
# CONFIG_I8K is not set
CONFIG_X86_REBOOTFIXUPS=y
CONFIG_MICROCODE=y
CONFIG_MICROCODE_INTEL=y
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_X86_MSR=y
CONFIG_X86_CPUID=y
# CONFIG_X86_CPU_DEBUG is not set
# CONFIG_NOHIGHMEM is not set
CONFIG_HIGHMEM4G=y
# CONFIG_HIGHMEM64G is not set
# CONFIG_VMSPLIT_3G is not set
# CONFIG_VMSPLIT_3G_OPT is not set
# CONFIG_VMSPLIT_2G is not set
CONFIG_VMSPLIT_2G_OPT=y
# CONFIG_VMSPLIT_1G is not set
CONFIG_PAGE_OFFSET=0x78000000
CONFIG_HIGHMEM=y
# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ILLEGAL_POINTER_VALUE=0
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
# CONFIG_DISCONTIGMEM_MANUAL is not set
# CONFIG_SPARSEMEM_MANUAL is not set
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_SPARSEMEM_STATIC=y
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_PHYS_ADDR_T_64BIT is not set
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_HAVE_MLOCK=y
CONFIG_HAVE_MLOCKED_PAGE_BIT=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_HIGHPTE=y
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_X86_RESERVE_LOW_64K=y
# CONFIG_MATH_EMULATION is not set
# CONFIG_MTRR is not set
# CONFIG_SECCOMP is not set
CONFIG_CC_STACKPROTECTOR_ALL=y
CONFIG_CC_STACKPROTECTOR=y
CONFIG_HZ_100=y
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=100
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
CONFIG_CRASH_DUMP=y
CONFIG_PHYSICAL_START=0x1000000
# CONFIG_RELOCATABLE is not set
CONFIG_PHYSICAL_ALIGN=0x1000000
CONFIG_HOTPLUG_CPU=y
# CONFIG_COMPAT_VDSO is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE=""
# CONFIG_CMDLINE_OVERRIDE is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

#
# Power management and ACPI options
#
CONFIG_PM=y
CONFIG_PM_DEBUG=y
CONFIG_PM_VERBOSE=y
CONFIG_CAN_PM_TRACE=y
CONFIG_PM_TRACE=y
CONFIG_PM_TRACE_RTC=y
CONFIG_PM_SLEEP_SMP=y
CONFIG_PM_SLEEP=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_PM_RUNTIME=y
# CONFIG_ACPI is not set
# CONFIG_SFI is not set
# CONFIG_APM is not set

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
# CONFIG_CPU_FREQ_DEBUG is not set
# CONFIG_CPU_FREQ_STAT is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

#
# CPUFreq processor drivers
#
CONFIG_X86_POWERNOW_K6=y
CONFIG_X86_POWERNOW_K7=y
CONFIG_X86_GX_SUSPMOD=y
CONFIG_X86_SPEEDSTEP_CENTRINO=y
CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y
CONFIG_X86_SPEEDSTEP_ICH=y
CONFIG_X86_SPEEDSTEP_SMI=y
# CONFIG_X86_P4_CLOCKMOD is not set
# CONFIG_X86_CPUFREQ_NFORCE2 is not set
CONFIG_X86_LONGRUN=y
CONFIG_X86_E_POWERSAVER=y

#
# shared options
#
CONFIG_X86_SPEEDSTEP_LIB=y
CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK=y
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y

#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
# CONFIG_PCI_GOBIOS is not set
CONFIG_PCI_GOMMCONFIG=y
# CONFIG_PCI_GODIRECT is not set
# CONFIG_PCI_GOOLPC is not set
# CONFIG_PCI_GOANY is not set
CONFIG_PCI_DOMAINS=y
# CONFIG_PCIEPORTBUS is not set
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
CONFIG_PCI_LEGACY=y
CONFIG_PCI_DEBUG=y
CONFIG_PCI_STUB=y
# CONFIG_HT_IRQ is not set
# CONFIG_PCI_IOV is not set
CONFIG_ISA_DMA_API=y
CONFIG_ISA=y
CONFIG_EISA=y
CONFIG_EISA_VLB_PRIMING=y
# CONFIG_EISA_PCI_EISA is not set
CONFIG_EISA_VIRTUAL_ROOT=y
# CONFIG_EISA_NAMES is not set
CONFIG_MCA=y
# CONFIG_MCA_LEGACY is not set
# CONFIG_SCx200 is not set
CONFIG_OLPC=y
# CONFIG_PCCARD is not set
# CONFIG_HOTPLUG_PCI is not set

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_HAVE_AOUT=y
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_MISC=y
CONFIG_HAVE_ATOMIC_IOMAP=y
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
CONFIG_UNIX=y
CONFIG_XFRM=y
# CONFIG_XFRM_USER is not set
# CONFIG_XFRM_SUB_POLICY is not set
CONFIG_XFRM_MIGRATE=y
CONFIG_XFRM_STATISTICS=y
CONFIG_XFRM_IPCOMP=y
CONFIG_NET_KEY=y
CONFIG_NET_KEY_MIGRATE=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_FIB_HASH=y
CONFIG_IP_PNP=y
# CONFIG_IP_PNP_DHCP is not set
CONFIG_IP_PNP_BOOTP=y
# CONFIG_IP_PNP_RARP is not set
CONFIG_NET_IPIP=y
# CONFIG_NET_IPGRE is not set
CONFIG_IP_MROUTE=y
CONFIG_IP_PIMSM_V1=y
# CONFIG_IP_PIMSM_V2 is not set
CONFIG_ARPD=y
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
CONFIG_INET_ESP=y
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
CONFIG_INET_TUNNEL=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
CONFIG_INET_XFRM_MODE_TUNNEL=y
# CONFIG_INET_XFRM_MODE_BEET is not set
CONFIG_INET_LRO=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
CONFIG_TCP_CONG_ADVANCED=y
# CONFIG_TCP_CONG_BIC is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_TCP_CONG_WESTWOOD=y
CONFIG_TCP_CONG_HTCP=y
# CONFIG_TCP_CONG_HSTCP is not set
# CONFIG_TCP_CONG_HYBLA is not set
CONFIG_TCP_CONG_VEGAS=y
CONFIG_TCP_CONG_SCALABLE=y
CONFIG_TCP_CONG_LP=y
CONFIG_TCP_CONG_VENO=y
CONFIG_TCP_CONG_YEAH=y
CONFIG_TCP_CONG_ILLINOIS=y
# CONFIG_DEFAULT_BIC is not set
# CONFIG_DEFAULT_CUBIC is not set
CONFIG_DEFAULT_HTCP=y
# CONFIG_DEFAULT_VEGAS is not set
# CONFIG_DEFAULT_WESTWOOD is not set
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="htcp"
# CONFIG_TCP_MD5SIG is not set
CONFIG_IPV6=y
# CONFIG_IPV6_PRIVACY is not set
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
# CONFIG_IPV6_OPTIMISTIC_DAD is not set
CONFIG_INET6_AH=y
# CONFIG_INET6_ESP is not set
CONFIG_INET6_IPCOMP=y
CONFIG_IPV6_MIP6=y
CONFIG_INET6_XFRM_TUNNEL=y
CONFIG_INET6_TUNNEL=y
CONFIG_INET6_XFRM_MODE_TRANSPORT=y
CONFIG_INET6_XFRM_MODE_TUNNEL=y
CONFIG_INET6_XFRM_MODE_BEET=y
CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=y
CONFIG_IPV6_SIT=y
CONFIG_IPV6_NDISC_NODETYPE=y
# CONFIG_IPV6_TUNNEL is not set
# CONFIG_IPV6_MULTIPLE_TABLES is not set
CONFIG_IPV6_MROUTE=y
# CONFIG_IPV6_PIMSM_V2 is not set
# CONFIG_NETLABEL is not set
CONFIG_NETWORK_SECMARK=y
CONFIG_NETFILTER=y
CONFIG_NETFILTER_DEBUG=y
CONFIG_NETFILTER_ADVANCED=y

#
# Core Netfilter Configuration
#
CONFIG_NETFILTER_NETLINK=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_CT_ACCT=y
CONFIG_NF_CONNTRACK_MARK=y
# CONFIG_NF_CONNTRACK_SECMARK is not set
CONFIG_NF_CONNTRACK_EVENTS=y
# CONFIG_NF_CT_PROTO_DCCP is not set
# CONFIG_NF_CT_PROTO_SCTP is not set
CONFIG_NF_CT_PROTO_UDPLITE=y
# CONFIG_NF_CONNTRACK_AMANDA is not set
CONFIG_NF_CONNTRACK_FTP=y
# CONFIG_NF_CONNTRACK_H323 is not set
CONFIG_NF_CONNTRACK_IRC=y
CONFIG_NF_CONNTRACK_NETBIOS_NS=y
# CONFIG_NF_CONNTRACK_PPTP is not set
CONFIG_NF_CONNTRACK_SANE=y
CONFIG_NF_CONNTRACK_SIP=y
CONFIG_NF_CONNTRACK_TFTP=y
CONFIG_NF_CT_NETLINK=y
CONFIG_NETFILTER_XTABLES=y
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
CONFIG_NETFILTER_XT_TARGET_HL=y
CONFIG_NETFILTER_XT_TARGET_MARK=y
CONFIG_NETFILTER_XT_TARGET_NFLOG=y
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
# CONFIG_NETFILTER_XT_TARGET_SECMARK is not set
CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
CONFIG_NETFILTER_XT_MATCH_CLUSTER=y
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
CONFIG_NETFILTER_XT_MATCH_DSCP=y
CONFIG_NETFILTER_XT_MATCH_ESP=y
# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
CONFIG_NETFILTER_XT_MATCH_HELPER=y
# CONFIG_NETFILTER_XT_MATCH_HL is not set
CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
CONFIG_NETFILTER_XT_MATCH_LIMIT=y
CONFIG_NETFILTER_XT_MATCH_MAC=y
# CONFIG_NETFILTER_XT_MATCH_MARK is not set
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
CONFIG_NETFILTER_XT_MATCH_QUOTA=y
# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
CONFIG_NETFILTER_XT_MATCH_REALM=y
# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
CONFIG_NETFILTER_XT_MATCH_STATE=y
CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
CONFIG_NETFILTER_XT_MATCH_STRING=y
CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
# CONFIG_NETFILTER_XT_MATCH_TIME is not set
CONFIG_NETFILTER_XT_MATCH_U32=y
CONFIG_NETFILTER_XT_MATCH_OSF=y
CONFIG_IP_VS=y
CONFIG_IP_VS_IPV6=y
CONFIG_IP_VS_DEBUG=y
CONFIG_IP_VS_TAB_BITS=12

#
# IPVS transport protocol load balancing support
#
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_AH_ESP=y
# CONFIG_IP_VS_PROTO_ESP is not set
CONFIG_IP_VS_PROTO_AH=y

#
# IPVS scheduler
#
CONFIG_IP_VS_RR=y
CONFIG_IP_VS_WRR=y
# CONFIG_IP_VS_LC is not set
CONFIG_IP_VS_WLC=y
CONFIG_IP_VS_LBLC=y
# CONFIG_IP_VS_LBLCR is not set
CONFIG_IP_VS_DH=y
# CONFIG_IP_VS_SH is not set
# CONFIG_IP_VS_SED is not set
CONFIG_IP_VS_NQ=y

#
# IPVS application helper
#
CONFIG_IP_VS_FTP=y

#
# IP: Netfilter Configuration
#
# CONFIG_NF_DEFRAG_IPV4 is not set
# CONFIG_NF_CONNTRACK_IPV4 is not set
CONFIG_IP_NF_QUEUE=y
# CONFIG_IP_NF_IPTABLES is not set
# CONFIG_IP_NF_ARPTABLES is not set

#
# IPv6: Netfilter Configuration
#
CONFIG_NF_CONNTRACK_IPV6=y
CONFIG_IP6_NF_QUEUE=y
CONFIG_IP6_NF_IPTABLES=y
CONFIG_IP6_NF_MATCH_AH=y
CONFIG_IP6_NF_MATCH_EUI64=y
CONFIG_IP6_NF_MATCH_FRAG=y
# CONFIG_IP6_NF_MATCH_OPTS is not set
# CONFIG_IP6_NF_MATCH_HL is not set
CONFIG_IP6_NF_MATCH_IPV6HEADER=y
# CONFIG_IP6_NF_MATCH_MH is not set
CONFIG_IP6_NF_MATCH_RT=y
# CONFIG_IP6_NF_TARGET_HL is not set
CONFIG_IP6_NF_TARGET_LOG=y
CONFIG_IP6_NF_FILTER=y
# CONFIG_IP6_NF_TARGET_REJECT is not set
CONFIG_IP6_NF_MANGLE=y
CONFIG_IP6_NF_RAW=y
CONFIG_IP6_NF_SECURITY=y

#
# DECnet: Netfilter Configuration
#
CONFIG_DECNET_NF_GRABULATOR=y
CONFIG_IP_DCCP=y
CONFIG_INET_DCCP_DIAG=y

#
# DCCP CCIDs Configuration (EXPERIMENTAL)
#
# CONFIG_IP_DCCP_CCID2_DEBUG is not set
CONFIG_IP_DCCP_CCID3=y
CONFIG_IP_DCCP_CCID3_DEBUG=y
CONFIG_IP_DCCP_CCID3_RTO=100
CONFIG_IP_DCCP_TFRC_LIB=y
CONFIG_IP_DCCP_TFRC_DEBUG=y

#
# DCCP Kernel Hacking
#
# CONFIG_IP_DCCP_DEBUG is not set
CONFIG_IP_SCTP=y
CONFIG_SCTP_DBG_MSG=y
CONFIG_SCTP_DBG_OBJCNT=y
# CONFIG_SCTP_HMAC_NONE is not set
# CONFIG_SCTP_HMAC_SHA1 is not set
CONFIG_SCTP_HMAC_MD5=y
# CONFIG_RDS is not set
CONFIG_TIPC=y
CONFIG_TIPC_ADVANCED=y
CONFIG_TIPC_ZONES=3
CONFIG_TIPC_CLUSTERS=1
CONFIG_TIPC_NODES=255
CONFIG_TIPC_SLAVE_NODES=0
CONFIG_TIPC_PORTS=8191
CONFIG_TIPC_LOG=0
CONFIG_TIPC_DEBUG=y
CONFIG_ATM=y
CONFIG_ATM_CLIP=y
CONFIG_ATM_CLIP_NO_ICMP=y
CONFIG_ATM_LANE=y
CONFIG_ATM_MPOA=y
CONFIG_ATM_BR2684=y
CONFIG_ATM_BR2684_IPFILTER=y
# CONFIG_BRIDGE is not set
# CONFIG_NET_DSA is not set
# CONFIG_VLAN_8021Q is not set
CONFIG_DECNET=y
CONFIG_DECNET_ROUTER=y
CONFIG_LLC=y
CONFIG_LLC2=y
CONFIG_IPX=y
CONFIG_IPX_INTERN=y
CONFIG_ATALK=y
CONFIG_DEV_APPLETALK=y
CONFIG_LTPC=y
# CONFIG_COPS is not set
CONFIG_IPDDP=y
CONFIG_IPDDP_ENCAP=y
CONFIG_IPDDP_DECAP=y
CONFIG_X25=y
# CONFIG_LAPB is not set
CONFIG_ECONET=y
CONFIG_ECONET_AUNUDP=y
CONFIG_ECONET_NATIVE=y
CONFIG_WAN_ROUTER=y
CONFIG_PHONET=y
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
CONFIG_NET_CLS_ROUTE=y
CONFIG_DCB=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NET_DROP_MONITOR is not set
CONFIG_HAMRADIO=y

#
# Packet Radio protocols
#
CONFIG_AX25=y
CONFIG_AX25_DAMA_SLAVE=y
CONFIG_NETROM=y
CONFIG_ROSE=y

#
# AX.25 network device drivers
#
CONFIG_MKISS=y
CONFIG_6PACK=y
CONFIG_BPQETHER=y
# CONFIG_SCC is not set
CONFIG_BAYCOM_SER_FDX=y
# CONFIG_BAYCOM_SER_HDX is not set
CONFIG_YAM=y
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
CONFIG_BT=y
# CONFIG_BT_L2CAP is not set
# CONFIG_BT_SCO is not set

#
# Bluetooth device drivers
#
CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIBTSDIO=y
CONFIG_BT_HCIUART=y
# CONFIG_BT_HCIUART_H4 is not set
# CONFIG_BT_HCIUART_BCSP is not set
# CONFIG_BT_HCIUART_LL is not set
CONFIG_BT_HCIBCM203X=y
CONFIG_BT_HCIBPA10X=y
# CONFIG_BT_HCIBFUSB is not set
CONFIG_BT_HCIVHCI=y
# CONFIG_BT_MRVL is not set
CONFIG_AF_RXRPC=y
CONFIG_AF_RXRPC_DEBUG=y
CONFIG_RXKAD=y
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
# CONFIG_CFG80211 is not set
CONFIG_CFG80211_DEFAULT_PS_VALUE=0
CONFIG_WIRELESS_OLD_REGULATORY=y
CONFIG_WIRELESS_EXT=y
CONFIG_WIRELESS_EXT_SYSFS=y
CONFIG_LIB80211=y
CONFIG_LIB80211_CRYPT_WEP=y
CONFIG_LIB80211_CRYPT_CCMP=y
CONFIG_LIB80211_CRYPT_TKIP=y
# CONFIG_LIB80211_DEBUG is not set

#
# CFG80211 needs to be enabled for MAC80211
#
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_DEBUG_DRIVER=y
CONFIG_DEBUG_DEVRES=y
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_CONNECTOR is not set
# CONFIG_MTD is not set
# CONFIG_PARPORT is not set
CONFIG_PNP=y
CONFIG_PNP_DEBUG_MESSAGES=y

#
# Protocols
#
CONFIG_ISAPNP=y
# CONFIG_PNPBIOS is not set
# CONFIG_PNPACPI is not set
CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_FD=y
CONFIG_BLK_DEV_XD=y
CONFIG_BLK_CPQ_DA=y
# CONFIG_BLK_CPQ_CISS_DA is not set
CONFIG_BLK_DEV_DAC960=y
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
# CONFIG_BLK_DEV_LOOP is not set
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_OSD=y
# CONFIG_BLK_DEV_SX8 is not set
CONFIG_BLK_DEV_UB=y
# CONFIG_BLK_DEV_RAM is not set
CONFIG_CDROM_PKTCDVD=y
CONFIG_CDROM_PKTCDVD_BUFFERS=8
CONFIG_CDROM_PKTCDVD_WCACHE=y
CONFIG_ATA_OVER_ETH=y
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_HD is not set
CONFIG_MISC_DEVICES=y
CONFIG_IBM_ASM=y
CONFIG_PHANTOM=y
CONFIG_SGI_IOC4=y
CONFIG_TIFM_CORE=y
# CONFIG_TIFM_7XX1 is not set
CONFIG_ICS932S401=y
CONFIG_ENCLOSURE_SERVICES=y
CONFIG_HP_ILO=y
# CONFIG_DELL_LAPTOP is not set
CONFIG_ISL29003=y
CONFIG_C2PORT=y
# CONFIG_C2PORT_DURAMAR_2150 is not set

#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_LEGACY is not set
CONFIG_EEPROM_MAX6875=y
CONFIG_EEPROM_93CX6=y
CONFIG_CB710_CORE=y
CONFIG_CB710_DEBUG=y
CONFIG_CB710_DEBUG_ASSUMPTIONS=y
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set

#
# SCSI device support
#
CONFIG_RAID_ATTRS=y
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_SCSI_TGT=y
CONFIG_SCSI_NETLINK=y
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=y
CONFIG_CHR_DEV_OSST=y
# CONFIG_BLK_DEV_SR is not set
# CONFIG_CHR_DEV_SG is not set
# CONFIG_CHR_DEV_SCH is not set
# CONFIG_SCSI_ENCLOSURE is not set
CONFIG_SCSI_MULTI_LUN=y
# CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set
# CONFIG_SCSI_SCAN_ASYNC is not set

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_FC_ATTRS=y
CONFIG_SCSI_FC_TGT_ATTRS=y
CONFIG_SCSI_ISCSI_ATTRS=y
CONFIG_SCSI_SAS_ATTRS=y
CONFIG_SCSI_SAS_LIBSAS=y
CONFIG_SCSI_SAS_ATA=y
# CONFIG_SCSI_SAS_HOST_SMP is not set
# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
CONFIG_SCSI_SRP_ATTRS=y
CONFIG_SCSI_SRP_TGT_ATTRS=y
CONFIG_SCSI_LOWLEVEL=y
CONFIG_ISCSI_TCP=y
# CONFIG_SCSI_CXGB3_ISCSI is not set
CONFIG_BLK_DEV_3W_XXXX_RAID=y
CONFIG_SCSI_3W_9XXX=y
# CONFIG_SCSI_7000FASST is not set
CONFIG_SCSI_ACARD=y
CONFIG_SCSI_AHA152X=y
# CONFIG_SCSI_AHA1542 is not set
CONFIG_SCSI_AHA1740=y
CONFIG_SCSI_AACRAID=y
CONFIG_SCSI_AIC7XXX=y
CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
CONFIG_AIC7XXX_RESET_DELAY_MS=5000
# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
CONFIG_AIC7XXX_DEBUG_MASK=0
CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
CONFIG_SCSI_AIC7XXX_OLD=y
# CONFIG_SCSI_AIC79XX is not set
CONFIG_SCSI_AIC94XX=y
# CONFIG_AIC94XX_DEBUG is not set
CONFIG_SCSI_MVSAS=y
CONFIG_SCSI_MVSAS_DEBUG=y
CONFIG_SCSI_DPT_I2O=y
CONFIG_SCSI_ADVANSYS=y
CONFIG_SCSI_IN2000=y
# CONFIG_SCSI_ARCMSR is not set
CONFIG_MEGARAID_NEWGEN=y
# CONFIG_MEGARAID_MM is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
CONFIG_SCSI_HPTIOP=y
# CONFIG_SCSI_BUSLOGIC is not set
CONFIG_LIBFC=y
CONFIG_LIBFCOE=y
CONFIG_FCOE=y
# CONFIG_FCOE_FNIC is not set
# CONFIG_SCSI_DMX3191D is not set
CONFIG_SCSI_DTC3280=y
CONFIG_SCSI_EATA=y
CONFIG_SCSI_EATA_TAGGED_QUEUE=y
# CONFIG_SCSI_EATA_LINKED_COMMANDS is not set
CONFIG_SCSI_EATA_MAX_TAGS=16
CONFIG_SCSI_FUTURE_DOMAIN=y
CONFIG_SCSI_GDTH=y
CONFIG_SCSI_GENERIC_NCR5380=y
# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
# CONFIG_SCSI_GENERIC_NCR53C400 is not set
CONFIG_SCSI_IBMMCA=y
CONFIG_IBMMCA_SCSI_ORDER_STANDARD=y
# CONFIG_IBMMCA_SCSI_DEV_RESET is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
CONFIG_SCSI_NCR53C406A=y
# CONFIG_SCSI_NCR_D700 is not set
# CONFIG_SCSI_STEX is not set
CONFIG_SCSI_SYM53C8XX_2=y
CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
CONFIG_SCSI_SYM53C8XX_MMIO=y
CONFIG_SCSI_IPR=y
# CONFIG_SCSI_IPR_TRACE is not set
CONFIG_SCSI_IPR_DUMP=y
# CONFIG_SCSI_NCR_Q720 is not set
CONFIG_SCSI_PAS16=y
CONFIG_SCSI_QLOGIC_FAS=y
CONFIG_SCSI_QLOGIC_1280=y
CONFIG_SCSI_QLA_FC=y
CONFIG_SCSI_QLA_ISCSI=y
CONFIG_SCSI_LPFC=y
CONFIG_SCSI_LPFC_DEBUG_FS=y
CONFIG_SCSI_SIM710=y
# CONFIG_SCSI_SYM53C416 is not set
CONFIG_SCSI_DC395x=y
CONFIG_SCSI_DC390T=y
CONFIG_SCSI_T128=y
# CONFIG_SCSI_U14_34F is not set
CONFIG_SCSI_ULTRASTOR=y
CONFIG_SCSI_NSP32=y
CONFIG_SCSI_PMCRAID=y
# CONFIG_SCSI_SRP is not set
CONFIG_SCSI_DH=y
CONFIG_SCSI_DH_RDAC=y
CONFIG_SCSI_DH_HP_SW=y
CONFIG_SCSI_DH_EMC=y
# CONFIG_SCSI_DH_ALUA is not set
CONFIG_SCSI_OSD_INITIATOR=y
CONFIG_SCSI_OSD_ULD=y
CONFIG_SCSI_OSD_DPRINT_SENSE=1
# CONFIG_SCSI_OSD_DEBUG is not set
CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
# CONFIG_SATA_PMP is not set
CONFIG_SATA_AHCI=y
CONFIG_SATA_SIL24=y
CONFIG_ATA_SFF=y
CONFIG_SATA_SVW=y
CONFIG_ATA_PIIX=y
# CONFIG_SATA_MV is not set
CONFIG_SATA_NV=y
CONFIG_PDC_ADMA=y
CONFIG_SATA_QSTOR=y
CONFIG_SATA_PROMISE=y
CONFIG_SATA_SX4=y
CONFIG_SATA_SIL=y
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_PATA_ALI is not set
CONFIG_PATA_AMD=y
CONFIG_PATA_ARTOP=y
CONFIG_PATA_ATP867X=y
# CONFIG_PATA_ATIIXP is not set
CONFIG_PATA_CMD640_PCI=y
CONFIG_PATA_CMD64X=y
# CONFIG_PATA_CS5520 is not set
CONFIG_PATA_CS5530=y
# CONFIG_PATA_CS5535 is not set
# CONFIG_PATA_CS5536 is not set
CONFIG_PATA_CYPRESS=y
CONFIG_PATA_EFAR=y
CONFIG_ATA_GENERIC=y
# CONFIG_PATA_HPT366 is not set
CONFIG_PATA_HPT37X=y
# CONFIG_PATA_HPT3X2N is not set
CONFIG_PATA_HPT3X3=y
CONFIG_PATA_HPT3X3_DMA=y
CONFIG_PATA_ISAPNP=y
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_JMICRON is not set
CONFIG_PATA_LEGACY=y
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_MPIIX is not set
CONFIG_PATA_OLDPIIX=y
CONFIG_PATA_NETCELL=y
# CONFIG_PATA_NINJA32 is not set
CONFIG_PATA_NS87410=y
CONFIG_PATA_NS87415=y
CONFIG_PATA_OPTI=y
# CONFIG_PATA_OPTIDMA is not set
CONFIG_PATA_PDC_OLD=y
CONFIG_PATA_QDI=y
CONFIG_PATA_RADISYS=y
# CONFIG_PATA_RDC is not set
CONFIG_PATA_RZ1000=y
# CONFIG_PATA_SC1200 is not set
CONFIG_PATA_SERVERWORKS=y
# CONFIG_PATA_PDC2027X is not set
CONFIG_PATA_SIL680=y
CONFIG_PATA_SIS=y
# CONFIG_PATA_VIA is not set
CONFIG_PATA_WINBOND=y
CONFIG_PATA_WINBOND_VLB=y
# CONFIG_PATA_PLATFORM is not set
CONFIG_PATA_SCH=y
CONFIG_MD=y
# CONFIG_BLK_DEV_MD is not set
# CONFIG_BLK_DEV_DM is not set
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#

#
# You can enable one or both FireWire driver stacks.
#

#
# See the help texts for more information.
#
CONFIG_FIREWIRE=y
CONFIG_FIREWIRE_OHCI=y
CONFIG_FIREWIRE_OHCI_DEBUG=y
CONFIG_FIREWIRE_SBP2=y
CONFIG_FIREWIRE_NET=y
CONFIG_IEEE1394=y
CONFIG_IEEE1394_OHCI1394=y
CONFIG_IEEE1394_PCILYNX=y
# CONFIG_IEEE1394_SBP2 is not set
CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y
CONFIG_IEEE1394_ETH1394=y
CONFIG_IEEE1394_RAWIO=y
CONFIG_IEEE1394_VIDEO1394=y
CONFIG_IEEE1394_DV1394=y
# CONFIG_IEEE1394_VERBOSEDEBUG is not set
# CONFIG_I2O is not set
CONFIG_MACINTOSH_DRIVERS=y
# CONFIG_MAC_EMUMOUSEBTN is not set
CONFIG_NETDEVICES=y
CONFIG_DUMMY=y
CONFIG_BONDING=y
# CONFIG_MACVLAN is not set
CONFIG_EQUALIZER=y
CONFIG_TUN=y
CONFIG_VETH=y
# CONFIG_NET_SB1000 is not set
CONFIG_ARCNET=y
# CONFIG_ARCNET_1201 is not set
CONFIG_ARCNET_1051=y
CONFIG_ARCNET_RAW=y
CONFIG_ARCNET_CAP=y
# CONFIG_ARCNET_COM90xx is not set
CONFIG_ARCNET_COM90xxIO=y
CONFIG_ARCNET_RIM_I=y
CONFIG_ARCNET_COM20020=y
# CONFIG_ARCNET_COM20020_ISA is not set
# CONFIG_ARCNET_COM20020_PCI is not set
CONFIG_PHYLIB=y

#
# MII PHY device drivers
#
# CONFIG_MARVELL_PHY is not set
CONFIG_DAVICOM_PHY=y
# CONFIG_QSEMI_PHY is not set
CONFIG_LXT_PHY=y
CONFIG_CICADA_PHY=y
# CONFIG_VITESSE_PHY is not set
CONFIG_SMSC_PHY=y
CONFIG_BROADCOM_PHY=y
# CONFIG_ICPLUS_PHY is not set
CONFIG_REALTEK_PHY=y
# CONFIG_NATIONAL_PHY is not set
CONFIG_STE10XP=y
CONFIG_LSI_ET1011C_PHY=y
CONFIG_FIXED_PHY=y
# CONFIG_MDIO_BITBANG is not set
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
# CONFIG_HAPPYMEAL is not set
CONFIG_SUNGEM=y
CONFIG_CASSINI=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_LANCE is not set
CONFIG_NET_VENDOR_SMC=y
CONFIG_ULTRAMCA=y
CONFIG_ULTRA=y
# CONFIG_ULTRA32 is not set
CONFIG_SMC9194=y
CONFIG_ETHOC=y
CONFIG_NET_VENDOR_RACAL=y
CONFIG_NI52=y
CONFIG_NI65=y
CONFIG_DNET=y
CONFIG_NET_TULIP=y
CONFIG_DE2104X=y
CONFIG_DE2104X_DSL=0
CONFIG_TULIP=y
# CONFIG_TULIP_MWI is not set
CONFIG_TULIP_MMIO=y
CONFIG_TULIP_NAPI=y
# CONFIG_TULIP_NAPI_HW_MITIGATION is not set
CONFIG_DE4X5=y
# CONFIG_WINBOND_840 is not set
CONFIG_DM9102=y
# CONFIG_ULI526X is not set
CONFIG_AT1700=y
# CONFIG_DEPCA is not set
CONFIG_HP100=y
# CONFIG_NET_ISA is not set
CONFIG_IBMLANA=y
# CONFIG_IBM_NEW_EMAC_ZMII is not set
# CONFIG_IBM_NEW_EMAC_RGMII is not set
# CONFIG_IBM_NEW_EMAC_TAH is not set
# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
CONFIG_NET_PCI=y
# CONFIG_PCNET32 is not set
CONFIG_AMD8111_ETH=y
# CONFIG_ADAPTEC_STARFIRE is not set
CONFIG_AC3200=y
CONFIG_APRICOT=y
CONFIG_B44=y
CONFIG_B44_PCI_AUTOSELECT=y
CONFIG_B44_PCICORE_AUTOSELECT=y
CONFIG_B44_PCI=y
CONFIG_FORCEDETH=y
CONFIG_FORCEDETH_NAPI=y
# CONFIG_CS89x0 is not set
CONFIG_E100=y
CONFIG_LNE390=y
CONFIG_FEALNX=y
# CONFIG_NATSEMI is not set
CONFIG_NE2K_PCI=y
CONFIG_NE3210=y
CONFIG_ES3210=y
CONFIG_8139CP=y
CONFIG_8139TOO=y
CONFIG_8139TOO_PIO=y
# CONFIG_8139TOO_TUNE_TWISTER is not set
# CONFIG_8139TOO_8129 is not set
# CONFIG_8139_OLD_RX_RESET is not set
CONFIG_R6040=y
CONFIG_SIS900=y
CONFIG_EPIC100=y
# CONFIG_SMSC9420 is not set
CONFIG_SUNDANCE=y
CONFIG_SUNDANCE_MMIO=y
CONFIG_TLAN=y
CONFIG_KS8842=y
CONFIG_VIA_RHINE=y
CONFIG_VIA_RHINE_MMIO=y
CONFIG_SC92031=y
# CONFIG_ATL2 is not set
CONFIG_NETDEV_1000=y
# CONFIG_ACENIC is not set
# CONFIG_DL2K is not set
# CONFIG_E1000 is not set
CONFIG_E1000E=y
CONFIG_IP1000=y
# CONFIG_IGB is not set
CONFIG_IGBVF=y
# CONFIG_NS83820 is not set
CONFIG_HAMACHI=y
# CONFIG_YELLOWFIN is not set
CONFIG_R8169=y
# CONFIG_SIS190 is not set
CONFIG_SKGE=y
CONFIG_SKGE_DEBUG=y
CONFIG_SKY2=y
CONFIG_SKY2_DEBUG=y
CONFIG_VIA_VELOCITY=y
CONFIG_TIGON3=y
CONFIG_BNX2=y
CONFIG_QLA3XXX=y
CONFIG_ATL1=y
CONFIG_ATL1E=y
CONFIG_ATL1C=y
CONFIG_JME=y
CONFIG_NETDEV_10000=y
CONFIG_MDIO=y
CONFIG_CHELSIO_T1=y
CONFIG_CHELSIO_T1_1G=y
CONFIG_CHELSIO_T3_DEPENDS=y
CONFIG_CHELSIO_T3=y
# CONFIG_ENIC is not set
# CONFIG_IXGBE is not set
CONFIG_IXGB=y
# CONFIG_S2IO is not set
CONFIG_MYRI10GE=y
CONFIG_MYRI10GE_DCA=y
CONFIG_NIU=y
CONFIG_MLX4_EN=y
CONFIG_MLX4_CORE=y
CONFIG_MLX4_DEBUG=y
# CONFIG_TEHUTI is not set
# CONFIG_BNX2X is not set
# CONFIG_QLGE is not set
CONFIG_SFC=y
# CONFIG_BE2NET is not set
CONFIG_TR=y
CONFIG_IBMTR=y
CONFIG_IBMOL=y
CONFIG_IBMLS=y
CONFIG_3C359=y
# CONFIG_TMS380TR is not set
CONFIG_SMCTR=y
CONFIG_WLAN=y
CONFIG_WLAN_PRE80211=y
CONFIG_STRIP=y
CONFIG_ARLAN=y
CONFIG_WAVELAN=y
CONFIG_WLAN_80211=y
# CONFIG_LIBERTAS is not set
CONFIG_AIRO=y
CONFIG_ATMEL=y
CONFIG_PCI_ATMEL=y
CONFIG_PRISM54=y
CONFIG_USB_ZD1201=y
CONFIG_HOSTAP=y
CONFIG_HOSTAP_FIRMWARE=y
CONFIG_HOSTAP_FIRMWARE_NVRAM=y
CONFIG_HOSTAP_PLX=y
# CONFIG_HOSTAP_PCI is not set

#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#

#
# USB Network Adapters
#
CONFIG_USB_CATC=y
CONFIG_USB_KAWETH=y
CONFIG_USB_PEGASUS=y
# CONFIG_USB_RTL8150 is not set
CONFIG_USB_USBNET=y
# CONFIG_USB_NET_AX8817X is not set
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_CDC_EEM=y
# CONFIG_USB_NET_DM9601 is not set
CONFIG_USB_NET_SMSC95XX=y
# CONFIG_USB_NET_GL620A is not set
# CONFIG_USB_NET_NET1080 is not set
CONFIG_USB_NET_PLUSB=y
CONFIG_USB_NET_MCS7830=y
# CONFIG_USB_NET_RNDIS_HOST is not set
CONFIG_USB_NET_CDC_SUBSET=y
# CONFIG_USB_ALI_M5632 is not set
CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_ZAURUS=y
# CONFIG_USB_NET_INT51X1 is not set
CONFIG_USB_CDC_PHONET=y
CONFIG_WAN=y
CONFIG_LANMEDIA=y
CONFIG_HDLC=y
CONFIG_HDLC_RAW=y
CONFIG_HDLC_RAW_ETH=y
CONFIG_HDLC_CISCO=y
CONFIG_HDLC_FR=y
CONFIG_HDLC_PPP=y

#
# X.25/LAPB support is disabled
#
CONFIG_PCI200SYN=y
# CONFIG_WANXL is not set
# CONFIG_PC300TOO is not set
# CONFIG_N2 is not set
# CONFIG_C101 is not set
# CONFIG_FARSYNC is not set
CONFIG_DLCI=y
CONFIG_DLCI_MAX=8
CONFIG_SDLA=y
CONFIG_WAN_ROUTER_DRIVERS=y
CONFIG_CYCLADES_SYNC=y
# CONFIG_CYCLOMX_X25 is not set
CONFIG_SBNI=y
# CONFIG_SBNI_MULTILINE is not set
CONFIG_ATM_DRIVERS=y
CONFIG_ATM_DUMMY=y
CONFIG_ATM_TCP=y
# CONFIG_ATM_LANAI is not set
# CONFIG_ATM_ENI is not set
CONFIG_ATM_FIRESTREAM=y
# CONFIG_ATM_ZATM is not set
CONFIG_ATM_NICSTAR=y
# CONFIG_ATM_NICSTAR_USE_SUNI is not set
# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
# CONFIG_ATM_IDT77252 is not set
CONFIG_ATM_AMBASSADOR=y
CONFIG_ATM_AMBASSADOR_DEBUG=y
CONFIG_ATM_HORIZON=y
CONFIG_ATM_HORIZON_DEBUG=y
CONFIG_ATM_IA=y
# CONFIG_ATM_IA_DEBUG is not set
# CONFIG_ATM_FORE200E is not set
CONFIG_ATM_HE=y
CONFIG_ATM_HE_USE_SUNI=y
CONFIG_ATM_SOLOS=y
CONFIG_FDDI=y
CONFIG_DEFXX=y
CONFIG_DEFXX_MMIO=y
CONFIG_SKFP=y
# CONFIG_HIPPI is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
CONFIG_SLHC=y
CONFIG_NET_FC=y
CONFIG_NETCONSOLE=y
CONFIG_NETCONSOLE_DYNAMIC=y
CONFIG_NETPOLL=y
CONFIG_NETPOLL_TRAP=y
CONFIG_NET_POLL_CONTROLLER=y
CONFIG_VIRTIO_NET=y
CONFIG_ISDN=y
CONFIG_ISDN_I4L=y
CONFIG_ISDN_PPP=y
CONFIG_ISDN_PPP_VJ=y
CONFIG_ISDN_MPP=y
# CONFIG_IPPP_FILTER is not set
CONFIG_ISDN_PPP_BSDCOMP=y
CONFIG_ISDN_AUDIO=y
CONFIG_ISDN_TTY_FAX=y
CONFIG_ISDN_X25=y

#
# ISDN feature submodules
#
CONFIG_ISDN_DIVERSION=y

#
# ISDN4Linux hardware drivers
#

#
# Passive cards
#
CONFIG_ISDN_DRV_HISAX=y

#
# D-channel protocol features
#
CONFIG_HISAX_EURO=y
# CONFIG_DE_AOC is not set
# CONFIG_HISAX_NO_SENDCOMPLETE is not set
CONFIG_HISAX_NO_LLC=y
# CONFIG_HISAX_NO_KEYPAD is not set
CONFIG_HISAX_1TR6=y
CONFIG_HISAX_NI1=y
CONFIG_HISAX_MAX_CARDS=8

#
# HiSax supported cards
#
CONFIG_HISAX_16_0=y
# CONFIG_HISAX_16_3 is not set
# CONFIG_HISAX_TELESPCI is not set
# CONFIG_HISAX_S0BOX is not set
# CONFIG_HISAX_AVM_A1 is not set
CONFIG_HISAX_FRITZPCI=y
CONFIG_HISAX_AVM_A1_PCMCIA=y
# CONFIG_HISAX_ELSA is not set
# CONFIG_HISAX_IX1MICROR2 is not set
CONFIG_HISAX_DIEHLDIVA=y
CONFIG_HISAX_ASUSCOM=y
CONFIG_HISAX_TELEINT=y
CONFIG_HISAX_HFCS=y
# CONFIG_HISAX_SEDLBAUER is not set
CONFIG_HISAX_SPORTSTER=y
# CONFIG_HISAX_MIC is not set
# CONFIG_HISAX_NETJET is not set
CONFIG_HISAX_NETJET_U=y
# CONFIG_HISAX_NICCY is not set
CONFIG_HISAX_ISURF=y
# CONFIG_HISAX_HSTSAPHIR is not set
CONFIG_HISAX_BKM_A4T=y
CONFIG_HISAX_SCT_QUADRO=y
CONFIG_HISAX_GAZEL=y
CONFIG_HISAX_HFC_PCI=y
CONFIG_HISAX_W6692=y
CONFIG_HISAX_HFC_SX=y
CONFIG_HISAX_DEBUG=y

#
# HiSax PCMCIA card service modules
#

#
# HiSax sub driver modules
#
CONFIG_HISAX_ST5481=y
# CONFIG_HISAX_HFCUSB is not set
# CONFIG_HISAX_HFC4S8S is not set
CONFIG_HISAX_FRITZ_PCIPNP=y

#
# Active cards
#
# CONFIG_ISDN_DRV_ICN is not set
CONFIG_ISDN_DRV_PCBIT=y
CONFIG_ISDN_DRV_SC=y
# CONFIG_ISDN_DRV_ACT2000 is not set
CONFIG_ISDN_HDLC=y
CONFIG_ISDN_CAPI=y
CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
CONFIG_CAPI_TRACE=y
# CONFIG_ISDN_CAPI_MIDDLEWARE is not set
CONFIG_ISDN_CAPI_CAPI20=y
CONFIG_ISDN_CAPI_CAPIDRV=y

#
# CAPI hardware drivers
#
CONFIG_CAPI_AVM=y
# CONFIG_ISDN_DRV_AVMB1_B1ISA is not set
# CONFIG_ISDN_DRV_AVMB1_B1PCI is not set
CONFIG_ISDN_DRV_AVMB1_T1ISA=y
# CONFIG_ISDN_DRV_AVMB1_B1PCMCIA is not set
CONFIG_ISDN_DRV_AVMB1_T1PCI=y
CONFIG_ISDN_DRV_AVMB1_C4=y
CONFIG_CAPI_EICON=y
# CONFIG_ISDN_DIVAS is not set
# CONFIG_ISDN_DRV_GIGASET is not set
CONFIG_PHONE=y

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_FF_MEMLESS=y
CONFIG_INPUT_POLLDEV=y

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_JOYDEV=y
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=y

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ADP5588=y
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_QT2160 is not set
CONFIG_KEYBOARD_LKKBD=y
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_MATRIX=y
CONFIG_KEYBOARD_LM8323=y
CONFIG_KEYBOARD_MAX7359=y
# CONFIG_KEYBOARD_NEWTON is not set
CONFIG_KEYBOARD_OPENCORES=y
CONFIG_KEYBOARD_STOWAWAY=y
CONFIG_KEYBOARD_SUNKBD=y
CONFIG_KEYBOARD_TWL4030=y
CONFIG_KEYBOARD_XTKBD=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_JOYSTICK=y
CONFIG_JOYSTICK_ANALOG=y
CONFIG_JOYSTICK_A3D=y
CONFIG_JOYSTICK_ADI=y
CONFIG_JOYSTICK_COBRA=y
CONFIG_JOYSTICK_GF2K=y
CONFIG_JOYSTICK_GRIP=y
CONFIG_JOYSTICK_GRIP_MP=y
# CONFIG_JOYSTICK_GUILLEMOT is not set
# CONFIG_JOYSTICK_INTERACT is not set
CONFIG_JOYSTICK_SIDEWINDER=y
CONFIG_JOYSTICK_TMDC=y
CONFIG_JOYSTICK_IFORCE=y
# CONFIG_JOYSTICK_IFORCE_USB is not set
CONFIG_JOYSTICK_IFORCE_232=y
# CONFIG_JOYSTICK_WARRIOR is not set
CONFIG_JOYSTICK_MAGELLAN=y
# CONFIG_JOYSTICK_SPACEORB is not set
CONFIG_JOYSTICK_SPACEBALL=y
CONFIG_JOYSTICK_STINGER=y
# CONFIG_JOYSTICK_TWIDJOY is not set
CONFIG_JOYSTICK_ZHENHUA=y
CONFIG_JOYSTICK_JOYDUMP=y
CONFIG_JOYSTICK_XPAD=y
CONFIG_JOYSTICK_XPAD_FF=y
CONFIG_JOYSTICK_XPAD_LEDS=y
# CONFIG_INPUT_TABLET is not set
CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
# CONFIG_TOUCHSCREEN_AD7879 is not set
CONFIG_TOUCHSCREEN_DA9034=y
CONFIG_TOUCHSCREEN_EETI=y
# CONFIG_TOUCHSCREEN_FUJITSU is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
CONFIG_TOUCHSCREEN_ELO=y
# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
CONFIG_TOUCHSCREEN_MCS5000=y
# CONFIG_TOUCHSCREEN_MTOUCH is not set
CONFIG_TOUCHSCREEN_INEXIO=y
CONFIG_TOUCHSCREEN_MK712=y
# CONFIG_TOUCHSCREEN_HTCPEN is not set
CONFIG_TOUCHSCREEN_PENMOUNT=y
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
# CONFIG_TOUCHSCREEN_UCB1400 is not set
# CONFIG_TOUCHSCREEN_WM97XX is not set
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
CONFIG_TOUCHSCREEN_USB_EGALAX=y
CONFIG_TOUCHSCREEN_USB_PANJIT=y
# CONFIG_TOUCHSCREEN_USB_3M is not set
CONFIG_TOUCHSCREEN_USB_ITM=y
# CONFIG_TOUCHSCREEN_USB_ETURBO is not set
# CONFIG_TOUCHSCREEN_USB_GUNZE is not set
# CONFIG_TOUCHSCREEN_USB_DMC_TSC10 is not set
CONFIG_TOUCHSCREEN_USB_IRTOUCH=y
CONFIG_TOUCHSCREEN_USB_IDEALTEK=y
CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y
CONFIG_TOUCHSCREEN_USB_GOTOP=y
# CONFIG_TOUCHSCREEN_USB_JASTEC is not set
CONFIG_TOUCHSCREEN_USB_E2I=y
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
CONFIG_TOUCHSCREEN_TSC2007=y
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_APANEL is not set
CONFIG_INPUT_WISTRON_BTNS=y
# CONFIG_INPUT_ATI_REMOTE is not set
CONFIG_INPUT_ATI_REMOTE2=y
CONFIG_INPUT_KEYSPAN_REMOTE=y
CONFIG_INPUT_POWERMATE=y
CONFIG_INPUT_YEALINK=y
# CONFIG_INPUT_CM109 is not set
# CONFIG_INPUT_TWL4030_PWRBUTTON is not set
CONFIG_INPUT_UINPUT=y
CONFIG_INPUT_WINBOND_CIR=y
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
CONFIG_SERIO_SERPORT=y
# CONFIG_SERIO_CT82C710 is not set
CONFIG_SERIO_PCIPS2=y
CONFIG_SERIO_LIBPS2=y
CONFIG_SERIO_RAW=y
CONFIG_GAMEPORT=y
CONFIG_GAMEPORT_NS558=y
# CONFIG_GAMEPORT_L4 is not set
CONFIG_GAMEPORT_EMU10K1=y
# CONFIG_GAMEPORT_FM801 is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_DEVKMEM=y
CONFIG_SERIAL_NONSTANDARD=y
CONFIG_COMPUTONE=y
CONFIG_ROCKETPORT=y
# CONFIG_CYCLADES is not set
CONFIG_DIGIEPCA=y
CONFIG_MOXA_INTELLIO=y
CONFIG_MOXA_SMARTIO=y
# CONFIG_ISI is not set
CONFIG_SYNCLINK=y
CONFIG_SYNCLINKMP=y
# CONFIG_SYNCLINK_GT is not set
CONFIG_N_HDLC=y
CONFIG_RISCOM8=y
CONFIG_SPECIALIX=y
CONFIG_SX=y
CONFIG_RIO=y
CONFIG_RIO_OLDPCI=y
# CONFIG_STALDRV is not set
CONFIG_NOZOMI=y

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_FIX_EARLYCON_MEM=y
# CONFIG_SERIAL_8250_PCI is not set
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_FOURPORT=y
# CONFIG_SERIAL_8250_ACCENT is not set
# CONFIG_SERIAL_8250_BOCA is not set
# CONFIG_SERIAL_8250_EXAR_ST16C554 is not set
CONFIG_SERIAL_8250_HUB6=y
# CONFIG_SERIAL_8250_SHARE_IRQ is not set
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_8250_MCA=y

#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_JSM=y
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
CONFIG_HVC_DRIVER=y
CONFIG_VIRTIO_CONSOLE=y
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
CONFIG_HW_RANDOM_INTEL=y
# CONFIG_HW_RANDOM_AMD is not set
CONFIG_HW_RANDOM_GEODE=y
CONFIG_HW_RANDOM_VIA=y
# CONFIG_HW_RANDOM_VIRTIO is not set
CONFIG_NVRAM=y
CONFIG_RTC=y
CONFIG_DTLK=y
CONFIG_R3964=y
CONFIG_APPLICOM=y
# CONFIG_SONYPI is not set
CONFIG_MWAVE=y
CONFIG_PC8736x_GPIO=y
CONFIG_NSC_GPIO=y
CONFIG_CS5535_GPIO=y
CONFIG_RAW_DRIVER=y
CONFIG_MAX_RAW_DEVS=256
# CONFIG_HANGCHECK_TIMER is not set
CONFIG_TCG_TPM=y
CONFIG_TCG_TIS=y
# CONFIG_TCG_NSC is not set
CONFIG_TCG_ATMEL=y
CONFIG_TCG_INFINEON=y
CONFIG_TELCLOCK=y
CONFIG_DEVPORT=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_HELPER_AUTO is not set

#
# I2C Algorithms
#
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_ALGOPCF=y
CONFIG_I2C_ALGOPCA=y

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
CONFIG_I2C_ALI1535=y
# CONFIG_I2C_ALI1563 is not set
CONFIG_I2C_ALI15X3=y
CONFIG_I2C_AMD756=y
# CONFIG_I2C_AMD8111 is not set
CONFIG_I2C_I801=y
CONFIG_I2C_ISCH=y
CONFIG_I2C_PIIX4=y
CONFIG_I2C_NFORCE2=y
CONFIG_I2C_SIS5595=y
CONFIG_I2C_SIS630=y
CONFIG_I2C_SIS96X=y
CONFIG_I2C_VIA=y
# CONFIG_I2C_VIAPRO is not set

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_GPIO is not set
CONFIG_I2C_OCORES=y
CONFIG_I2C_SIMTEC=y

#
# External I2C/SMBus adapter drivers
#
# CONFIG_I2C_PARPORT_LIGHT is not set
CONFIG_I2C_TAOS_EVM=y
# CONFIG_I2C_TINY_USB is not set

#
# Graphics adapter I2C/DDC channel drivers
#
# CONFIG_I2C_VOODOO3 is not set

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_PCA_ISA is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_SCx200_ACB is not set

#
# Miscellaneous I2C Chip support
#
# CONFIG_DS1682 is not set
# CONFIG_SENSORS_TSL2550 is not set
CONFIG_I2C_DEBUG_CORE=y
CONFIG_I2C_DEBUG_ALGO=y
CONFIG_I2C_DEBUG_BUS=y
CONFIG_I2C_DEBUG_CHIP=y
# CONFIG_SPI is not set

#
# PPS support
#
CONFIG_PPS=y
CONFIG_PPS_DEBUG=y
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIOLIB=y
CONFIG_DEBUG_GPIO=y
CONFIG_GPIO_SYSFS=y

#
# Memory mapped GPIO expanders:
#

#
# I2C GPIO expanders:
#
CONFIG_GPIO_MAX732X=y
# CONFIG_GPIO_PCA953X is not set
CONFIG_GPIO_PCF857X=y
CONFIG_GPIO_TWL4030=y

#
# PCI GPIO expanders:
#
CONFIG_GPIO_BT8XX=y
CONFIG_GPIO_LANGWELL=y

#
# SPI GPIO expanders:
#

#
# AC97 GPIO expanders:
#
# CONFIG_GPIO_UCB1400 is not set
CONFIG_W1=y

#
# 1-wire Bus Masters
#
CONFIG_W1_MASTER_MATROX=y
CONFIG_W1_MASTER_DS2490=y
CONFIG_W1_MASTER_DS2482=y
# CONFIG_W1_MASTER_GPIO is not set

#
# 1-wire Slaves
#
CONFIG_W1_SLAVE_THERM=y
CONFIG_W1_SLAVE_SMEM=y
CONFIG_W1_SLAVE_DS2431=y
CONFIG_W1_SLAVE_DS2433=y
CONFIG_W1_SLAVE_DS2433_CRC=y
# CONFIG_W1_SLAVE_DS2760 is not set
CONFIG_W1_SLAVE_BQ27000=y
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
CONFIG_PDA_POWER=y
# CONFIG_BATTERY_DS2760 is not set
CONFIG_BATTERY_DS2782=y
CONFIG_BATTERY_OLPC=y
CONFIG_BATTERY_BQ27x00=y
CONFIG_BATTERY_DA9030=y
CONFIG_BATTERY_MAX17040=y
CONFIG_HWMON=y
CONFIG_HWMON_VID=y
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
CONFIG_SENSORS_ABITUGURU=y
# CONFIG_SENSORS_ABITUGURU3 is not set
CONFIG_SENSORS_AD7414=y
CONFIG_SENSORS_AD7418=y
CONFIG_SENSORS_ADM1021=y
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
CONFIG_SENSORS_ADM1029=y
CONFIG_SENSORS_ADM1031=y
# CONFIG_SENSORS_ADM9240 is not set
CONFIG_SENSORS_ADT7462=y
CONFIG_SENSORS_ADT7470=y
CONFIG_SENSORS_ADT7473=y
CONFIG_SENSORS_ADT7475=y
# CONFIG_SENSORS_K8TEMP is not set
CONFIG_SENSORS_ASB100=y
CONFIG_SENSORS_ATXP1=y
# CONFIG_SENSORS_DS1621 is not set
CONFIG_SENSORS_I5K_AMB=y
CONFIG_SENSORS_F71805F=y
# CONFIG_SENSORS_F71882FG is not set
# CONFIG_SENSORS_F75375S is not set
# CONFIG_SENSORS_FSCHMD is not set
CONFIG_SENSORS_G760A=y
# CONFIG_SENSORS_GL518SM is not set
CONFIG_SENSORS_GL520SM=y
CONFIG_SENSORS_CORETEMP=y
CONFIG_SENSORS_IT87=y
# CONFIG_SENSORS_LM63 is not set
CONFIG_SENSORS_LM75=y
CONFIG_SENSORS_LM77=y
CONFIG_SENSORS_LM78=y
# CONFIG_SENSORS_LM80 is not set
CONFIG_SENSORS_LM83=y
# CONFIG_SENSORS_LM85 is not set
CONFIG_SENSORS_LM87=y
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
CONFIG_SENSORS_LTC4215=y
CONFIG_SENSORS_LTC4245=y
CONFIG_SENSORS_LM95241=y
# CONFIG_SENSORS_MAX1619 is not set
CONFIG_SENSORS_MAX6650=y
# CONFIG_SENSORS_PC87360 is not set
CONFIG_SENSORS_PC87427=y
CONFIG_SENSORS_PCF8591=y
CONFIG_SENSORS_SHT15=y
# CONFIG_SENSORS_SIS5595 is not set
CONFIG_SENSORS_DME1737=y
# CONFIG_SENSORS_SMSC47M1 is not set
CONFIG_SENSORS_SMSC47M192=y
CONFIG_SENSORS_SMSC47B397=y
CONFIG_SENSORS_ADS7828=y
CONFIG_SENSORS_THMC50=y
CONFIG_SENSORS_TMP401=y
CONFIG_SENSORS_TMP421=y
CONFIG_SENSORS_VIA686A=y
CONFIG_SENSORS_VT1211=y
# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83781D is not set
CONFIG_SENSORS_W83791D=y
CONFIG_SENSORS_W83792D=y
CONFIG_SENSORS_W83793=y
CONFIG_SENSORS_W83L785TS=y
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_SENSORS_HDAPS is not set
CONFIG_SENSORS_APPLESMC=y
CONFIG_THERMAL=y
# CONFIG_THERMAL_HWMON is not set
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_NOWAYOUT=y

#
# Watchdog Device Drivers
#
CONFIG_SOFT_WATCHDOG=y
CONFIG_TWL4030_WATCHDOG=y
CONFIG_ACQUIRE_WDT=y
CONFIG_ADVANTECH_WDT=y
CONFIG_ALIM1535_WDT=y
CONFIG_ALIM7101_WDT=y
CONFIG_SC520_WDT=y
# CONFIG_EUROTECH_WDT is not set
CONFIG_IB700_WDT=y
CONFIG_IBMASR=y
# CONFIG_WAFER_WDT is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_ITCO_WDT is not set
CONFIG_IT8712F_WDT=y
CONFIG_IT87_WDT=y
CONFIG_HP_WATCHDOG=y
# CONFIG_SC1200_WDT is not set
CONFIG_PC87413_WDT=y
CONFIG_60XX_WDT=y
CONFIG_SBC8360_WDT=y
CONFIG_SBC7240_WDT=y
# CONFIG_CPU5_WDT is not set
CONFIG_SMSC_SCH311X_WDT=y
CONFIG_SMSC37B787_WDT=y
CONFIG_W83627HF_WDT=y
# CONFIG_W83697HF_WDT is not set
# CONFIG_W83697UG_WDT is not set
CONFIG_W83877F_WDT=y
# CONFIG_W83977F_WDT is not set
CONFIG_MACHZ_WDT=y
# CONFIG_SBC_EPX_C3_WATCHDOG is not set

#
# ISA-based Watchdog Cards
#
CONFIG_PCWATCHDOG=y
# CONFIG_MIXCOMWD is not set
# CONFIG_WDT is not set

#
# PCI-based Watchdog Cards
#
CONFIG_PCIPCWATCHDOG=y
# CONFIG_WDTPCI is not set

#
# USB-based Watchdog Cards
#
# CONFIG_USBPCWATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
CONFIG_SSB=y
CONFIG_SSB_SPROM=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
CONFIG_SSB_PCIHOST=y
# CONFIG_SSB_B43_PCI_BRIDGE is not set
CONFIG_SSB_SDIOHOST_POSSIBLE=y
CONFIG_SSB_SDIOHOST=y
CONFIG_SSB_SILENT=y
CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
CONFIG_SSB_DRIVER_PCICORE=y

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
CONFIG_MFD_SM501=y
# CONFIG_MFD_SM501_GPIO is not set
CONFIG_HTC_PASIC3=y
CONFIG_UCB1400_CORE=y
# CONFIG_TPS65010 is not set
CONFIG_TWL4030_CORE=y
# CONFIG_MFD_TMIO is not set
CONFIG_PMIC_DA903X=y
CONFIG_MFD_WM8400=y
# CONFIG_MFD_WM831X is not set
# CONFIG_MFD_PCF50633 is not set
CONFIG_AB3100_CORE=y
CONFIG_AB3100_OTP=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_DEBUG=y
# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
# CONFIG_REGULATOR_BQ24022 is not set
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_TWL4030 is not set
CONFIG_REGULATOR_WM8400=y
CONFIG_REGULATOR_DA903X=y
# CONFIG_REGULATOR_LP3971 is not set
CONFIG_REGULATOR_AB3100=y
CONFIG_REGULATOR_TPS65023=y
CONFIG_REGULATOR_TPS6507X=y
CONFIG_MEDIA_SUPPORT=y

#
# Multimedia core support
#
CONFIG_VIDEO_DEV=y
CONFIG_VIDEO_V4L2_COMMON=y
CONFIG_VIDEO_ALLOW_V4L1=y
CONFIG_VIDEO_V4L1_COMPAT=y
# CONFIG_DVB_CORE is not set
CONFIG_VIDEO_MEDIA=y

#
# Multimedia drivers
#
CONFIG_VIDEO_SAA7146=y
CONFIG_VIDEO_SAA7146_VV=y
CONFIG_MEDIA_TUNER=y
CONFIG_MEDIA_TUNER_CUSTOMISE=y
CONFIG_MEDIA_TUNER_SIMPLE=y
CONFIG_MEDIA_TUNER_TDA8290=y
CONFIG_MEDIA_TUNER_TDA827X=y
CONFIG_MEDIA_TUNER_TDA18271=y
CONFIG_MEDIA_TUNER_TDA9887=y
CONFIG_MEDIA_TUNER_TEA5761=y
CONFIG_MEDIA_TUNER_TEA5767=y
CONFIG_MEDIA_TUNER_MT20XX=y
CONFIG_MEDIA_TUNER_MT2060=y
CONFIG_MEDIA_TUNER_MT2266=y
CONFIG_MEDIA_TUNER_MT2131=y
CONFIG_MEDIA_TUNER_QT1010=y
CONFIG_MEDIA_TUNER_XC2028=y
CONFIG_MEDIA_TUNER_XC5000=y
CONFIG_MEDIA_TUNER_MXL5005S=y
# CONFIG_MEDIA_TUNER_MXL5007T is not set
# CONFIG_MEDIA_TUNER_MC44S803 is not set
CONFIG_VIDEO_V4L2=y
CONFIG_VIDEO_V4L1=y
CONFIG_VIDEOBUF_GEN=y
CONFIG_VIDEOBUF_DMA_SG=y
CONFIG_VIDEO_IR=y
CONFIG_VIDEO_TVEEPROM=y
CONFIG_VIDEO_TUNER=y
CONFIG_VIDEO_CAPTURE_DRIVERS=y
CONFIG_VIDEO_ADV_DEBUG=y
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
CONFIG_VIDEO_IR_I2C=y
CONFIG_VIDEO_TDA9840=y
CONFIG_VIDEO_TEA6415C=y
CONFIG_VIDEO_TEA6420=y
CONFIG_VIDEO_SAA6588=y
CONFIG_VIDEO_BT819=y
CONFIG_VIDEO_BT856=y
CONFIG_VIDEO_BT866=y
CONFIG_VIDEO_KS0127=y
CONFIG_VIDEO_OV7670=y
CONFIG_VIDEO_SAA7110=y
CONFIG_VIDEO_SAA711X=y
CONFIG_VIDEO_VPX3220=y
CONFIG_VIDEO_SAA7185=y
CONFIG_VIDEO_ADV7175=y
# CONFIG_VIDEO_VIVI is not set
# CONFIG_VIDEO_BT848 is not set
# CONFIG_VIDEO_PMS is not set
# CONFIG_VIDEO_CPIA is not set
# CONFIG_VIDEO_CPIA2 is not set
CONFIG_VIDEO_SAA5246A=y
# CONFIG_VIDEO_SAA5249 is not set
# CONFIG_VIDEO_STRADIS is not set
CONFIG_VIDEO_ZORAN=y
CONFIG_VIDEO_ZORAN_DC30=y
CONFIG_VIDEO_ZORAN_ZR36060=y
CONFIG_VIDEO_ZORAN_BUZ=y
CONFIG_VIDEO_ZORAN_DC10=y
CONFIG_VIDEO_ZORAN_LML33=y
# CONFIG_VIDEO_ZORAN_LML33R10 is not set
CONFIG_VIDEO_ZORAN_AVS6EYES=y
CONFIG_VIDEO_SAA7134=y
# CONFIG_VIDEO_SAA7134_ALSA is not set
CONFIG_VIDEO_MXB=y
# CONFIG_VIDEO_HEXIUM_ORION is not set
# CONFIG_VIDEO_HEXIUM_GEMINI is not set
# CONFIG_VIDEO_IVTV is not set
CONFIG_VIDEO_CAFE_CCIC=y
CONFIG_SOC_CAMERA=y
CONFIG_SOC_CAMERA_MT9M001=y
CONFIG_SOC_CAMERA_MT9M111=y
# CONFIG_SOC_CAMERA_MT9T031 is not set
CONFIG_SOC_CAMERA_MT9V022=y
CONFIG_SOC_CAMERA_TW9910=y
CONFIG_SOC_CAMERA_PLATFORM=y
CONFIG_SOC_CAMERA_OV772X=y
# CONFIG_V4L_USB_DRIVERS is not set
# CONFIG_RADIO_ADAPTERS is not set
CONFIG_DAB=y
# CONFIG_USB_DABUSB is not set

#
# Graphics support
#
# CONFIG_AGP is not set
CONFIG_VGA_ARB=y
CONFIG_DRM=y
CONFIG_DRM_TDFX=y
CONFIG_DRM_R128=y
# CONFIG_DRM_RADEON is not set
CONFIG_DRM_MGA=y
CONFIG_DRM_VIA=y
# CONFIG_DRM_SAVAGE is not set
CONFIG_VGASTATE=y
CONFIG_VIDEO_OUTPUT_CONTROL=y
CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
# CONFIG_FB_DDC is not set
CONFIG_FB_BOOT_VESA_SUPPORT=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_IMAGEBLIT=y
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYS_FOPS=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_HECUBA=y
CONFIG_FB_SVGALIB=y
# CONFIG_FB_MACMODES is not set
CONFIG_FB_BACKLIGHT=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

#
# Frame buffer hardware drivers
#
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
CONFIG_FB_CYBER2000=y
# CONFIG_FB_ARC is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
# CONFIG_FB_VGA16 is not set
# CONFIG_FB_VESA is not set
CONFIG_FB_N411=y
CONFIG_FB_HGA=y
# CONFIG_FB_HGA_ACCEL is not set
CONFIG_FB_S1D13XXX=y
# CONFIG_FB_NVIDIA is not set
# CONFIG_FB_RIVA is not set
CONFIG_FB_LE80578=y
CONFIG_FB_CARILLO_RANCH=y
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
CONFIG_FB_ATY128=y
CONFIG_FB_ATY128_BACKLIGHT=y
CONFIG_FB_ATY=y
CONFIG_FB_ATY_CT=y
CONFIG_FB_ATY_GENERIC_LCD=y
# CONFIG_FB_ATY_GX is not set
CONFIG_FB_ATY_BACKLIGHT=y
# CONFIG_FB_S3 is not set
CONFIG_FB_SAVAGE=y
# CONFIG_FB_SAVAGE_I2C is not set
CONFIG_FB_SAVAGE_ACCEL=y
CONFIG_FB_SIS=y
# CONFIG_FB_SIS_300 is not set
# CONFIG_FB_SIS_315 is not set
# CONFIG_FB_VIA is not set
CONFIG_FB_NEOMAGIC=y
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
CONFIG_FB_VT8623=y
CONFIG_FB_TRIDENT=y
# CONFIG_FB_ARK is not set
CONFIG_FB_PM3=y
# CONFIG_FB_CARMINE is not set
CONFIG_FB_GEODE=y
CONFIG_FB_GEODE_LX=y
CONFIG_FB_GEODE_GX=y
CONFIG_FB_GEODE_GX1=y
# CONFIG_FB_TMIO is not set
# CONFIG_FB_SM501 is not set
# CONFIG_FB_VIRTUAL is not set
CONFIG_FB_METRONOME=y
CONFIG_FB_MB862XX=y
CONFIG_FB_MB862XX_PCI_GDC=y
CONFIG_FB_BROADSHEET=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=y
# CONFIG_LCD_ILI9320 is not set
CONFIG_LCD_PLATFORM=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_GENERIC=y
# CONFIG_BACKLIGHT_PROGEAR is not set
# CONFIG_BACKLIGHT_CARILLO_RANCH is not set
CONFIG_BACKLIGHT_DA903X=y
# CONFIG_BACKLIGHT_MBP_NVIDIA is not set
CONFIG_BACKLIGHT_SAHARA=y

#
# Display device support
#
CONFIG_DISPLAY_SUPPORT=y

#
# Display hardware drivers
#

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
CONFIG_VGACON_SOFT_SCROLLBACK=y
CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
# CONFIG_MDA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE is not set
CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
# CONFIG_LOGO_LINUX_CLUT224 is not set
CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_HWDEP=y
CONFIG_SND_RAWMIDI=y
CONFIG_SND_JACK=y
CONFIG_SND_SEQUENCER=y
CONFIG_SND_SEQ_DUMMY=y
CONFIG_SND_OSSEMUL=y
# CONFIG_SND_MIXER_OSS is not set
# CONFIG_SND_PCM_OSS is not set
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_HRTIMER=y
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
CONFIG_SND_RTCTIMER=y
CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_SND_DEBUG=y
# CONFIG_SND_DEBUG_VERBOSE is not set
CONFIG_SND_PCM_XRUN_DEBUG=y
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_RAWMIDI_SEQ=y
CONFIG_SND_OPL3_LIB_SEQ=y
CONFIG_SND_OPL4_LIB_SEQ=y
CONFIG_SND_SBAWE_SEQ=y
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_MPU401_UART=y
CONFIG_SND_OPL3_LIB=y
CONFIG_SND_OPL4_LIB=y
CONFIG_SND_AC97_CODEC=y
CONFIG_SND_DRIVERS=y
# CONFIG_SND_PCSP is not set
CONFIG_SND_DUMMY=y
CONFIG_SND_VIRMIDI=y
CONFIG_SND_SERIAL_U16550=y
CONFIG_SND_MPU401=y
# CONFIG_SND_AC97_POWER_SAVE is not set
CONFIG_SND_WSS_LIB=y
CONFIG_SND_SB_COMMON=y
CONFIG_SND_SB8_DSP=y
CONFIG_SND_SB16_DSP=y
CONFIG_SND_ISA=y
CONFIG_SND_ADLIB=y
CONFIG_SND_AD1816A=y
CONFIG_SND_AD1848=y
# CONFIG_SND_ALS100 is not set
# CONFIG_SND_AZT2320 is not set
CONFIG_SND_CMI8330=y
CONFIG_SND_CS4231=y
CONFIG_SND_CS4236=y
# CONFIG_SND_DT019X is not set
# CONFIG_SND_ES968 is not set
# CONFIG_SND_ES1688 is not set
CONFIG_SND_ES18XX=y
# CONFIG_SND_SC6000 is not set
CONFIG_SND_GUSCLASSIC=y
CONFIG_SND_GUSEXTREME=y
# CONFIG_SND_GUSMAX is not set
CONFIG_SND_INTERWAVE=y
CONFIG_SND_INTERWAVE_STB=y
# CONFIG_SND_OPL3SA2 is not set
# CONFIG_SND_OPTI92X_AD1848 is not set
CONFIG_SND_OPTI92X_CS4231=y
CONFIG_SND_OPTI93X=y
CONFIG_SND_MIRO=y
CONFIG_SND_SB8=y
CONFIG_SND_SB16=y
CONFIG_SND_SBAWE=y
# CONFIG_SND_SB16_CSP is not set
CONFIG_SND_SGALAXY=y
# CONFIG_SND_SSCAPE is not set
# CONFIG_SND_WAVEFRONT is not set
CONFIG_SND_MSND_PINNACLE=y
CONFIG_SND_MSND_CLASSIC=y
CONFIG_SND_PCI=y
CONFIG_SND_AD1889=y
CONFIG_SND_ALS300=y
CONFIG_SND_ALS4000=y
CONFIG_SND_ALI5451=y
# CONFIG_SND_ATIIXP is not set
CONFIG_SND_ATIIXP_MODEM=y
# CONFIG_SND_AU8810 is not set
CONFIG_SND_AU8820=y
CONFIG_SND_AU8830=y
CONFIG_SND_AW2=y
CONFIG_SND_AZT3328=y
# CONFIG_SND_BT87X is not set
CONFIG_SND_CA0106=y
CONFIG_SND_CMIPCI=y
CONFIG_SND_OXYGEN_LIB=y
CONFIG_SND_OXYGEN=y
CONFIG_SND_CS4281=y
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CS5530 is not set
# CONFIG_SND_CS5535AUDIO is not set
# CONFIG_SND_CTXFI is not set
CONFIG_SND_DARLA20=y
CONFIG_SND_GINA20=y
CONFIG_SND_LAYLA20=y
CONFIG_SND_DARLA24=y
CONFIG_SND_GINA24=y
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
CONFIG_SND_MIA=y
CONFIG_SND_ECHO3G=y
CONFIG_SND_INDIGO=y
CONFIG_SND_INDIGOIO=y
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
CONFIG_SND_EMU10K1X=y
CONFIG_SND_ENS1370=y
# CONFIG_SND_ENS1371 is not set
CONFIG_SND_ES1938=y
CONFIG_SND_ES1968=y
# CONFIG_SND_FM801 is not set
CONFIG_SND_HDA_INTEL=y
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_JACK=y
CONFIG_SND_HDA_PATCH_LOADER=y
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_ATIHDMI=y
# CONFIG_SND_HDA_CODEC_NVHDMI is not set
CONFIG_SND_HDA_CODEC_INTELHDMI=y
CONFIG_SND_HDA_ELD=y
# CONFIG_SND_HDA_CODEC_CIRRUS is not set
CONFIG_SND_HDA_CODEC_CONEXANT=y
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
CONFIG_SND_HDSP=y

#
# Don't forget to add built-in firmwares for HDSP driver
#
CONFIG_SND_HDSPM=y
CONFIG_SND_HIFIER=y
CONFIG_SND_ICE1712=y
CONFIG_SND_ICE1724=y
CONFIG_SND_INTEL8X0=y
CONFIG_SND_INTEL8X0M=y
CONFIG_SND_KORG1212=y
CONFIG_SND_LX6464ES=y
CONFIG_SND_MAESTRO3=y
CONFIG_SND_MIXART=y
# CONFIG_SND_NM256 is not set
CONFIG_SND_PCXHR=y
CONFIG_SND_RIPTIDE=y
# CONFIG_SND_RME32 is not set
CONFIG_SND_RME96=y
CONFIG_SND_RME9652=y
# CONFIG_SND_SIS7019 is not set
# CONFIG_SND_SONICVIBES is not set
CONFIG_SND_TRIDENT=y
CONFIG_SND_VIA82XX=y
# CONFIG_SND_VIA82XX_MODEM is not set
CONFIG_SND_VIRTUOSO=y
# CONFIG_SND_VX222 is not set
CONFIG_SND_YMFPCI=y
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_USB_USX2Y=y
CONFIG_SND_USB_CAIAQ=y
CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_USB_US122L=y
# CONFIG_SND_SOC is not set
# CONFIG_SOUND_PRIME is not set
CONFIG_AC97_BUS=y
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
CONFIG_HIDRAW=y

#
# USB Input Devices
#
CONFIG_USB_HID=y
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y

#
# Special HID drivers
#
CONFIG_HID_A4TECH=y
CONFIG_HID_APPLE=y
CONFIG_HID_BELKIN=y
CONFIG_HID_CHERRY=y
# CONFIG_HID_CHICONY is not set
CONFIG_HID_CYPRESS=y
CONFIG_HID_DRAGONRISE=y
CONFIG_DRAGONRISE_FF=y
# CONFIG_HID_EZKEY is not set
# CONFIG_HID_KYE is not set
CONFIG_HID_GYRATION=y
CONFIG_HID_TWINHAN=y
# CONFIG_HID_KENSINGTON is not set
# CONFIG_HID_LOGITECH is not set
CONFIG_HID_MICROSOFT=y
CONFIG_HID_MONTEREY=y
CONFIG_HID_NTRIG=y
CONFIG_HID_PANTHERLORD=y
CONFIG_PANTHERLORD_FF=y
CONFIG_HID_PETALYNX=y
# CONFIG_HID_SAMSUNG is not set
# CONFIG_HID_SONY is not set
CONFIG_HID_SUNPLUS=y
CONFIG_HID_GREENASIA=y
CONFIG_GREENASIA_FF=y
CONFIG_HID_SMARTJOYPLUS=y
CONFIG_SMARTJOYPLUS_FF=y
# CONFIG_HID_TOPSEED is not set
CONFIG_HID_THRUSTMASTER=y
CONFIG_THRUSTMASTER_FF=y
# CONFIG_HID_ZEROPLUS is not set
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=y
CONFIG_USB_DEBUG=y
# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set

#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
CONFIG_USB_DEVICE_CLASS=y
# CONFIG_USB_DYNAMIC_MINORS is not set
CONFIG_USB_SUSPEND=y
# CONFIG_USB_OTG is not set
CONFIG_USB_OTG_WHITELIST=y
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
CONFIG_USB_MON=y
CONFIG_USB_WUSB=y
CONFIG_USB_WUSB_CBAF=y
# CONFIG_USB_WUSB_CBAF_DEBUG is not set

#
# USB Host Controller Drivers
#
CONFIG_USB_C67X00_HCD=y
CONFIG_USB_XHCI_HCD=y
# CONFIG_USB_XHCI_HCD_DEBUGGING is not set
CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
CONFIG_USB_EHCI_TT_NEWSCHED=y
# CONFIG_USB_OXU210HP_HCD is not set
CONFIG_USB_ISP116X_HCD=y
CONFIG_USB_ISP1760_HCD=y
CONFIG_USB_ISP1362_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_SSB=y
# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=y
CONFIG_USB_U132_HCD=y
CONFIG_USB_SL811_HCD=y
CONFIG_USB_R8A66597_HCD=y
# CONFIG_USB_HWA_HCD is not set

#
# USB Device Class drivers
#
CONFIG_USB_ACM=y
CONFIG_USB_PRINTER=y
CONFIG_USB_WDM=y
CONFIG_USB_TMC=y

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
CONFIG_USB_STORAGE_DEBUG=y
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y
CONFIG_USB_STORAGE_USBAT=y
CONFIG_USB_STORAGE_SDDR09=y
# CONFIG_USB_STORAGE_SDDR55 is not set
CONFIG_USB_STORAGE_JUMPSHOT=y
CONFIG_USB_STORAGE_ALAUDA=y
# CONFIG_USB_STORAGE_ONETOUCH is not set
CONFIG_USB_STORAGE_KARMA=y
# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
CONFIG_USB_LIBUSUAL=y

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
CONFIG_USB_MICROTEK=y

#
# USB port drivers
#
CONFIG_USB_SERIAL=y
# CONFIG_USB_SERIAL_CONSOLE is not set
CONFIG_USB_EZUSB=y
CONFIG_USB_SERIAL_GENERIC=y
# CONFIG_USB_SERIAL_AIRCABLE is not set
CONFIG_USB_SERIAL_ARK3116=y
CONFIG_USB_SERIAL_BELKIN=y
# CONFIG_USB_SERIAL_CH341 is not set
CONFIG_USB_SERIAL_WHITEHEAT=y
# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
CONFIG_USB_SERIAL_CP210X=y
# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
# CONFIG_USB_SERIAL_EMPEG is not set
# CONFIG_USB_SERIAL_FTDI_SIO is not set
CONFIG_USB_SERIAL_FUNSOFT=y
# CONFIG_USB_SERIAL_VISOR is not set
CONFIG_USB_SERIAL_IPAQ=y
CONFIG_USB_SERIAL_IR=y
# CONFIG_USB_SERIAL_EDGEPORT is not set
CONFIG_USB_SERIAL_EDGEPORT_TI=y
CONFIG_USB_SERIAL_GARMIN=y
# CONFIG_USB_SERIAL_IPW is not set
# CONFIG_USB_SERIAL_IUU is not set
# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
# CONFIG_USB_SERIAL_KEYSPAN is not set
# CONFIG_USB_SERIAL_KLSI is not set
CONFIG_USB_SERIAL_KOBIL_SCT=y
CONFIG_USB_SERIAL_MCT_U232=y
CONFIG_USB_SERIAL_MOS7720=y
# CONFIG_USB_SERIAL_MOS7840 is not set
CONFIG_USB_SERIAL_MOTOROLA=y
CONFIG_USB_SERIAL_NAVMAN=y
CONFIG_USB_SERIAL_PL2303=y
# CONFIG_USB_SERIAL_OTI6858 is not set
CONFIG_USB_SERIAL_QUALCOMM=y
CONFIG_USB_SERIAL_SPCP8X5=y
# CONFIG_USB_SERIAL_HP4X is not set
CONFIG_USB_SERIAL_SAFE=y
CONFIG_USB_SERIAL_SAFE_PADDED=y
# CONFIG_USB_SERIAL_SIEMENS_MPI is not set
# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
# CONFIG_USB_SERIAL_SYMBOL is not set
CONFIG_USB_SERIAL_TI=y
# CONFIG_USB_SERIAL_CYBERJACK is not set
CONFIG_USB_SERIAL_XIRCOM=y
# CONFIG_USB_SERIAL_OPTION is not set
CONFIG_USB_SERIAL_OMNINET=y
CONFIG_USB_SERIAL_OPTICON=y
CONFIG_USB_SERIAL_DEBUG=y

#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
CONFIG_USB_EMI26=y
# CONFIG_USB_ADUTUX is not set
CONFIG_USB_SEVSEG=y
CONFIG_USB_RIO500=y
CONFIG_USB_LEGOTOWER=y
CONFIG_USB_LCD=y
CONFIG_USB_BERRY_CHARGE=y
CONFIG_USB_LED=y
CONFIG_USB_CYPRESS_CY7C63=y
CONFIG_USB_CYTHERM=y
CONFIG_USB_IDMOUSE=y
CONFIG_USB_FTDI_ELAN=y
CONFIG_USB_APPLEDISPLAY=y
CONFIG_USB_SISUSBVGA=y
# CONFIG_USB_SISUSBVGA_CON is not set
CONFIG_USB_LD=y
# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_IOWARRIOR is not set
# CONFIG_USB_TEST is not set
CONFIG_USB_ISIGHTFW=y
CONFIG_USB_VST=y
CONFIG_USB_ATM=y
# CONFIG_USB_SPEEDTOUCH is not set
# CONFIG_USB_CXACRU is not set
CONFIG_USB_UEAGLEATM=y
CONFIG_USB_XUSBATM=y

#
# OTG and related infrastructure
#
CONFIG_USB_OTG_UTILS=y
CONFIG_USB_GPIO_VBUS=y
# CONFIG_NOP_USB_XCEIV is not set
CONFIG_UWB=y
CONFIG_UWB_HWA=y
CONFIG_UWB_WHCI=y
# CONFIG_UWB_WLP is not set
CONFIG_UWB_I1480U=y
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set

#
# MMC/SD/SDIO Card Drivers
#
# CONFIG_MMC_BLOCK is not set
CONFIG_SDIO_UART=y
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_SDHCI=y
# CONFIG_MMC_SDHCI_PCI is not set
CONFIG_MMC_SDHCI_PLTFM=y
# CONFIG_MMC_WBSD is not set
# CONFIG_MMC_AT91 is not set
# CONFIG_MMC_ATMELMCI is not set
CONFIG_MMC_TIFM_SD=y
CONFIG_MMC_CB710=y
CONFIG_MMC_VIA_SDMMC=y
CONFIG_MEMSTICK=y
CONFIG_MEMSTICK_DEBUG=y

#
# MemoryStick drivers
#
CONFIG_MEMSTICK_UNSAFE_RESUME=y
# CONFIG_MSPRO_BLOCK is not set

#
# MemoryStick Host Controller Drivers
#
CONFIG_MEMSTICK_TIFM_MS=y
# CONFIG_MEMSTICK_JMICRON_38X is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y

#
# LED drivers
#
CONFIG_LEDS_ALIX2=y
CONFIG_LEDS_PCA9532=y
# CONFIG_LEDS_GPIO is not set
# CONFIG_LEDS_LP3944 is not set
# CONFIG_LEDS_CLEVO_MAIL is not set
CONFIG_LEDS_PCA955X=y
CONFIG_LEDS_DA903X=y
CONFIG_LEDS_BD2802=y

#
# LED Triggers
#
# CONFIG_LEDS_TRIGGERS is not set
CONFIG_ACCESSIBILITY=y
CONFIG_A11Y_BRAILLE_CONSOLE=y
CONFIG_INFINIBAND=y
CONFIG_INFINIBAND_USER_MAD=y
CONFIG_INFINIBAND_USER_ACCESS=y
CONFIG_INFINIBAND_USER_MEM=y
CONFIG_INFINIBAND_ADDR_TRANS=y
CONFIG_INFINIBAND_MTHCA=y
CONFIG_INFINIBAND_MTHCA_DEBUG=y
CONFIG_INFINIBAND_AMSO1100=y
CONFIG_INFINIBAND_AMSO1100_DEBUG=y
CONFIG_INFINIBAND_CXGB3=y
# CONFIG_INFINIBAND_CXGB3_DEBUG is not set
CONFIG_MLX4_INFINIBAND=y
# CONFIG_INFINIBAND_NES is not set
# CONFIG_INFINIBAND_IPOIB is not set
CONFIG_INFINIBAND_SRP=y
CONFIG_INFINIBAND_ISER=y
# CONFIG_EDAC is not set
# CONFIG_RTC_CLASS is not set
CONFIG_DMADEVICES=y

#
# DMA Devices
#
CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH=y
CONFIG_INTEL_IOATDMA=y
CONFIG_DMA_ENGINE=y

#
# DMA Clients
#
CONFIG_NET_DMA=y
CONFIG_ASYNC_TX_DMA=y
CONFIG_DMATEST=y
CONFIG_DCA=y
CONFIG_AUXDISPLAY=y
CONFIG_UIO=y
CONFIG_UIO_CIF=y
CONFIG_UIO_PDRV=y
CONFIG_UIO_PDRV_GENIRQ=y
# CONFIG_UIO_SMX is not set
CONFIG_UIO_AEC=y
CONFIG_UIO_SERCOS3=y
CONFIG_UIO_PCI_GENERIC=y

#
# TI VLYNQ
#
# CONFIG_STAGING is not set
CONFIG_X86_PLATFORM_DEVICES=y

#
# Firmware Drivers
#
CONFIG_EDD=y
CONFIG_EDD_OFF=y
# CONFIG_FIRMWARE_MEMMAP is not set
# CONFIG_DELL_RBU is not set
CONFIG_DCDBAS=y
CONFIG_DMIID=y
# CONFIG_ISCSI_IBFT_FIND is not set

#
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_POSIX_ACL is not set
CONFIG_EXT2_FS_SECURITY=y
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=y
# CONFIG_EXT4DEV_COMPAT is not set
CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
# CONFIG_EXT4_FS_SECURITY is not set
CONFIG_EXT4_DEBUG=y
CONFIG_JBD=y
CONFIG_JBD_DEBUG=y
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
CONFIG_FS_POSIX_ACL=y
# CONFIG_XFS_FS is not set
CONFIG_GFS2_FS=y
# CONFIG_GFS2_FS_LOCKING_DLM is not set
CONFIG_OCFS2_FS=y
CONFIG_OCFS2_FS_O2CB=y
# CONFIG_OCFS2_FS_USERSPACE_CLUSTER is not set
CONFIG_OCFS2_FS_STATS=y
CONFIG_OCFS2_DEBUG_MASKLOG=y
# CONFIG_OCFS2_DEBUG_FS is not set
# CONFIG_OCFS2_FS_POSIX_ACL is not set
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_NILFS2_FS=y
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
# CONFIG_INOTIFY is not set
# CONFIG_INOTIFY_USER is not set
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
CONFIG_PRINT_QUOTA_WARNING=y
CONFIG_QUOTA_TREE=y
CONFIG_QFMT_V1=y
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
CONFIG_AUTOFS_FS=y
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
# CONFIG_CUSE is not set

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_VMCORE=y
CONFIG_PROC_SYSCTL=y
# CONFIG_PROC_PAGE_MONITOR is not set
CONFIG_SYSFS=y
# CONFIG_TMPFS is not set
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
CONFIG_CONFIGFS_FS=y
CONFIG_MISC_FILESYSTEMS=y
# CONFIG_ADFS_FS is not set
CONFIG_AFFS_FS=y
CONFIG_ECRYPT_FS=y
CONFIG_HFS_FS=y
CONFIG_HFSPLUS_FS=y
# CONFIG_BEFS_FS is not set
CONFIG_BFS_FS=y
# CONFIG_EFS_FS is not set
CONFIG_CRAMFS=y
CONFIG_SQUASHFS=y
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
# CONFIG_VXFS_FS is not set
# CONFIG_MINIX_FS is not set
CONFIG_OMFS_FS=y
# CONFIG_HPFS_FS is not set
CONFIG_QNX4FS_FS=y
CONFIG_ROMFS_FS=y
CONFIG_ROMFS_BACKED_BY_BLOCK=y
# CONFIG_ROMFS_BACKED_BY_MTD is not set
# CONFIG_ROMFS_BACKED_BY_BOTH is not set
CONFIG_ROMFS_ON_BLOCK=y
# CONFIG_SYSV_FS is not set
CONFIG_UFS_FS=y
CONFIG_UFS_FS_WRITE=y
# CONFIG_UFS_DEBUG is not set
# CONFIG_EXOFS_FS is not set
CONFIG_NETWORK_FILESYSTEMS=y
# CONFIG_NFS_FS is not set
CONFIG_NFSD=y
# CONFIG_NFSD_V3 is not set
# CONFIG_NFSD_V4 is not set
CONFIG_LOCKD=y
CONFIG_EXPORTFS=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_SUNRPC_XPRT_RDMA=y
# CONFIG_RPCSEC_GSS_KRB5 is not set
CONFIG_RPCSEC_GSS_SPKM3=y
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
CONFIG_NCP_FS=y
# CONFIG_NCPFS_PACKET_SIGNING is not set
# CONFIG_NCPFS_IOCTL_LOCKING is not set
CONFIG_NCPFS_STRONG=y
CONFIG_NCPFS_NFS_NS=y
CONFIG_NCPFS_OS2_NS=y
# CONFIG_NCPFS_SMALLDOS is not set
CONFIG_NCPFS_NLS=y
# CONFIG_NCPFS_EXTRAS is not set
CONFIG_CODA_FS=y
CONFIG_AFS_FS=y
CONFIG_AFS_DEBUG=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
# CONFIG_ACORN_PARTITION is not set
# CONFIG_OSF_PARTITION is not set
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
# CONFIG_SOLARIS_X86_PARTITION is not set
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
CONFIG_LDM_DEBUG=y
CONFIG_SGI_PARTITION=y
# CONFIG_ULTRIX_PARTITION is not set
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_SYSV68_PARTITION=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_CODEPAGE_852=y
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
CONFIG_NLS_CODEPAGE_860=y
CONFIG_NLS_CODEPAGE_861=y
CONFIG_NLS_CODEPAGE_862=y
CONFIG_NLS_CODEPAGE_863=y
CONFIG_NLS_CODEPAGE_864=y
# CONFIG_NLS_CODEPAGE_865 is not set
CONFIG_NLS_CODEPAGE_866=y
CONFIG_NLS_CODEPAGE_869=y
CONFIG_NLS_CODEPAGE_936=y
CONFIG_NLS_CODEPAGE_950=y
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
CONFIG_NLS_CODEPAGE_874=y
CONFIG_NLS_ISO8859_8=y
CONFIG_NLS_CODEPAGE_1250=y
CONFIG_NLS_CODEPAGE_1251=y
CONFIG_NLS_ASCII=y
# CONFIG_NLS_ISO8859_1 is not set
CONFIG_NLS_ISO8859_2=y
# CONFIG_NLS_ISO8859_3 is not set
CONFIG_NLS_ISO8859_4=y
CONFIG_NLS_ISO8859_5=y
CONFIG_NLS_ISO8859_6=y
CONFIG_NLS_ISO8859_7=y
# CONFIG_NLS_ISO8859_9 is not set
CONFIG_NLS_ISO8859_13=y
CONFIG_NLS_ISO8859_14=y
# CONFIG_NLS_ISO8859_15 is not set
CONFIG_NLS_KOI8_R=y
CONFIG_NLS_KOI8_U=y
CONFIG_NLS_UTF8=y
CONFIG_DLM=y
CONFIG_DLM_DEBUG=y

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_PRINTK_TIME=y
# CONFIG_ALLOW_WARNINGS is not set
CONFIG_FRAME_WARN=1024
CONFIG_MAGIC_SYSRQ=y
CONFIG_STRIP_ASM_SYMS=y
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_SHIRQ=y
# CONFIG_DETECT_SOFTLOCKUP is not set
# CONFIG_DETECT_HUNG_TASK is not set
CONFIG_SCHED_DEBUG=y
CONFIG_SCHEDSTATS=y
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_SLUB_DEBUG_ON is not set
CONFIG_SLUB_STATS=y
CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=400
CONFIG_DEBUG_KMEMLEAK_TEST=y
# CONFIG_DEBUG_PREEMPT is not set
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_PI_LIST=y
# CONFIG_RT_MUTEX_TESTER is not set
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_PROVE_LOCKING=y
CONFIG_LOCKDEP=y
# CONFIG_LOCK_STAT is not set
CONFIG_DEBUG_LOCKDEP=y
CONFIG_TRACE_IRQFLAGS=y
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_HIGHMEM=y
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_INFO is not set
CONFIG_DEBUG_VM=y
# CONFIG_DEBUG_VIRTUAL is not set
# CONFIG_DEBUG_WRITECOUNT is not set
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_LIST=y
CONFIG_DEBUG_SG=y
CONFIG_DEBUG_NOTIFIERS=y
CONFIG_DEBUG_CREDENTIALS=y
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
CONFIG_BOOT_PRINTK_DELAY=y
CONFIG_RCU_TORTURE_TEST=y
CONFIG_RCU_TORTURE_TEST_RUNNABLE=y
CONFIG_RCU_CPU_STALL_DETECTOR=y
CONFIG_BACKTRACE_SELF_TEST=y
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
CONFIG_FAULT_INJECTION=y
CONFIG_FAILSLAB=y
CONFIG_FAIL_PAGE_ALLOC=y
CONFIG_FAIL_MAKE_REQUEST=y
CONFIG_FAIL_IO_TIMEOUT=y
# CONFIG_FAULT_INJECTION_DEBUG_FS is not set
CONFIG_LATENCYTOP=y
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FTRACE_NMI_ENTER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_TRACER_MAX_TRACE=y
CONFIG_RING_BUFFER=y
CONFIG_FTRACE_NMI_ENTER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_RING_BUFFER_ALLOW_SWAP=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y
CONFIG_IRQSOFF_TRACER=y
CONFIG_PREEMPT_TRACER=y
CONFIG_SYSPROF_TRACER=y
CONFIG_SCHED_TRACER=y
# CONFIG_FTRACE_SYSCALLS is not set
CONFIG_BOOT_TRACER=y
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
# CONFIG_PROFILE_ALL_BRANCHES is not set
CONFIG_POWER_TRACER=y
CONFIG_KSYM_TRACER=y
CONFIG_PROFILE_KSYM_TRACER=y
# CONFIG_STACK_TRACER is not set
CONFIG_KMEMTRACE=y
# CONFIG_WORKQUEUE_TRACER is not set
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_DYNAMIC_FTRACE=y
CONFIG_FUNCTION_PROFILER=y
CONFIG_FTRACE_MCOUNT_RECORD=y
# CONFIG_FTRACE_STARTUP_TEST is not set
CONFIG_MMIOTRACE=y
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
CONFIG_FIREWIRE_OHCI_REMOTE_DMA=y
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DMA_API_DEBUG=y
CONFIG_SAMPLES=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_KGDB=y
# CONFIG_KGDB_SERIAL_CONSOLE is not set
CONFIG_KGDB_TESTS=y
# CONFIG_KGDB_TESTS_ON_BOOT is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
CONFIG_STRICT_DEVMEM=y
CONFIG_X86_VERBOSE_BOOTUP=y
CONFIG_EARLY_PRINTK=y
# CONFIG_EARLY_PRINTK_DBGP is not set
# CONFIG_DEBUG_STACKOVERFLOW is not set
CONFIG_DEBUG_STACK_USAGE=y
# CONFIG_DEBUG_PER_CPU_MAPS is not set
# CONFIG_X86_PTDUMP is not set
# CONFIG_DEBUG_RODATA is not set
# CONFIG_4KSTACKS is not set
CONFIG_DOUBLEFAULT=y
CONFIG_IOMMU_STRESS=y
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
# CONFIG_IO_DELAY_0X80 is not set
# CONFIG_IO_DELAY_0XED is not set
CONFIG_IO_DELAY_UDELAY=y
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=2
CONFIG_DEBUG_BOOT_PARAMS=y
CONFIG_CPA_DEBUG=y
CONFIG_OPTIMIZE_INLINING=y

#
# Security options
#
CONFIG_KEYS=y
CONFIG_KEYS_DEBUG_PROC_KEYS=y
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
# CONFIG_SECURITY_NETWORK_XFRM is not set
CONFIG_SECURITY_PATH=y
CONFIG_SECURITY_FILE_CAPABILITIES=y
# CONFIG_SECURITY_ROOTPLUG is not set
CONFIG_SECURITY_TOMOYO=y
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_GF128MUL=y
# CONFIG_CRYPTO_NULL is not set
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=y
CONFIG_CRYPTO_AUTHENC=y

#
# Authenticated Encryption with Associated Data
#
CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_SEQIV=y

#
# Block modes
#
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_CTS=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_LRW=y
CONFIG_CRYPTO_PCBC=y
# CONFIG_CRYPTO_XTS is not set

#
# Hash modes
#
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_XCBC=y
CONFIG_CRYPTO_VMAC=y

#
# Digest
#
CONFIG_CRYPTO_CRC32C=y
# CONFIG_CRYPTO_CRC32C_INTEL is not set
CONFIG_CRYPTO_GHASH=y
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=y
CONFIG_CRYPTO_RMD128=y
CONFIG_CRYPTO_RMD160=y
CONFIG_CRYPTO_RMD256=y
CONFIG_CRYPTO_RMD320=y
CONFIG_CRYPTO_SHA1=y
# CONFIG_CRYPTO_SHA256 is not set
CONFIG_CRYPTO_SHA512=y
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set

#
# Ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_586=y
# CONFIG_CRYPTO_ANUBIS is not set
CONFIG_CRYPTO_ARC4=y
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_CAMELLIA is not set
CONFIG_CRYPTO_CAST5=y
CONFIG_CRYPTO_CAST6=y
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_FCRYPT=y
CONFIG_CRYPTO_KHAZAD=y
# CONFIG_CRYPTO_SALSA20 is not set
CONFIG_CRYPTO_SALSA20_586=y
CONFIG_CRYPTO_SEED=y
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_TEA is not set
CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_TWOFISH_COMMON=y
# CONFIG_CRYPTO_TWOFISH_586 is not set

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_ZLIB=y
CONFIG_CRYPTO_LZO=y

#
# Random Number Generation
#
# CONFIG_CRYPTO_ANSI_CPRNG is not set
# CONFIG_CRYPTO_HW is not set
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_APIC_ARCHITECTURE=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
CONFIG_KVM_INTEL=y
# CONFIG_KVM_AMD is not set
CONFIG_LGUEST=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_RING=y
# CONFIG_VIRTIO_PCI is not set
CONFIG_VIRTIO_BALLOON=y
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_GENERIC_FIND_LAST_BIT=y
CONFIG_CRC_CCITT=y
CONFIG_CRC16=y
# CONFIG_CRC_T10DIF is not set
CONFIG_CRC_ITU_T=y
CONFIG_CRC32=y
# CONFIG_CRC7 is not set
CONFIG_LIBCRC32C=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_TEXTSEARCH=y
CONFIG_TEXTSEARCH_KMP=y
CONFIG_TEXTSEARCH_BM=y
CONFIG_TEXTSEARCH_FSM=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_CHECK_SIGNATURE=y
CONFIG_NLATTR=y

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

* Re: Linux 2.6.32-rc1
  2009-09-30 19:32                   ` Ingo Molnar
@ 2009-09-30 19:35                     ` Ingo Molnar
  2009-09-30 20:16                     ` Eric Dumazet
  1 sibling, 0 replies; 79+ messages in thread
From: Ingo Molnar @ 2009-09-30 19:35 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Linus Torvalds, Eric Dumazet, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra


* Ingo Molnar <mingo@elte.hu> wrote:

> >  4 files changed, 81 insertions(+), 14 deletions(-)
> >  create mode 100644 arch/x86/lib/cmpxchg8b_emu.S
> 
> The two patches cause hangs on 32-bit, in sched_clock_cpu(). I 
> attached the hang serial log plus the two patches as i applied them.
> 
> Bug in cmpxchg8b_emu()?

... on this CPU we should be using CMPXCHG8B so cmpxchg8b_emu() shouldnt 
be called.

	Ingo

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

* [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64()
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (3 preceding siblings ...)
  2009-09-30 19:32                   ` Ingo Molnar
@ 2009-09-30 19:37                   ` tip-bot for Arjan van de Ven
  2009-09-30 19:37                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Arjan van de Ven
                                     ` (8 subsequent siblings)
  13 siblings, 0 replies; 79+ messages in thread
From: tip-bot for Arjan van de Ven @ 2009-09-30 19:37 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, eric.dumazet, a.p.zijlstra, johnstul,
	torvalds, arjan, schwidefsky, arjan, tglx, mingo

Commit-ID:  8da752098d4e584fbcc149046e5c716f5d356db4
Gitweb:     http://git.kernel.org/tip/8da752098d4e584fbcc149046e5c716f5d356db4
Author:     Arjan van de Ven <arjan@infradead.org>
AuthorDate: Wed, 30 Sep 2009 17:07:54 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 30 Sep 2009 20:58:26 +0200

x86: Provide an alternative() based cmpxchg64()

cmpxchg64() today generates, to quote Linus, "barf bag" code.

cmpxchg64() is about to get used in the scheduler to a bug there,
but it's a prerequisite that cmpxchg64() first be made non-sucking.

This patch turns cmpxchg64() into an efficient implementation that
uses the alternative() mechanism to just use the raw instruction on
all modern systens

Note: the fallback is NOT smp safe, just like the current fallback
is not SMP safe. (Interested parties with i486 based SMP systems
are welcome to submit fix patches for that.)

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090930170754.0886ff2e@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/include/asm/cmpxchg_32.h |   29 ++++++++++--------
 arch/x86/kernel/i386_ksyms_32.c   |    8 +++++
 arch/x86/lib/Makefile             |    2 +-
 arch/x86/lib/cmpxchg8b_emu.S      |   61 +++++++++++++++++++++++++++++++++++++
 4 files changed, 86 insertions(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index 82ceb78..3b21afa 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -312,19 +312,22 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
 
 extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
 
-#define cmpxchg64(ptr, o, n)						\
-({									\
-	__typeof__(*(ptr)) __ret;					\
-	if (likely(boot_cpu_data.x86 > 4))				\
-		__ret = (__typeof__(*(ptr)))__cmpxchg64((ptr),		\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	else								\
-		__ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr),	\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	__ret;								\
-})
+#define cmpxchg64(ptr, o, n)					\
+({								\
+	__typeof__(*(ptr)) __ret;				\
+	__typeof__(*(ptr)) __old = (o);				\
+	__typeof__(*(ptr)) __new = (n);				\
+	alternative_io("call cmpxchg8b_emu",			\
+			"lock; cmpxchg8b (%%esi)" ,		\
+		       X86_FEATURE_CX8,				\
+		       "=A" (__ret),				\
+		       "S" ((ptr)), "0" (__old),		\
+		       "b" ((unsigned int)__new),		\
+		       "c" ((unsigned int)(__new>>32)));	\
+	__ret; })
+
+
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	__typeof__(*(ptr)) __ret;					\
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 43cec6b..1736c5a 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -10,6 +10,14 @@
 EXPORT_SYMBOL(mcount);
 #endif
 
+/*
+ * Note, this is a prototype to get at the symbol for
+ * the export, but dont use it from C code, it is used
+ * by assembly code and is not using C calling convention!
+ */
+extern void cmpxchg8b_emu(void);
+EXPORT_SYMBOL(cmpxchg8b_emu);
+
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_generic);
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 9e60920..3e549b8 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -15,7 +15,7 @@ ifeq ($(CONFIG_X86_32),y)
         obj-y += atomic64_32.o
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += semaphore_32.o string_32.o
+        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
 
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S
new file mode 100644
index 0000000..b8af4c7
--- /dev/null
+++ b/arch/x86/lib/cmpxchg8b_emu.S
@@ -0,0 +1,61 @@
+/*
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; version 2
+ *	of the License.
+ *
+ */
+
+#include <linux/linkage.h>
+#include <asm/alternative-asm.h>
+#include <asm/frame.h>
+#include <asm/dwarf2.h>
+
+
+.text
+
+/*
+ * Inputs:
+ * %esi : memory location to compare
+ * %eax : low 32 bits of old value
+ * %edx : high 32 bits of old value
+ * %ebx : low 32 bits of new value
+ * %ecx : high 32 bits of new value
+ */
+ENTRY(cmpxchg8b_emu)
+	CFI_STARTPROC
+
+	push %edi
+	push %ebx
+	push %ecx
+	/* disable interrupts */
+	pushf
+	pop %edi
+	cli
+
+	cmpl %edx, 4(%esi)
+	jne 1f
+	cmpl %eax, (%esi)
+	jne 1f
+
+	xchg (%esi), %ebx
+	xchg 4(%esi), %ecx
+	mov %ebx, %eax
+	mov %ecx, %edx
+
+2:
+	/* restore interrupts */
+	push %edi
+	popf
+
+	pop %ecx
+	pop %ebx
+	pop %edi
+	ret
+1:
+	mov (%esi), %eax
+	mov 4(%esi), %edx
+	jmp 2b
+	CFI_ENDPROC
+ENDPROC(cmpxchg8b_emu)
+

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

* [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64()
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (4 preceding siblings ...)
  2009-09-30 19:37                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
@ 2009-09-30 19:37                   ` tip-bot for Arjan van de Ven
  2009-09-30 19:39                     ` Ingo Molnar
  2009-09-30 19:39                   ` tip-bot for Eric Dumazet
                                     ` (7 subsequent siblings)
  13 siblings, 1 reply; 79+ messages in thread
From: tip-bot for Arjan van de Ven @ 2009-09-30 19:37 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, eric.dumazet, a.p.zijlstra, johnstul,
	torvalds, arjan, schwidefsky, arjan, tglx, mingo

Commit-ID:  1cb9955464ad248c79c48e9c8be6669020fe178c
Gitweb:     http://git.kernel.org/tip/1cb9955464ad248c79c48e9c8be6669020fe178c
Author:     Arjan van de Ven <arjan@infradead.org>
AuthorDate: Wed, 30 Sep 2009 20:36:19 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 30 Sep 2009 20:58:27 +0200

sched_clock: Fix atomicity/continuity bug by using cmpxchg64()

Commit def0a9b2573 (sched_clock: Make it NMI safe) assumed
cmpxchg() of 64bit values was available on X86_32.

That is not so - and causes some subtle scheduler misbehavior due
to incorrect timestamps off to up by ~4 seconds.

Two symptoms are known right now:

 - interactivity problems seen by Arjan: up to 600 msecs
   latencies instead of the expected 20-40 msecs. These
   latencies are very visible on the desktop.

 - incorrect CPU stats: occasionally too high percentages in 'top',
   and crazy CPU usage stats.

Reported-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090930170754.0886ff2e@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/sched_clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index ac2e1dc..479ce56 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -127,7 +127,7 @@ again:
 	clock = wrap_max(clock, min_clock);
 	clock = wrap_min(clock, max_clock);
 
-	if (cmpxchg(&scd->clock, old_clock, clock) != old_clock)
+	if (cmpxchg64(&scd->clock, old_clock, clock) != old_clock)
 		goto again;
 
 	return clock;
@@ -163,7 +163,7 @@ again:
 		val = remote_clock;
 	}
 
-	if (cmpxchg(ptr, old_val, val) != old_val)
+	if (cmpxchg64(ptr, old_val, val) != old_val)
 		goto again;
 
 	return val;

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

* Re: [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64()
  2009-09-30 19:37                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Arjan van de Ven
@ 2009-09-30 19:39                     ` Ingo Molnar
  0 siblings, 0 replies; 79+ messages in thread
From: Ingo Molnar @ 2009-09-30 19:39 UTC (permalink / raw)
  To: mingo, hpa, linux-kernel, eric.dumazet, arjan, torvalds,
	johnstul, a.p.zijlstra, schwidefsky, arjan, tglx
  Cc: linux-tip-commits


* tip-bot for Arjan van de Ven <arjan@infradead.org> wrote:

> Commit-ID:  1cb9955464ad248c79c48e9c8be6669020fe178c
> Gitweb:     http://git.kernel.org/tip/1cb9955464ad248c79c48e9c8be6669020fe178c
> Author:     Arjan van de Ven <arjan@infradead.org>

Note: i just fixed this to be Eric.

	Ingo

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

* [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64()
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (5 preceding siblings ...)
  2009-09-30 19:37                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Arjan van de Ven
@ 2009-09-30 19:39                   ` tip-bot for Eric Dumazet
  2009-09-30 20:19                   ` Linux 2.6.32-rc1 Linus Torvalds
                                     ` (6 subsequent siblings)
  13 siblings, 0 replies; 79+ messages in thread
From: tip-bot for Eric Dumazet @ 2009-09-30 19:39 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, eric.dumazet, a.p.zijlstra, johnstul,
	torvalds, arjan, schwidefsky, tglx, mingo

Commit-ID:  54f2adad1d808252110e3f494a5beb25a4fc7b84
Gitweb:     http://git.kernel.org/tip/54f2adad1d808252110e3f494a5beb25a4fc7b84
Author:     Eric Dumazet <eric.dumazet@gmail.com>
AuthorDate: Wed, 30 Sep 2009 20:36:19 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 30 Sep 2009 21:37:58 +0200

sched_clock: Fix atomicity/continuity bug by using cmpxchg64()

Commit def0a9b2573 (sched_clock: Make it NMI safe) assumed
cmpxchg() of 64bit values was available on X86_32.

That is not so - and causes some subtle scheduler misbehavior due
to incorrect timestamps off to up by ~4 seconds.

Two symptoms are known right now:

 - interactivity problems seen by Arjan: up to 600 msecs
   latencies instead of the expected 20-40 msecs. These
   latencies are very visible on the desktop.

 - incorrect CPU stats: occasionally too high percentages in 'top',
   and crazy CPU usage stats.

Reported-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090930170754.0886ff2e@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/sched_clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index ac2e1dc..479ce56 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -127,7 +127,7 @@ again:
 	clock = wrap_max(clock, min_clock);
 	clock = wrap_min(clock, max_clock);
 
-	if (cmpxchg(&scd->clock, old_clock, clock) != old_clock)
+	if (cmpxchg64(&scd->clock, old_clock, clock) != old_clock)
 		goto again;
 
 	return clock;
@@ -163,7 +163,7 @@ again:
 		val = remote_clock;
 	}
 
-	if (cmpxchg(ptr, old_val, val) != old_val)
+	if (cmpxchg64(ptr, old_val, val) != old_val)
 		goto again;
 
 	return val;

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

* Re: Linux 2.6.32-rc1
  2009-09-30 19:32                   ` Ingo Molnar
  2009-09-30 19:35                     ` Ingo Molnar
@ 2009-09-30 20:16                     ` Eric Dumazet
  2009-09-30 20:20                       ` Linus Torvalds
  1 sibling, 1 reply; 79+ messages in thread
From: Eric Dumazet @ 2009-09-30 20:16 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arjan van de Ven, Linus Torvalds, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra

Ingo Molnar a écrit :
> * Arjan van de Ven <arjan@infradead.org> wrote:
> 
>> From 5a76986c5dd272ea16a9b8abb7349ff3d6791c2b Mon Sep 17 00:00:00 2001
>> From: Arjan van de Ven <arjan@linux.intel.com>
>> Date: Wed, 30 Sep 2009 17:04:35 +0200
>> Subject: [PATCH] x86: Provide an alternative() based cmpxchg64()
>>
>> Based on Linus' patch, this patch provides cmpxchg64() using
>> the alternative() infrastructure.
>>
>> Note: the fallback is NOT smp safe, just like the current fallback
>> is not SMP safe.
>>
>> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
>> ---
>>  arch/x86/include/asm/cmpxchg_32.h |   29 ++++++++++--------
>>  arch/x86/kernel/i386_ksyms_32.c   |    3 ++
>>  arch/x86/lib/Makefile             |    2 +-
>>  arch/x86/lib/cmpxchg8b_emu.S      |   61 +++++++++++++++++++++++++++++++++++++
>>  4 files changed, 81 insertions(+), 14 deletions(-)
>>  create mode 100644 arch/x86/lib/cmpxchg8b_emu.S
> 
> The two patches cause hangs on 32-bit, in sched_clock_cpu(). I attached 
> the hang serial log plus the two patches as i applied them. 
> 
> Bug in cmpxchg8b_emu()?
> 
> 	Ingo
> 
> [   45.800000] i2c-core: driver [tw9910] registered
> [   45.810000] initcall tw9910_module_init+0x0/0x2e returned 0 after 9765 usecs
> [   45.810000] BUG: spinlock lockup on CPU#1, swapper/1, 7be09ec0
> [   45.810000] Pid: 1, comm: swapper Tainted: G        W  2.6.32-rc2-tip-00990-g6139d57-dirty #19124
> [   45.810000] Call Trace:
> [   45.810000]  [<79ebce42>] ? printk+0x22/0x35
> [   45.810000]  [<794356c7>] _raw_spin_lock+0x103/0x13f
> [   45.810000]  [<79ebf84d>] _spin_lock+0x3c/0x55
> [   45.810000]  [<790673e0>] ? scheduler_tick+0x44/0x20e
> [   45.810000]  [<790673e0>] scheduler_tick+0x44/0x20e
> [   45.810000]  [<790793fc>] update_process_times+0x4a/0x68
> [   45.810000]  [<7909354c>] tick_periodic+0x7a/0x8d
> [   45.810000]  [<79093588>] tick_handle_periodic+0x29/0x91
> [   45.810000]  [<7909398f>] tick_do_broadcast+0x42/0x7d
> [   45.810000]  [<79093b17>] tick_do_periodic_broadcast+0x3c/0x59
> [   45.810000]  [<79093fb0>] tick_handle_periodic_broadcast+0x20/0x70
> [   45.810000]  [<7902fac1>] timer_interrupt+0x4d/0x85
> [   45.810000]  [<790ab402>] handle_IRQ_event+0x65/0x13b
> [   45.810000]  [<790ad1fc>] handle_edge_irq+0xbe/0x111
> [   45.810000]  [<7902f553>] handle_irq+0x2f/0x46
> [   45.810000]  [<7902ee8b>] do_IRQ+0x51/0xb8
> [   45.810000]  [<7902d435>] common_interrupt+0x35/0x40
> [   45.810000]  [<7906afe2>] ? vprintk+0x3a8/0x3fa
> [   45.810000]  [<79090020>] ? ntp_clear+0x22/0x7d
> [   45.810000]  [<79ebdf6c>] ? __mutex_unlock_slowpath+0x10e/0x12f
> [   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
> [   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
> [   45.810000]  [<79ebce42>] printk+0x22/0x35
> [   45.810000]  [<790010ed>] do_one_initcall+0xc4/0x183
> [   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
> [   45.810000]  [<7a562474>] do_basic_setup+0x50/0x72
> [   45.810000]  [<7a562509>] kernel_init+0x73/0xc5
> [   45.810000]  [<7a562496>] ? kernel_init+0x0/0xc5
> [   45.810000]  [<7902d997>] kernel_thread_helper+0x7/0x10
> [   45.810000] sending NMI to all CPUs:
> [   45.810000] NMI backtrace for cpu 1
> [   45.810000] 
> [   45.810000] Pid: 1, comm: swapper Tainted: G        W  (2.6.32-rc2-tip-00990-g6139d57-dirty #19124) System Product Name
> [   45.810000] EIP: 0060:[<79097b38>] EFLAGS: 00000046 CPU: 1
> [   45.810000] EIP is at trace_hardirqs_off_caller+0x3f/0xbd
> [   45.810000] EAX: 82f26dd9 EBX: b78c8000 ECX: 00000000 EDX: 790412fc
> [   45.810000] ESI: 790412fc EDI: 00000002 EBP: b78c3d10 ESP: b78c3d04
> [   45.810000]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
> [   45.810000] CR0: 8005003b CR2: 00000000 CR3: 02664000 CR4: 00000690
> [   45.810000] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
> [   45.810000] DR6: ffff0ff0 DR7: 00000400
> [   45.810000] Call Trace:
> [   45.810000]  [<79097bcf>] trace_hardirqs_off+0x19/0x2c
> [   45.810000]  [<790412fc>] default_send_IPI_mask_logical+0x8f/0xb1
> [   45.810000]  [<79041084>] default_send_IPI_all+0x35/0x87
> [   45.810000]  [<790416bc>] arch_trigger_all_cpu_backtrace+0x40/0x73
> [   45.810000]  [<794356cc>] _raw_spin_lock+0x108/0x13f
> [   45.810000]  [<79ebf84d>] _spin_lock+0x3c/0x55
> [   45.810000]  [<790673e0>] ? scheduler_tick+0x44/0x20e
> [   45.810000]  [<790673e0>] scheduler_tick+0x44/0x20e
> [   45.810000]  [<790793fc>] update_process_times+0x4a/0x68
> [   45.810000]  [<7909354c>] tick_periodic+0x7a/0x8d
> [   45.810000]  [<79093588>] tick_handle_periodic+0x29/0x91
> [   45.810000]  [<7909398f>] tick_do_broadcast+0x42/0x7d
> [   45.810000]  [<79093b17>] tick_do_periodic_broadcast+0x3c/0x59
> [   45.810000]  [<79093fb0>] tick_handle_periodic_broadcast+0x20/0x70
> [   45.810000]  [<7902fac1>] timer_interrupt+0x4d/0x85
> [   45.810000]  [<790ab402>] handle_IRQ_event+0x65/0x13b
> [   45.810000]  [<790ad1fc>] handle_edge_irq+0xbe/0x111
> [   45.810000]  [<7902f553>] handle_irq+0x2f/0x46
> [   45.810000]  [<7902ee8b>] do_IRQ+0x51/0xb8
> [   45.810000]  [<7902d435>] common_interrupt+0x35/0x40
> [   45.810000]  [<7906afe2>] ? vprintk+0x3a8/0x3fa
> [   45.810000]  [<79090020>] ? ntp_clear+0x22/0x7d
> [   45.810000]  [<79ebdf6c>] ? __mutex_unlock_slowpath+0x10e/0x12f
> [   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
> [   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
> [   45.810000]  [<79ebce42>] printk+0x22/0x35
> [   45.810000]  [<790010ed>] do_one_initcall+0xc4/0x183
> [   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
> [   45.810000]  [<7a562474>] do_basic_setup+0x50/0x72
> [   45.810000]  [<7a562509>] kernel_init+0x73/0xc5
> [   45.810000]  [<7a562496>] ? kernel_init+0x0/0xc5
> [   45.810000]  [<7902d997>] kernel_thread_helper+0x7/0x10
> [   45.810000] Pid: 1, comm: swapper Tainted: G        W  2.6.32-rc2-tip-00990-g6139d57-dirty #19124
> [   45.810000] Call Trace:
> [   45.810000]  [<7902bce1>] ? show_regs+0x34/0x4b
> [   45.810000]  [<7904188d>] nmi_watchdog_tick+0xa4/0x181
> [   45.810000]  [<7902e941>] default_do_nmi+0x64/0x21e
> [   45.810000]  [<790412fc>] ? default_send_IPI_mask_logical+0x8f/0xb1
> [   45.810000]  [<7902eb5d>] do_nmi+0x62/0xad
> [   45.810000]  [<79ec0080>] nmi_stack_correct+0x2f/0x34
> [   45.810000]  [<790412fc>] ? default_send_IPI_mask_logical+0x8f/0xb1
> [   45.810000]  [<790412fc>] ? default_send_IPI_mask_logical+0x8f/0xb1
> [   45.810000]  [<79097b38>] ? trace_hardirqs_off_caller+0x3f/0xbd
> [   45.810000]  [<79097bcf>] trace_hardirqs_off+0x19/0x2c
> [   45.810000]  [<790412fc>] default_send_IPI_mask_logical+0x8f/0xb1
> [   45.810000]  [<79041084>] default_send_IPI_all+0x35/0x87
> [   45.810000]  [<790416bc>] arch_trigger_all_cpu_backtrace+0x40/0x73
> [   45.810000]  [<794356cc>] _raw_spin_lock+0x108/0x13f
> [   45.810000]  [<79ebf84d>] _spin_lock+0x3c/0x55
> [   45.810000]  [<790673e0>] ? scheduler_tick+0x44/0x20e
> [   45.810000]  [<790673e0>] scheduler_tick+0x44/0x20e
> [   45.810000]  [<790793fc>] update_process_times+0x4a/0x68
> [   45.810000]  [<7909354c>] tick_periodic+0x7a/0x8d
> [   45.810000]  [<79093588>] tick_handle_periodic+0x29/0x91
> [   45.810000]  [<7909398f>] tick_do_broadcast+0x42/0x7d
> [   45.810000]  [<79093b17>] tick_do_periodic_broadcast+0x3c/0x59
> [   45.810000]  [<79093fb0>] tick_handle_periodic_broadcast+0x20/0x70
> [   45.810000]  [<7902fac1>] timer_interrupt+0x4d/0x85
> [   45.810000]  [<790ab402>] handle_IRQ_event+0x65/0x13b
> [   45.810000]  [<790ad1fc>] handle_edge_irq+0xbe/0x111
> [   45.810000]  [<7902f553>] handle_irq+0x2f/0x46
> [   45.810000]  [<7902ee8b>] do_IRQ+0x51/0xb8
> [   45.810000]  [<7902d435>] common_interrupt+0x35/0x40
> [   45.810000]  [<7906afe2>] ? vprintk+0x3a8/0x3fa
> [   45.810000]  [<79090020>] ? ntp_clear+0x22/0x7d
> [   45.810000]  [<79ebdf6c>] ? __mutex_unlock_slowpath+0x10e/0x12f
> [   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
> [   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
> [   45.810000]  [<79ebce42>] printk+0x22/0x35
> [   45.810000]  [<790010ed>] do_one_initcall+0xc4/0x183
> [   45.810000]  [<7a5ab658>] ? tw9910_module_init+0x0/0x2e
> [   45.810000]  [<7a562474>] do_basic_setup+0x50/0x72
> [   45.810000]  [<7a562509>] kernel_init+0x73/0xc5
> [   45.810000]  [<7a562496>] ? kernel_init+0x0/0xc5
> [   45.810000]  [<7902d997>] kernel_thread_helper+0x7/0x10
> [   45.810000] NMI backtrace for cpu 0
> [   45.810000] 
> [   45.810000] Pid: 0, comm: swapper Tainted: G        W  (2.6.32-rc2-tip-00990-g6139d57-dirty #19124) System Product Name
> [   45.810000] EIP: 0060:[<7908c649>] EFLAGS: 00000086 CPU: 0
> [   45.810000] EIP is at sched_clock_cpu+0x120/0x159
> [   45.810000] EAX: aa7d20b2 EBX: aa7d20b2 ECX: 0000000a EDX: 0000000a
> [   45.810000] ESI: 7be0a450 EDI: 00000001 EBP: 7a42de1c ESP: 7a42ddd8
> [   45.810000]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
> [   45.810000] CR0: 8005003b CR2: ffcff000 CR3: 02664000 CR4: 00000690
> [   45.810000] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
> [   45.810000] DR6: ffff0ff0 DR7: 00000400
> [   45.810000] Call Trace:
> [   45.810000]  [<7905f54b>] update_rq_clock+0x24/0x45
> [   45.810000]  [<7905f5d3>] double_rq_lock+0x67/0x7d
> [   45.810000]  [<79066bc4>] load_balance+0x116/0x355
> [   45.810000]  [<79098b07>] ? trace_hardirqs_on_caller+0x106/0x159
> [   45.810000]  [<79066ec6>] rebalance_domains+0xc3/0x134
> [   45.810000]  [<79066f78>] run_rebalance_domains+0x41/0xc2
> [   45.810000]  [<79071154>] __do_softirq+0xd2/0x1a0
> [   45.810000]  [<79071260>] do_softirq+0x3e/0x68
> [   45.810000]  [<79071423>] irq_exit+0x4b/0x9f
> [   45.810000]  [<790409e3>] smp_apic_timer_interrupt+0x81/0xa0
> [   45.810000]  [<7902d7f6>] apic_timer_interrupt+0x36/0x40
> [   45.810000]  [<7903377c>] ? test_ti_thread_flag+0x1/0x30
> [   45.810000]  [<79033878>] ? need_resched+0x27/0x42
> [   45.810000]  [<790338c2>] poll_idle+0x2f/0x76
> [   45.810000]  [<7902bd98>] cpu_idle+0xa0/0xd4
> [   45.810000]  [<79e2b392>] rest_init+0x7a/0x8d
> [   45.810000]  [<7a562ab2>] start_kernel+0x33a/0x350
> [   45.810000]  [<7a56209f>] i386_start_kernel+0x9f/0xb5
> [   45.810000] Pid: 0, comm: swapper Tainted: G        W  2.6.32-rc2-tip-00990-g6139d57-dirty #19124
> [   45.810000] Call Trace:
> [   45.810000]  [<7902bce1>] ? show_regs+0x34/0x4b
> [   45.810000]  [<7904188d>] nmi_watchdog_tick+0xa4/0x181
> [   45.810000]  [<7902e941>] default_do_nmi+0x64/0x21e
> [   45.810000]  [<7902eb5d>] do_nmi+0x62/0xad
> [   45.810000]  [<79ec0080>] nmi_stack_correct+0x2f/0x34
> [   45.810000]  [<7908c649>] ? sched_clock_cpu+0x120/0x159
> [   45.810000]  [<7905f54b>] update_rq_clock+0x24/0x45
> [   45.810000]  [<7905f5d3>] double_rq_lock+0x67/0x7d
> [   45.810000]  [<79066bc4>] load_balance+0x116/0x355
> [   45.810000]  [<79098b07>] ? trace_hardirqs_on_caller+0x106/0x159
> [   45.810000]  [<79066ec6>] rebalance_domains+0xc3/0x134
> [   45.810000]  [<79066f78>] run_rebalance_domains+0x41/0xc2
> [   45.810000]  [<79071154>] __do_softirq+0xd2/0x1a0
> [   45.810000]  [<79071260>] do_softirq+0x3e/0x68
> [   45.810000]  [<79071423>] irq_exit+0x4b/0x9f
> [   45.810000]  [<790409e3>] smp_apic_timer_interrupt+0x81/0xa0
> [   45.810000]  [<7902d7f6>] apic_timer_interrupt+0x36/0x40
> [   45.810000]  [<7903377c>] ? test_ti_thread_flag+0x1/0x30
> [   45.810000]  [<79033878>] ? need_resched+0x27/0x42
> [   45.810000]  [<790338c2>] poll_idle+0x2f/0x76
> [   45.810000]  [<7902bd98>] cpu_idle+0xa0/0xd4
> [   45.810000]  [<79e2b392>] rest_init+0x7a/0x8d
> [   45.810000]  [<7a562ab2>] start_kernel+0x33a/0x350
> [   45.810000]  [<7a56209f>] i386_start_kernel+0x9f/0xb5
> 
> commit 1cb9955464ad248c79c48e9c8be6669020fe178c
> Author: Arjan van de Ven <arjan@infradead.org>
> Date:   Wed Sep 30 20:36:19 2009 +0200
> 
>     sched_clock: Fix atomicity/continuity bug by using cmpxchg64()
>     
>     Commit def0a9b2573 (sched_clock: Make it NMI safe) assumed
>     cmpxchg() of 64bit values was available on X86_32.
>     
>     That is not so - and causes some subtle scheduler misbehavior due
>     to incorrect timestamps off to up by ~4 seconds.
>     
>     Two symptoms are known right now:
>     
>      - interactivity problems seen by Arjan: up to 600 msecs
>        latencies instead of the expected 20-40 msecs. These
>        latencies are very visible on the desktop.
>     
>      - incorrect CPU stats: occasionally too high percentages in 'top',
>        and crazy CPU usage stats.
>     
>     Reported-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
>     Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>     Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
>     Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
>     Cc: John Stultz <johnstul@us.ibm.com>
>     Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
>     LKML-Reference: <20090930170754.0886ff2e@infradead.org>
>     Signed-off-by: Ingo Molnar <mingo@elte.hu>
> 
> diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
> index ac2e1dc..479ce56 100644
> --- a/kernel/sched_clock.c
> +++ b/kernel/sched_clock.c
> @@ -127,7 +127,7 @@ again:
>  	clock = wrap_max(clock, min_clock);
>  	clock = wrap_min(clock, max_clock);
>  
> -	if (cmpxchg(&scd->clock, old_clock, clock) != old_clock)
> +	if (cmpxchg64(&scd->clock, old_clock, clock) != old_clock)
>  		goto again;
>  
>  	return clock;
> @@ -163,7 +163,7 @@ again:
>  		val = remote_clock;
>  	}
>  
> -	if (cmpxchg(ptr, old_val, val) != old_val)
> +	if (cmpxchg64(ptr, old_val, val) != old_val)
>  		goto again;
>  
>  	return val;
> 
> commit 8da752098d4e584fbcc149046e5c716f5d356db4
> Author: Arjan van de Ven <arjan@infradead.org>
> Date:   Wed Sep 30 17:07:54 2009 +0200
> 
>     x86: Provide an alternative() based cmpxchg64()
>     
>     cmpxchg64() today generates, to quote Linus, "barf bag" code.
>     
>     cmpxchg64() is about to get used in the scheduler to a bug there,
>     but it's a prerequisite that cmpxchg64() first be made non-sucking.
>     
>     This patch turns cmpxchg64() into an efficient implementation that
>     uses the alternative() mechanism to just use the raw instruction on
>     all modern systens
>     
>     Note: the fallback is NOT smp safe, just like the current fallback
>     is not SMP safe. (Interested parties with i486 based SMP systems
>     are welcome to submit fix patches for that.)
>     
>     Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
>     Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
>     Cc: Eric Dumazet <eric.dumazet@gmail.com>
>     Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
>     Cc: John Stultz <johnstul@us.ibm.com>
>     Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
>     LKML-Reference: <20090930170754.0886ff2e@infradead.org>
>     Signed-off-by: Ingo Molnar <mingo@elte.hu>
> 
> diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
> index 82ceb78..3b21afa 100644
> --- a/arch/x86/include/asm/cmpxchg_32.h
> +++ b/arch/x86/include/asm/cmpxchg_32.h
> @@ -312,19 +312,22 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
>  
>  extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
>  
> -#define cmpxchg64(ptr, o, n)						\
> -({									\
> -	__typeof__(*(ptr)) __ret;					\
> -	if (likely(boot_cpu_data.x86 > 4))				\
> -		__ret = (__typeof__(*(ptr)))__cmpxchg64((ptr),		\
> -				(unsigned long long)(o),		\
> -				(unsigned long long)(n));		\
> -	else								\
> -		__ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr),	\
> -				(unsigned long long)(o),		\
> -				(unsigned long long)(n));		\
> -	__ret;								\
> -})
> +#define cmpxchg64(ptr, o, n)					\
> +({								\
> +	__typeof__(*(ptr)) __ret;				\
> +	__typeof__(*(ptr)) __old = (o);				\
> +	__typeof__(*(ptr)) __new = (n);				\
> +	alternative_io("call cmpxchg8b_emu",			\
> +			"lock; cmpxchg8b (%%esi)" ,		\
> +		       X86_FEATURE_CX8,				\
> +		       "=A" (__ret),				\
> +		       "S" ((ptr)), "0" (__old),		\
> +		       "b" ((unsigned int)__new),		\
> +		       "c" ((unsigned int)(__new>>32)));	\

probably a "memory" clobber is needed, alternative_io() doesnt provide it.



> +	__ret; })
> +
> +
> +
>  #define cmpxchg64_local(ptr, o, n)					\
>  ({									\
>  	__typeof__(*(ptr)) __ret;					\
> diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
> index 43cec6b..1736c5a 100644
> --- a/arch/x86/kernel/i386_ksyms_32.c
> +++ b/arch/x86/kernel/i386_ksyms_32.c
> @@ -10,6 +10,14 @@
>  EXPORT_SYMBOL(mcount);
>  #endif
>  
> +/*
> + * Note, this is a prototype to get at the symbol for
> + * the export, but dont use it from C code, it is used
> + * by assembly code and is not using C calling convention!
> + */
> +extern void cmpxchg8b_emu(void);
> +EXPORT_SYMBOL(cmpxchg8b_emu);
> +
>  /* Networking helper routines. */
>  EXPORT_SYMBOL(csum_partial_copy_generic);
>  
> diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
> index 9e60920..3e549b8 100644
> --- a/arch/x86/lib/Makefile
> +++ b/arch/x86/lib/Makefile
> @@ -15,7 +15,7 @@ ifeq ($(CONFIG_X86_32),y)
>          obj-y += atomic64_32.o
>          lib-y += checksum_32.o
>          lib-y += strstr_32.o
> -        lib-y += semaphore_32.o string_32.o
> +        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
>  
>          lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
>  else
> diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S
> new file mode 100644
> index 0000000..b8af4c7
> --- /dev/null
> +++ b/arch/x86/lib/cmpxchg8b_emu.S
> @@ -0,0 +1,61 @@
> +/*
> + *	This program is free software; you can redistribute it and/or
> + *	modify it under the terms of the GNU General Public License
> + *	as published by the Free Software Foundation; version 2
> + *	of the License.
> + *
> + */
> +
> +#include <linux/linkage.h>
> +#include <asm/alternative-asm.h>
> +#include <asm/frame.h>
> +#include <asm/dwarf2.h>
> +
> +
> +.text
> +
> +/*
> + * Inputs:
> + * %esi : memory location to compare
> + * %eax : low 32 bits of old value
> + * %edx : high 32 bits of old value
> + * %ebx : low 32 bits of new value
> + * %ecx : high 32 bits of new value
> + */
> +ENTRY(cmpxchg8b_emu)
> +	CFI_STARTPROC
> +
> +	push %edi
> +	push %ebx
> +	push %ecx
> +	/* disable interrupts */
> +	pushf
> +	pop %edi
> +	cli
> +
> +	cmpl %edx, 4(%esi)
> +	jne 1f
> +	cmpl %eax, (%esi)
> +	jne 1f
> +
> +	xchg (%esi), %ebx
> +	xchg 4(%esi), %ecx
> +	mov %ebx, %eax
> +	mov %ecx, %edx
> +
> +2:
> +	/* restore interrupts */
> +	push %edi
> +	popf
> +
> +	pop %ecx
> +	pop %ebx
> +	pop %edi
> +	ret
> +1:
> +	mov (%esi), %eax
> +	mov 4(%esi), %edx
> +	jmp 2b
> +	CFI_ENDPROC
> +ENDPROC(cmpxchg8b_emu)
> +
> 


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

* Re: Linux 2.6.32-rc1
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (6 preceding siblings ...)
  2009-09-30 19:39                   ` tip-bot for Eric Dumazet
@ 2009-09-30 20:19                   ` Linus Torvalds
  2009-09-30 20:24                     ` Eric Dumazet
  2009-09-30 20:40                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
                                     ` (5 subsequent siblings)
  13 siblings, 1 reply; 79+ messages in thread
From: Linus Torvalds @ 2009-09-30 20:19 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Eric Dumazet, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar



On Wed, 30 Sep 2009, Arjan van de Ven wrote:
> +ENTRY(cmpxchg8b_emu)
> +	CFI_STARTPROC
> +
> +	push %edi
> +	push %ebx
> +	push %ecx
> +	/* disable interrupts */
> +	pushf
> +	pop %edi
> +	cli
> +
> +	cmpl %edx, 4(%esi)
> +	jne 1f
> +	cmpl %eax, (%esi)
> +	jne 1f
> +
> +	xchg (%esi), %ebx
> +	xchg 4(%esi), %ecx
> +	mov %ebx, %eax
> +	mov %ecx, %edx

Ok, so why do you do this? You've just checked that the 8 bytes at esi are 
the same as edx:eax, why do you do that odd xchg?

Why isn't this part just

	mov %ebx,(%esi)
	mov %ecx,4(%esi)

and leave ebx/ecx alone?

I also don't see why you play games with eflags and %edi. Just leave the 
flags on the stack. So it all would look like

	#
	# Emulate 'cmpxchg8b (%esi)' except we don't
	# set the whole ZF thing (caller will just
	# compare eax:edx with the expected value)
	#
	cmpxchg8b_emu:
		pushfl
		cli
		cmpl (%esi),%eax
		jne not_same
		cmpl 4(%esi),%edx
		jne not_same
		movl %ebx,(%esi)
		movl %ecx,4(%esi)
		popfl
		ret
	not_same:
		movl (%esi),%eax
		movl 4(%esi),%edx
		popfl
		ret

I dunno. You _could_ use edi/ebp as a temporary for 'dest' to only do the 
load once (and add push/pop to save the registers), but it's not like the 
above is really atomic anyway, and it very much depends on 'cli' just 
making sure that nothing else happens. So the above seems to be the 
simplest emulation, considering the interfaces..

UNTESTED! I wrote this in an email editor. I haven't assembled it or 
verified the semantics or workingness in any way, shape or form.

			Linus

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:16                     ` Eric Dumazet
@ 2009-09-30 20:20                       ` Linus Torvalds
  2009-09-30 20:22                         ` Ingo Molnar
  0 siblings, 1 reply; 79+ messages in thread
From: Linus Torvalds @ 2009-09-30 20:20 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Ingo Molnar, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra



On Wed, 30 Sep 2009, Eric Dumazet wrote:
> > +#define cmpxchg64(ptr, o, n)					\
> > +({								\
> > +	__typeof__(*(ptr)) __ret;				\
> > +	__typeof__(*(ptr)) __old = (o);				\
> > +	__typeof__(*(ptr)) __new = (n);				\
> > +	alternative_io("call cmpxchg8b_emu",			\
> > +			"lock; cmpxchg8b (%%esi)" ,		\
> > +		       X86_FEATURE_CX8,				\
> > +		       "=A" (__ret),				\
> > +		       "S" ((ptr)), "0" (__old),		\
> > +		       "b" ((unsigned int)__new),		\
> > +		       "c" ((unsigned int)(__new>>32)));	\
> 
> probably a "memory" clobber is needed, alternative_io() doesnt provide it.

Yeah, good catch.

			Linus

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:20                       ` Linus Torvalds
@ 2009-09-30 20:22                         ` Ingo Molnar
  2009-09-30 20:38                           ` Ingo Molnar
  0 siblings, 1 reply; 79+ messages in thread
From: Ingo Molnar @ 2009-09-30 20:22 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, 30 Sep 2009, Eric Dumazet wrote:
> > > +#define cmpxchg64(ptr, o, n)					\
> > > +({								\
> > > +	__typeof__(*(ptr)) __ret;				\
> > > +	__typeof__(*(ptr)) __old = (o);				\
> > > +	__typeof__(*(ptr)) __new = (n);				\
> > > +	alternative_io("call cmpxchg8b_emu",			\
> > > +			"lock; cmpxchg8b (%%esi)" ,		\
> > > +		       X86_FEATURE_CX8,				\
> > > +		       "=A" (__ret),				\
> > > +		       "S" ((ptr)), "0" (__old),		\
> > > +		       "b" ((unsigned int)__new),		\
> > > +		       "c" ((unsigned int)(__new>>32)));	\
> > 
> > probably a "memory" clobber is needed, alternative_io() doesnt provide it.
> 
> Yeah, good catch.

Yeah - i'm testing this right now, it looks like something that could 
explain the hang.

	Ingo

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:19                   ` Linux 2.6.32-rc1 Linus Torvalds
@ 2009-09-30 20:24                     ` Eric Dumazet
  2009-09-30 20:41                       ` Linus Torvalds
  0 siblings, 1 reply; 79+ messages in thread
From: Eric Dumazet @ 2009-09-30 20:24 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Arjan van de Ven, Martin Schwidefsky, Thomas Gleixner,
	John Stultz, Linux Kernel Mailing List, Peter Zijlstra,
	Ingo Molnar

Linus Torvalds a écrit :
> 
> On Wed, 30 Sep 2009, Arjan van de Ven wrote:
>> +ENTRY(cmpxchg8b_emu)
>> +	CFI_STARTPROC
>> +
>> +	push %edi
>> +	push %ebx
>> +	push %ecx
>> +	/* disable interrupts */
>> +	pushf
>> +	pop %edi
>> +	cli
>> +
>> +	cmpl %edx, 4(%esi)
>> +	jne 1f
>> +	cmpl %eax, (%esi)
>> +	jne 1f
>> +
>> +	xchg (%esi), %ebx
>> +	xchg 4(%esi), %ecx
>> +	mov %ebx, %eax
>> +	mov %ecx, %edx
> 
> Ok, so why do you do this? You've just checked that the 8 bytes at esi are 
> the same as edx:eax, why do you do that odd xchg?
> 
> Why isn't this part just
> 
> 	mov %ebx,(%esi)
> 	mov %ecx,4(%esi)
> 
> and leave ebx/ecx alone?
> 
> I also don't see why you play games with eflags and %edi. Just leave the 
> flags on the stack. So it all would look like
> 
> 	#
> 	# Emulate 'cmpxchg8b (%esi)' except we don't
> 	# set the whole ZF thing (caller will just
> 	# compare eax:edx with the expected value)
> 	#
> 	cmpxchg8b_emu:
> 		pushfl
> 		cli
> 		cmpl (%esi),%eax
> 		jne not_same
> 		cmpl 4(%esi),%edx
> 		jne not_same
> 		movl %ebx,(%esi)
> 		movl %ecx,4(%esi)
> 		popfl
> 		ret
> 	not_same:
> 		movl (%esi),%eax
> 		movl 4(%esi),%edx
> 		popfl
> 		ret
> 
> I dunno. You _could_ use edi/ebp as a temporary for 'dest' to only do the 
> load once (and add push/pop to save the registers), but it's not like the 
> above is really atomic anyway, and it very much depends on 'cli' just 
> making sure that nothing else happens. So the above seems to be the 
> simplest emulation, considering the interfaces..
> 
> UNTESTED! I wrote this in an email editor. I haven't assembled it or 
> verified the semantics or workingness in any way, shape or form.
> 
> 			Linus

Yes, I provided following version in my first answer but apparently it was too complex :)

ENTRY(cmpxchg8b_emu)
	CFI_STARTPROC

	/* disable interrupts */
	pushf
	cli

	cmpl  %eax,(%esi)
	jne   1f
	cmpl  %edx,4(%esi)
	jne   2f

	mov   %ebx,(%esi)
	mov   %ecx,4(%esi)

	/* restore interrupts */
	popf
	ret
1:
	mov (%esi), %eax
2:
	mov 4(%esi), %edx
	popf
	ret
	CFI_ENDPROC
ENDPROC(cmpxchg8b_emu)


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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:22                         ` Ingo Molnar
@ 2009-09-30 20:38                           ` Ingo Molnar
  2009-10-01  7:18                             ` Arjan van de Ven
  0 siblings, 1 reply; 79+ messages in thread
From: Ingo Molnar @ 2009-09-30 20:38 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra


* Ingo Molnar <mingo@elte.hu> wrote:

> * Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
> > On Wed, 30 Sep 2009, Eric Dumazet wrote:
> > > > +#define cmpxchg64(ptr, o, n)					\
> > > > +({								\
> > > > +	__typeof__(*(ptr)) __ret;				\
> > > > +	__typeof__(*(ptr)) __old = (o);				\
> > > > +	__typeof__(*(ptr)) __new = (n);				\
> > > > +	alternative_io("call cmpxchg8b_emu",			\
> > > > +			"lock; cmpxchg8b (%%esi)" ,		\
> > > > +		       X86_FEATURE_CX8,				\
> > > > +		       "=A" (__ret),				\
> > > > +		       "S" ((ptr)), "0" (__old),		\
> > > > +		       "b" ((unsigned int)__new),		\
> > > > +		       "c" ((unsigned int)(__new>>32)));	\
> > > 
> > > probably a "memory" clobber is needed, alternative_io() doesnt provide it.
> > 
> > Yeah, good catch.
> 
> Yeah - i'm testing this right now, it looks like something that could 
> explain the hang.

Yeah - that was the cause of the hang.

I've pushed out the updated patches - they should show up in this thread 
soon. I also updated the emulation implementation to your simpler 
variant. (will test that too)

	Ingo

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

* [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64()
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (7 preceding siblings ...)
  2009-09-30 20:19                   ` Linux 2.6.32-rc1 Linus Torvalds
@ 2009-09-30 20:40                   ` tip-bot for Arjan van de Ven
  2009-09-30 20:58                     ` Ingo Molnar
  2009-09-30 20:40                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Eric Dumazet
                                     ` (4 subsequent siblings)
  13 siblings, 1 reply; 79+ messages in thread
From: tip-bot for Arjan van de Ven @ 2009-09-30 20:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, eric.dumazet, a.p.zijlstra, johnstul,
	torvalds, arjan, schwidefsky, arjan, tglx, mingo

Commit-ID:  e87aaa7b6d80474ec07a2d2be3f50ef574ffe36c
Gitweb:     http://git.kernel.org/tip/e87aaa7b6d80474ec07a2d2be3f50ef574ffe36c
Author:     Arjan van de Ven <arjan@infradead.org>
AuthorDate: Wed, 30 Sep 2009 17:07:54 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 30 Sep 2009 22:35:44 +0200

x86: Provide an alternative() based cmpxchg64()

cmpxchg64() today generates, to quote Linus, "barf bag" code.

cmpxchg64() is about to get used in the scheduler to a bug there,
but it's a prerequisite that cmpxchg64() first be made non-sucking.

This patch turns cmpxchg64() into an efficient implementation that
uses the alternative() mechanism to just use the raw instruction on
all modern systens

Note: the fallback is NOT smp safe, just like the current fallback
is not SMP safe. (Interested parties with i486 based SMP systems
are welcome to submit fix patches for that.)

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
[ fixed asm constraint bug ]
Fixed-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090930170754.0886ff2e@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/include/asm/cmpxchg_32.h |   30 +++++++++++--------
 arch/x86/kernel/i386_ksyms_32.c   |    8 +++++
 arch/x86/lib/Makefile             |    2 +-
 arch/x86/lib/cmpxchg8b_emu.S      |   56 +++++++++++++++++++++++++++++++++++++
 4 files changed, 82 insertions(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index 82ceb78..ee1931b 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -312,19 +312,23 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
 
 extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
 
-#define cmpxchg64(ptr, o, n)						\
-({									\
-	__typeof__(*(ptr)) __ret;					\
-	if (likely(boot_cpu_data.x86 > 4))				\
-		__ret = (__typeof__(*(ptr)))__cmpxchg64((ptr),		\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	else								\
-		__ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr),	\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	__ret;								\
-})
+#define cmpxchg64(ptr, o, n)					\
+({								\
+	__typeof__(*(ptr)) __ret;				\
+	__typeof__(*(ptr)) __old = (o);				\
+	__typeof__(*(ptr)) __new = (n);				\
+	alternative_io("call cmpxchg8b_emu",			\
+			"lock; cmpxchg8b (%%esi)" ,		\
+		       X86_FEATURE_CX8,				\
+		       "=A" (__ret),				\
+		       "S" ((ptr)), "0" (__old),		\
+		       "b" ((unsigned int)__new),		\
+		       "c" ((unsigned int)(__new>>32))		\
+		       : "memory");				\
+	__ret; })
+
+
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	__typeof__(*(ptr)) __ret;					\
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 43cec6b..1736c5a 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -10,6 +10,14 @@
 EXPORT_SYMBOL(mcount);
 #endif
 
+/*
+ * Note, this is a prototype to get at the symbol for
+ * the export, but dont use it from C code, it is used
+ * by assembly code and is not using C calling convention!
+ */
+extern void cmpxchg8b_emu(void);
+EXPORT_SYMBOL(cmpxchg8b_emu);
+
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_generic);
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 9e60920..3e549b8 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -15,7 +15,7 @@ ifeq ($(CONFIG_X86_32),y)
         obj-y += atomic64_32.o
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += semaphore_32.o string_32.o
+        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
 
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S
new file mode 100644
index 0000000..0c5e5fa
--- /dev/null
+++ b/arch/x86/lib/cmpxchg8b_emu.S
@@ -0,0 +1,56 @@
+/*
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; version 2
+ *	of the License.
+ *
+ */
+
+#include <linux/linkage.h>
+#include <asm/alternative-asm.h>
+#include <asm/frame.h>
+#include <asm/dwarf2.h>
+
+
+.text
+
+/*
+ * Inputs:
+ * %esi : memory location to compare
+ * %eax : low 32 bits of old value
+ * %edx : high 32 bits of old value
+ * %ebx : low 32 bits of new value
+ * %ecx : high 32 bits of new value
+ */
+ENTRY(cmpxchg8b_emu)
+CFI_STARTPROC
+
+#
+# Emulate 'cmpxchg8b (%esi)' except we don't
+# set the whole ZF thing (caller will just
+# compare eax:edx with the expected value)
+#
+cmpxchg8b_emu:
+	pushfl
+	cli
+
+	cmpl  (%esi), %eax
+	jne not_same
+	cmpl 4(%esi), %edx
+	jne not_same
+
+	movl %ebx,  (%esi)
+	movl %ecx, 4(%esi)
+
+	popfl
+	ret
+
+ not_same:
+	movl  (%esi), %eax
+	movl 4(%esi), %edx
+
+	popfl
+	ret
+
+CFI_ENDPROC
+ENDPROC(cmpxchg8b_emu)

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

* [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64()
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (8 preceding siblings ...)
  2009-09-30 20:40                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
@ 2009-09-30 20:40                   ` tip-bot for Eric Dumazet
  2009-09-30 20:55                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
                                     ` (3 subsequent siblings)
  13 siblings, 0 replies; 79+ messages in thread
From: tip-bot for Eric Dumazet @ 2009-09-30 20:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, eric.dumazet, a.p.zijlstra, johnstul,
	torvalds, arjan, schwidefsky, tglx, mingo

Commit-ID:  623c4f89c47cca0088014388211d8bc0a5358f0a
Gitweb:     http://git.kernel.org/tip/623c4f89c47cca0088014388211d8bc0a5358f0a
Author:     Eric Dumazet <eric.dumazet@gmail.com>
AuthorDate: Wed, 30 Sep 2009 20:36:19 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 30 Sep 2009 22:36:12 +0200

sched_clock: Fix atomicity/continuity bug by using cmpxchg64()

Commit def0a9b2573 (sched_clock: Make it NMI safe) assumed
cmpxchg() of 64bit values was available on X86_32.

That is not so - and causes some subtle scheduler misbehavior due
to incorrect timestamps off to up by ~4 seconds.

Two symptoms are known right now:

 - interactivity problems seen by Arjan: up to 600 msecs
   latencies instead of the expected 20-40 msecs. These
   latencies are very visible on the desktop.

 - incorrect CPU stats: occasionally too high percentages in 'top',
   and crazy CPU usage stats.

Reported-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090930170754.0886ff2e@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/sched_clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index ac2e1dc..479ce56 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -127,7 +127,7 @@ again:
 	clock = wrap_max(clock, min_clock);
 	clock = wrap_min(clock, max_clock);
 
-	if (cmpxchg(&scd->clock, old_clock, clock) != old_clock)
+	if (cmpxchg64(&scd->clock, old_clock, clock) != old_clock)
 		goto again;
 
 	return clock;
@@ -163,7 +163,7 @@ again:
 		val = remote_clock;
 	}
 
-	if (cmpxchg(ptr, old_val, val) != old_val)
+	if (cmpxchg64(ptr, old_val, val) != old_val)
 		goto again;
 
 	return val;

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:24                     ` Eric Dumazet
@ 2009-09-30 20:41                       ` Linus Torvalds
  2009-09-30 20:49                         ` Ingo Molnar
                                           ` (3 more replies)
  0 siblings, 4 replies; 79+ messages in thread
From: Linus Torvalds @ 2009-09-30 20:41 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Arjan van de Ven, Martin Schwidefsky, Thomas Gleixner,
	John Stultz, Linux Kernel Mailing List, Peter Zijlstra,
	Ingo Molnar



On Wed, 30 Sep 2009, Eric Dumazet wrote:
> 
> Yes, I provided following version in my first answer but apparently it 
> was too complex :)

It wasn't too complex, but YOU QUOTED THE WHOL F*CKING EMAIL.

I don't know about anybody else, but if I see a couple of screenfuls of 
quotes, with no actual interesting new data, I just move on. I suspect 
everybody else did too. 

I really don't understand people who can't edit down their answer and only 
quote the relevant parts. It makes it impossible to read the reply, 
because it's hidden by all the old quoting.

Please spend the time to edit quoting levels, because otherwise people 
won't spend the time to look at your new text.

			Linus

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:41                       ` Linus Torvalds
@ 2009-09-30 20:49                         ` Ingo Molnar
  2009-09-30 20:53                           ` Eric Dumazet
  2009-09-30 20:54                         ` Linus Torvalds
                                           ` (2 subsequent siblings)
  3 siblings, 1 reply; 79+ messages in thread
From: Ingo Molnar @ 2009-09-30 20:49 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, 30 Sep 2009, Eric Dumazet wrote:
> > 
> > Yes, I provided following version in my first answer but apparently 
> > it was too complex :)
> 
> It wasn't too complex, but YOU QUOTED THE WHOL F*CKING EMAIL.
> 
> I don't know about anybody else, but if I see a couple of screenfuls 
> of quotes, with no actual interesting new data, I just move on. I 
> suspect everybody else did too.

Yeah, i too missed it while reading through the thread.

	Ingo

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:49                         ` Ingo Molnar
@ 2009-09-30 20:53                           ` Eric Dumazet
  2009-09-30 21:00                             ` Ingo Molnar
  0 siblings, 1 reply; 79+ messages in thread
From: Eric Dumazet @ 2009-09-30 20:53 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra

Ingo Molnar a écrit :
>> On Wed, 30 Sep 2009, Eric Dumazet wrote:
>>> Yes, I provided following version in my first answer but apparently 
>>> it was too complex :)
> 
> Yeah, i too missed it while reading through the thread.
> 
> 	Ingo

Well, I was refering to Arjan answer, not Linus/Ingo ones, and Arjan
did read my answer and said it was buggy... Its not a problem I
dont have 486 here anyway :)

You are all obviously right, I should more carefuly edit mails
before hit 'Envoyer' button.

Thanks

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:41                       ` Linus Torvalds
  2009-09-30 20:49                         ` Ingo Molnar
@ 2009-09-30 20:54                         ` Linus Torvalds
  2009-09-30 21:53                         ` David Miller
  2009-10-01 12:48                         ` Christoph Hellwig
  3 siblings, 0 replies; 79+ messages in thread
From: Linus Torvalds @ 2009-09-30 20:54 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Arjan van de Ven, Martin Schwidefsky, Thomas Gleixner,
	John Stultz, Linux Kernel Mailing List, Peter Zijlstra,
	Ingo Molnar



On Wed, 30 Sep 2009, Linus Torvalds wrote:
> 
> It wasn't too complex, but YOU QUOTED THE WHOL F*CKING EMAIL.

Sorry for shouting, but it's a pet peeve.

			Linus

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

* [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64()
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (9 preceding siblings ...)
  2009-09-30 20:40                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Eric Dumazet
@ 2009-09-30 20:55                   ` tip-bot for Arjan van de Ven
  2009-09-30 20:55                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Eric Dumazet
                                     ` (2 subsequent siblings)
  13 siblings, 0 replies; 79+ messages in thread
From: tip-bot for Arjan van de Ven @ 2009-09-30 20:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, eric.dumazet, a.p.zijlstra, johnstul,
	torvalds, arjan, schwidefsky, arjan, tglx, mingo

Commit-ID:  c2aaf6d1323b356d21ed71654a54c80c0c332756
Gitweb:     http://git.kernel.org/tip/c2aaf6d1323b356d21ed71654a54c80c0c332756
Author:     Arjan van de Ven <arjan@infradead.org>
AuthorDate: Wed, 30 Sep 2009 17:07:54 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 30 Sep 2009 22:51:08 +0200

x86: Provide an alternative() based cmpxchg64()

cmpxchg64() today generates, to quote Linus, "barf bag" code.

cmpxchg64() is about to get used in the scheduler to fix a bug there,
but it's a prerequisite that cmpxchg64() first be made non-sucking.

This patch turns cmpxchg64() into an efficient implementation that
uses the alternative() mechanism to just use the raw instruction on
all modern systems.

Note: the fallback is NOT smp safe, just like the current fallback
is not SMP safe. (Interested parties with i486 based SMP systems
are welcome to submit fix patches for that.)

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
[ fixed asm constraint bug ]
Fixed-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090930170754.0886ff2e@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/include/asm/cmpxchg_32.h |   30 +++++++++++--------
 arch/x86/kernel/i386_ksyms_32.c   |    8 +++++
 arch/x86/lib/Makefile             |    2 +-
 arch/x86/lib/cmpxchg8b_emu.S      |   56 +++++++++++++++++++++++++++++++++++++
 4 files changed, 82 insertions(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index 82ceb78..ee1931b 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -312,19 +312,23 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
 
 extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
 
-#define cmpxchg64(ptr, o, n)						\
-({									\
-	__typeof__(*(ptr)) __ret;					\
-	if (likely(boot_cpu_data.x86 > 4))				\
-		__ret = (__typeof__(*(ptr)))__cmpxchg64((ptr),		\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	else								\
-		__ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr),	\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	__ret;								\
-})
+#define cmpxchg64(ptr, o, n)					\
+({								\
+	__typeof__(*(ptr)) __ret;				\
+	__typeof__(*(ptr)) __old = (o);				\
+	__typeof__(*(ptr)) __new = (n);				\
+	alternative_io("call cmpxchg8b_emu",			\
+			"lock; cmpxchg8b (%%esi)" ,		\
+		       X86_FEATURE_CX8,				\
+		       "=A" (__ret),				\
+		       "S" ((ptr)), "0" (__old),		\
+		       "b" ((unsigned int)__new),		\
+		       "c" ((unsigned int)(__new>>32))		\
+		       : "memory");				\
+	__ret; })
+
+
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	__typeof__(*(ptr)) __ret;					\
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 43cec6b..1736c5a 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -10,6 +10,14 @@
 EXPORT_SYMBOL(mcount);
 #endif
 
+/*
+ * Note, this is a prototype to get at the symbol for
+ * the export, but dont use it from C code, it is used
+ * by assembly code and is not using C calling convention!
+ */
+extern void cmpxchg8b_emu(void);
+EXPORT_SYMBOL(cmpxchg8b_emu);
+
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_generic);
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 9e60920..3e549b8 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -15,7 +15,7 @@ ifeq ($(CONFIG_X86_32),y)
         obj-y += atomic64_32.o
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += semaphore_32.o string_32.o
+        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
 
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S
new file mode 100644
index 0000000..0c5e5fa
--- /dev/null
+++ b/arch/x86/lib/cmpxchg8b_emu.S
@@ -0,0 +1,56 @@
+/*
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; version 2
+ *	of the License.
+ *
+ */
+
+#include <linux/linkage.h>
+#include <asm/alternative-asm.h>
+#include <asm/frame.h>
+#include <asm/dwarf2.h>
+
+
+.text
+
+/*
+ * Inputs:
+ * %esi : memory location to compare
+ * %eax : low 32 bits of old value
+ * %edx : high 32 bits of old value
+ * %ebx : low 32 bits of new value
+ * %ecx : high 32 bits of new value
+ */
+ENTRY(cmpxchg8b_emu)
+CFI_STARTPROC
+
+#
+# Emulate 'cmpxchg8b (%esi)' except we don't
+# set the whole ZF thing (caller will just
+# compare eax:edx with the expected value)
+#
+cmpxchg8b_emu:
+	pushfl
+	cli
+
+	cmpl  (%esi), %eax
+	jne not_same
+	cmpl 4(%esi), %edx
+	jne not_same
+
+	movl %ebx,  (%esi)
+	movl %ecx, 4(%esi)
+
+	popfl
+	ret
+
+ not_same:
+	movl  (%esi), %eax
+	movl 4(%esi), %edx
+
+	popfl
+	ret
+
+CFI_ENDPROC
+ENDPROC(cmpxchg8b_emu)

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

* [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64()
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (10 preceding siblings ...)
  2009-09-30 20:55                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
@ 2009-09-30 20:55                   ` tip-bot for Eric Dumazet
  2009-09-30 21:00                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
  2009-09-30 21:01                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Eric Dumazet
  13 siblings, 0 replies; 79+ messages in thread
From: tip-bot for Eric Dumazet @ 2009-09-30 20:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, eric.dumazet, a.p.zijlstra, johnstul,
	torvalds, arjan, schwidefsky, tglx, mingo

Commit-ID:  c7eca501d2ac092f2f58452a6f962249e2ab5dbe
Gitweb:     http://git.kernel.org/tip/c7eca501d2ac092f2f58452a6f962249e2ab5dbe
Author:     Eric Dumazet <eric.dumazet@gmail.com>
AuthorDate: Wed, 30 Sep 2009 20:36:19 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 30 Sep 2009 22:51:51 +0200

sched_clock: Fix atomicity/continuity bug by using cmpxchg64()

Commit def0a9b2573 (sched_clock: Make it NMI safe) assumed
cmpxchg() of 64bit values was available on X86_32.

That is not so - and causes some subtle scheduler misbehavior due
to incorrect timestamps off to up by ~4 seconds.

Two symptoms are known right now:

 - interactivity problems seen by Arjan: up to 600 msecs
   latencies instead of the expected 20-40 msecs. These
   latencies are very visible on the desktop.

 - incorrect CPU stats: occasionally too high percentages in 'top',
   and crazy CPU usage stats.

Reported-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090930170754.0886ff2e@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/sched_clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index ac2e1dc..479ce56 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -127,7 +127,7 @@ again:
 	clock = wrap_max(clock, min_clock);
 	clock = wrap_min(clock, max_clock);
 
-	if (cmpxchg(&scd->clock, old_clock, clock) != old_clock)
+	if (cmpxchg64(&scd->clock, old_clock, clock) != old_clock)
 		goto again;
 
 	return clock;
@@ -163,7 +163,7 @@ again:
 		val = remote_clock;
 	}
 
-	if (cmpxchg(ptr, old_val, val) != old_val)
+	if (cmpxchg64(ptr, old_val, val) != old_val)
 		goto again;
 
 	return val;

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

* Re: [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64()
  2009-09-30 20:40                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
@ 2009-09-30 20:58                     ` Ingo Molnar
  0 siblings, 0 replies; 79+ messages in thread
From: Ingo Molnar @ 2009-09-30 20:58 UTC (permalink / raw)
  To: mingo, hpa, linux-kernel, eric.dumazet, arjan, torvalds,
	johnstul, a.p.zijlstra, schwidefsky, arjan, tglx
  Cc: linux-tip-commits


* tip-bot for Arjan van de Ven <arjan@infradead.org> wrote:

> Commit-ID:  e87aaa7b6d80474ec07a2d2be3f50ef574ffe36c
> Gitweb:     http://git.kernel.org/tip/e87aaa7b6d80474ec07a2d2be3f50ef574ffe36c
> Author:     Arjan van de Ven <arjan@infradead.org>
> AuthorDate: Wed, 30 Sep 2009 17:07:54 +0200
> Committer:  Ingo Molnar <mingo@elte.hu>
> CommitDate: Wed, 30 Sep 2009 22:35:44 +0200
> 
> x86: Provide an alternative() based cmpxchg64()
> 
> cmpxchg64() today generates, to quote Linus, "barf bag" code.
> 
> cmpxchg64() is about to get used in the scheduler to a bug there,
> but it's a prerequisite that cmpxchg64() first be made non-sucking.
> 
> This patch turns cmpxchg64() into an efficient implementation that
> uses the alternative() mechanism to just use the raw instruction on
> all modern systens

The changelog above has 3 typos so i fixed that. The push will generate 
the hopefully-final version of these patches.

Note, i slightly updated Linus's version of the old-CPU emu code with 
Eric's micro-optimization.

	Ingo

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:53                           ` Eric Dumazet
@ 2009-09-30 21:00                             ` Ingo Molnar
  0 siblings, 0 replies; 79+ messages in thread
From: Ingo Molnar @ 2009-09-30 21:00 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Linus Torvalds, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra


* Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Ingo Molnar a écrit :
> >> On Wed, 30 Sep 2009, Eric Dumazet wrote:
> >>> Yes, I provided following version in my first answer but apparently 
> >>> it was too complex :)
> > 
> > Yeah, i too missed it while reading through the thread.
> > 
> > 	Ingo
> 
> Well, I was refering to Arjan answer, not Linus/Ingo ones, and Arjan 
> did read my answer and said it was buggy... Its not a problem I dont 
> have 486 here anyway :)

I picked up the improvement that is in your version nevertheless. Even 
if it doesnt matter in practice we dont drop good code :)

> You are all obviously right, I should more carefuly edit mails before 
> hit 'Envoyer' button.

It happens. Since email on lkml is the precursor to real code, one 
should generally treat it with the same high level of taste you treat 
the final code with.

	Ingo

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

* [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64()
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (11 preceding siblings ...)
  2009-09-30 20:55                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Eric Dumazet
@ 2009-09-30 21:00                   ` tip-bot for Arjan van de Ven
  2009-09-30 21:01                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Eric Dumazet
  13 siblings, 0 replies; 79+ messages in thread
From: tip-bot for Arjan van de Ven @ 2009-09-30 21:00 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, eric.dumazet, a.p.zijlstra, johnstul,
	torvalds, arjan, schwidefsky, arjan, tglx, mingo

Commit-ID:  79e1dd05d1a22e95ab6d54d21836f478b3b56976
Gitweb:     http://git.kernel.org/tip/79e1dd05d1a22e95ab6d54d21836f478b3b56976
Author:     Arjan van de Ven <arjan@infradead.org>
AuthorDate: Wed, 30 Sep 2009 17:07:54 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 30 Sep 2009 22:55:59 +0200

x86: Provide an alternative() based cmpxchg64()

cmpxchg64() today generates, to quote Linus, "barf bag" code.

cmpxchg64() is about to get used in the scheduler to fix a bug there,
but it's a prerequisite that cmpxchg64() first be made non-sucking.

This patch turns cmpxchg64() into an efficient implementation that
uses the alternative() mechanism to just use the raw instruction on
all modern systems.

Note: the fallback is NOT smp safe, just like the current fallback
is not SMP safe. (Interested parties with i486 based SMP systems
are welcome to submit fix patches for that.)

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
[ fixed asm constraint bug ]
Fixed-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090930170754.0886ff2e@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/include/asm/cmpxchg_32.h |   30 +++++++++++--------
 arch/x86/kernel/i386_ksyms_32.c   |    8 +++++
 arch/x86/lib/Makefile             |    2 +-
 arch/x86/lib/cmpxchg8b_emu.S      |   57 +++++++++++++++++++++++++++++++++++++
 4 files changed, 83 insertions(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index 82ceb78..ee1931b 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -312,19 +312,23 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
 
 extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
 
-#define cmpxchg64(ptr, o, n)						\
-({									\
-	__typeof__(*(ptr)) __ret;					\
-	if (likely(boot_cpu_data.x86 > 4))				\
-		__ret = (__typeof__(*(ptr)))__cmpxchg64((ptr),		\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	else								\
-		__ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr),	\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	__ret;								\
-})
+#define cmpxchg64(ptr, o, n)					\
+({								\
+	__typeof__(*(ptr)) __ret;				\
+	__typeof__(*(ptr)) __old = (o);				\
+	__typeof__(*(ptr)) __new = (n);				\
+	alternative_io("call cmpxchg8b_emu",			\
+			"lock; cmpxchg8b (%%esi)" ,		\
+		       X86_FEATURE_CX8,				\
+		       "=A" (__ret),				\
+		       "S" ((ptr)), "0" (__old),		\
+		       "b" ((unsigned int)__new),		\
+		       "c" ((unsigned int)(__new>>32))		\
+		       : "memory");				\
+	__ret; })
+
+
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	__typeof__(*(ptr)) __ret;					\
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 43cec6b..1736c5a 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -10,6 +10,14 @@
 EXPORT_SYMBOL(mcount);
 #endif
 
+/*
+ * Note, this is a prototype to get at the symbol for
+ * the export, but dont use it from C code, it is used
+ * by assembly code and is not using C calling convention!
+ */
+extern void cmpxchg8b_emu(void);
+EXPORT_SYMBOL(cmpxchg8b_emu);
+
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_generic);
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 9e60920..3e549b8 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -15,7 +15,7 @@ ifeq ($(CONFIG_X86_32),y)
         obj-y += atomic64_32.o
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += semaphore_32.o string_32.o
+        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
 
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S
new file mode 100644
index 0000000..828cb71
--- /dev/null
+++ b/arch/x86/lib/cmpxchg8b_emu.S
@@ -0,0 +1,57 @@
+/*
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; version 2
+ *	of the License.
+ *
+ */
+
+#include <linux/linkage.h>
+#include <asm/alternative-asm.h>
+#include <asm/frame.h>
+#include <asm/dwarf2.h>
+
+
+.text
+
+/*
+ * Inputs:
+ * %esi : memory location to compare
+ * %eax : low 32 bits of old value
+ * %edx : high 32 bits of old value
+ * %ebx : low 32 bits of new value
+ * %ecx : high 32 bits of new value
+ */
+ENTRY(cmpxchg8b_emu)
+CFI_STARTPROC
+
+#
+# Emulate 'cmpxchg8b (%esi)' on UP except we don't
+# set the whole ZF thing (caller will just compare
+# eax:edx with the expected value)
+#
+cmpxchg8b_emu:
+	pushfl
+	cli
+
+	cmpl  (%esi), %eax
+	jne not_same
+	cmpl 4(%esi), %edx
+	jne half_same
+
+	movl %ebx,  (%esi)
+	movl %ecx, 4(%esi)
+
+	popfl
+	ret
+
+ not_same:
+	movl  (%esi), %eax
+ half_same:
+	movl 4(%esi), %edx
+
+	popfl
+	ret
+
+CFI_ENDPROC
+ENDPROC(cmpxchg8b_emu)

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

* [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64()
  2009-09-30 15:07                 ` Arjan van de Ven
                                     ` (12 preceding siblings ...)
  2009-09-30 21:00                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
@ 2009-09-30 21:01                   ` tip-bot for Eric Dumazet
  13 siblings, 0 replies; 79+ messages in thread
From: tip-bot for Eric Dumazet @ 2009-09-30 21:01 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, eric.dumazet, a.p.zijlstra, johnstul,
	torvalds, arjan, schwidefsky, tglx, mingo

Commit-ID:  152f9d0710a62708710161bce1b29fa8292c8c11
Gitweb:     http://git.kernel.org/tip/152f9d0710a62708710161bce1b29fa8292c8c11
Author:     Eric Dumazet <eric.dumazet@gmail.com>
AuthorDate: Wed, 30 Sep 2009 20:36:19 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 30 Sep 2009 22:56:10 +0200

sched_clock: Fix atomicity/continuity bug by using cmpxchg64()

Commit def0a9b2573 (sched_clock: Make it NMI safe) assumed
cmpxchg() of 64bit values was available on X86_32.

That is not so - and causes some subtle scheduler misbehavior due
to incorrect timestamps off to up by ~4 seconds.

Two symptoms are known right now:

 - interactivity problems seen by Arjan: up to 600 msecs
   latencies instead of the expected 20-40 msecs. These
   latencies are very visible on the desktop.

 - incorrect CPU stats: occasionally too high percentages in 'top',
   and crazy CPU usage stats.

Reported-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090930170754.0886ff2e@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/sched_clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index ac2e1dc..479ce56 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -127,7 +127,7 @@ again:
 	clock = wrap_max(clock, min_clock);
 	clock = wrap_min(clock, max_clock);
 
-	if (cmpxchg(&scd->clock, old_clock, clock) != old_clock)
+	if (cmpxchg64(&scd->clock, old_clock, clock) != old_clock)
 		goto again;
 
 	return clock;
@@ -163,7 +163,7 @@ again:
 		val = remote_clock;
 	}
 
-	if (cmpxchg(ptr, old_val, val) != old_val)
+	if (cmpxchg64(ptr, old_val, val) != old_val)
 		goto again;
 
 	return val;

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:41                       ` Linus Torvalds
  2009-09-30 20:49                         ` Ingo Molnar
  2009-09-30 20:54                         ` Linus Torvalds
@ 2009-09-30 21:53                         ` David Miller
  2009-10-01 12:48                         ` Christoph Hellwig
  3 siblings, 0 replies; 79+ messages in thread
From: David Miller @ 2009-09-30 21:53 UTC (permalink / raw)
  To: torvalds
  Cc: eric.dumazet, arjan, schwidefsky, tglx, johnstul, linux-kernel,
	a.p.zijlstra, mingo

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Wed, 30 Sep 2009 13:41:26 -0700 (PDT)

> Please spend the time to edit quoting levels, because otherwise people 
> won't spend the time to look at your new text.

Indeed, Eric, please do.  This has been bugging me in networking land
for quite some time as well.

If you notice, when I comment on patches I kill all of the patch from
the reply except for the specific hunks I want to comment on.

If one has to scroll multiple screens just to see what you have to
say, that's a burdon on every person who you might get feedback
from.

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

* [GIT PULL] scheduler fixes
  2009-09-30 18:53                       ` Ingo Molnar
@ 2009-09-30 22:03                         ` Ingo Molnar
  2009-10-01  0:42                           ` Linus Torvalds
  0 siblings, 1 reply; 79+ messages in thread
From: Ingo Molnar @ 2009-09-30 22:03 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra


* Ingo Molnar <mingo@elte.hu> wrote:

> * Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
> > Ingo - I suspect both those patches should just go through you. You 
> > do both x86 and scheduler, so I'll happily pull the end result.
> 
> Yeah - working on it - just got back from a trip. It's two risky 
> patches and if that place breaks everyone will be affected so i'll 
> probably send the pull request tomorrow.

Ok, it now looks good in all tests here so Linus please pull the latest 
sched-fixes-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git sched-fixes-for-linus

 Thanks,

	Ingo

------------------>
Arjan van de Ven (1):
      x86: Provide an alternative() based cmpxchg64()

Eric Dumazet (1):
      sched_clock: Fix atomicity/continuity bug by using cmpxchg64()


 arch/x86/include/asm/cmpxchg_32.h |   30 +++++++++++--------
 arch/x86/kernel/i386_ksyms_32.c   |    8 +++++
 arch/x86/lib/Makefile             |    2 +-
 arch/x86/lib/cmpxchg8b_emu.S      |   57 +++++++++++++++++++++++++++++++++++++
 kernel/sched_clock.c              |    4 +-
 5 files changed, 85 insertions(+), 16 deletions(-)
 create mode 100644 arch/x86/lib/cmpxchg8b_emu.S

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index 82ceb78..ee1931b 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -312,19 +312,23 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
 
 extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
 
-#define cmpxchg64(ptr, o, n)						\
-({									\
-	__typeof__(*(ptr)) __ret;					\
-	if (likely(boot_cpu_data.x86 > 4))				\
-		__ret = (__typeof__(*(ptr)))__cmpxchg64((ptr),		\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	else								\
-		__ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr),	\
-				(unsigned long long)(o),		\
-				(unsigned long long)(n));		\
-	__ret;								\
-})
+#define cmpxchg64(ptr, o, n)					\
+({								\
+	__typeof__(*(ptr)) __ret;				\
+	__typeof__(*(ptr)) __old = (o);				\
+	__typeof__(*(ptr)) __new = (n);				\
+	alternative_io("call cmpxchg8b_emu",			\
+			"lock; cmpxchg8b (%%esi)" ,		\
+		       X86_FEATURE_CX8,				\
+		       "=A" (__ret),				\
+		       "S" ((ptr)), "0" (__old),		\
+		       "b" ((unsigned int)__new),		\
+		       "c" ((unsigned int)(__new>>32))		\
+		       : "memory");				\
+	__ret; })
+
+
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	__typeof__(*(ptr)) __ret;					\
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 43cec6b..1736c5a 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -10,6 +10,14 @@
 EXPORT_SYMBOL(mcount);
 #endif
 
+/*
+ * Note, this is a prototype to get at the symbol for
+ * the export, but dont use it from C code, it is used
+ * by assembly code and is not using C calling convention!
+ */
+extern void cmpxchg8b_emu(void);
+EXPORT_SYMBOL(cmpxchg8b_emu);
+
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_generic);
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 9e60920..3e549b8 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -15,7 +15,7 @@ ifeq ($(CONFIG_X86_32),y)
         obj-y += atomic64_32.o
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += semaphore_32.o string_32.o
+        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
 
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S
new file mode 100644
index 0000000..828cb71
--- /dev/null
+++ b/arch/x86/lib/cmpxchg8b_emu.S
@@ -0,0 +1,57 @@
+/*
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; version 2
+ *	of the License.
+ *
+ */
+
+#include <linux/linkage.h>
+#include <asm/alternative-asm.h>
+#include <asm/frame.h>
+#include <asm/dwarf2.h>
+
+
+.text
+
+/*
+ * Inputs:
+ * %esi : memory location to compare
+ * %eax : low 32 bits of old value
+ * %edx : high 32 bits of old value
+ * %ebx : low 32 bits of new value
+ * %ecx : high 32 bits of new value
+ */
+ENTRY(cmpxchg8b_emu)
+CFI_STARTPROC
+
+#
+# Emulate 'cmpxchg8b (%esi)' on UP except we don't
+# set the whole ZF thing (caller will just compare
+# eax:edx with the expected value)
+#
+cmpxchg8b_emu:
+	pushfl
+	cli
+
+	cmpl  (%esi), %eax
+	jne not_same
+	cmpl 4(%esi), %edx
+	jne half_same
+
+	movl %ebx,  (%esi)
+	movl %ecx, 4(%esi)
+
+	popfl
+	ret
+
+ not_same:
+	movl  (%esi), %eax
+ half_same:
+	movl 4(%esi), %edx
+
+	popfl
+	ret
+
+CFI_ENDPROC
+ENDPROC(cmpxchg8b_emu)
diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index ac2e1dc..479ce56 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -127,7 +127,7 @@ again:
 	clock = wrap_max(clock, min_clock);
 	clock = wrap_min(clock, max_clock);
 
-	if (cmpxchg(&scd->clock, old_clock, clock) != old_clock)
+	if (cmpxchg64(&scd->clock, old_clock, clock) != old_clock)
 		goto again;
 
 	return clock;
@@ -163,7 +163,7 @@ again:
 		val = remote_clock;
 	}
 
-	if (cmpxchg(ptr, old_val, val) != old_val)
+	if (cmpxchg64(ptr, old_val, val) != old_val)
 		goto again;
 
 	return val;

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

* RE: Linux 2.6.32-rc1
  2009-09-30 15:31                     ` Arjan van de Ven
@ 2009-10-01  0:42                       ` Yuhong Bao
  0 siblings, 0 replies; 79+ messages in thread
From: Yuhong Bao @ 2009-10-01  0:42 UTC (permalink / raw)
  To: arjan, eric.dumazet
  Cc: Linus Torvalds, schwidefsky, tglx, johnstul, linux-kernel


 <20090930173102.2d54534c@infradead.org>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0




----------------------------------------
> Date: Wed=2C 30 Sep 2009 17:31:02 +0200
> From: arjan@infradead.org
> To: eric.dumazet@gmail.com
> CC: torvalds@linux-foundation.org=3B schwidefsky@de.ibm.com=3B tglx@linut=
ronix.de=3B johnstul@us.ibm.com=3B linux-kernel@vger.kernel.org=3B a.p.zijl=
stra@c
> Subject: Re: Linux 2.6.32-rc1
>
> On Wed=2C 30 Sep 2009 17:27:05 +0200
> Eric Dumazet  wrote:
>>
>>> + pop %edi
>> Why do you pop flags in edi=2C to later re-push them ?
>>
>>> + cli
>
> because here I disable interrupts
But popping the flags to edi to later repush them should not be necessary u=
nless you are switching esp.


Getting rid of this will allow the push/pop edi at the beginning/end to
be eliminated=2C reducing code size as well as increasing the speed.
> (basically this is local_irq_save() )
>>
>>
>>> + xchg (%esi)=2C %ebx
>>> + xchg 4(%esi)=2C %ecx
>> How this sequence is guaranteed to be atomic with other cpus ?
>
> it is not. this is the 486 implementation which is !SMP
> (just like the current cmpxchg64() fallback)



BTW=2C NT4 had a SMP version of this emulation that used a simple spinlock:
http://www.geoffchappell.com/viewer.htm?doc=3Dstudies/windows/km/cpu/cx8.ht=
m

Yuhong Bao
 		 	   		  =0A=
_________________________________________________________________=0A=
Insert movie times and more without leaving Hotmail=AE.=0A=
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=3DTXT_TAGLM_WL_HM_Tut=
orial_QuickAdd_062009=

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

* Re: [GIT PULL] scheduler fixes
  2009-09-30 22:03                         ` [GIT PULL] scheduler fixes Ingo Molnar
@ 2009-10-01  0:42                           ` Linus Torvalds
  2009-10-01  0:57                             ` Linus Torvalds
  2009-10-01  6:05                             ` Ingo Molnar
  0 siblings, 2 replies; 79+ messages in thread
From: Linus Torvalds @ 2009-10-01  0:42 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Eric Dumazet, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra



On Thu, 1 Oct 2009, Ingo Molnar wrote:
> 
> Ok, it now looks good in all tests here so Linus please pull the latest 
> sched-fixes-for-linus git tree from:
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git sched-fixes-for-linus

Pulled. I'd also like to see something that actually fails gracefully on 
cmpxchg() of an unsupported size, though. The silent failure still annoys 
me.

Big thanks to Eric for noticing it, it's that dangerous kind of "but it 
looks perfectly sane in C code" things.

			Linus

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

* Re: [GIT PULL] scheduler fixes
  2009-10-01  0:42                           ` Linus Torvalds
@ 2009-10-01  0:57                             ` Linus Torvalds
  2009-10-01  5:30                               ` Eric Dumazet
                                                 ` (2 more replies)
  2009-10-01  6:05                             ` Ingo Molnar
  1 sibling, 3 replies; 79+ messages in thread
From: Linus Torvalds @ 2009-10-01  0:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Eric Dumazet, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra



On Wed, 30 Sep 2009, Linus Torvalds wrote:
> 
> Pulled. I'd also like to see something that actually fails gracefully on 
> cmpxchg() of an unsupported size, though. The silent failure still annoys 
> me.

Oh, and we probably should try to avoid the 'alternates()' code when we 
can statically determine that cmpxchg8b is fine. We already have that 
CONFIG_x86_CMPXCHG64 (enabled by PAE support), and we could easily also 
enable it for some of the CPU cases.

[ If I recall correctly, cmpxchg8b support detection was something that 
  was totally messed up in WNT, and I have this memory of TMTA _not_ 
  claiming to support CX8 in the cpuid bits, but happily supporting the 
  instruction itself - because otherwise WNT would blue-screen on boot or 
  something silly like that.

  As a result, the patch below only adds CMPXCHG8B for the obvious Intel 
  CPU's, not for others. There was something really messy about cmpxchg8b 
  and clone CPU's, but I'm not 100% sure about the details, so take this 
  patch with a pinch of salt, and some thinking ]

If we avoid that asm-alternative thing when we can assume the instruction 
exists, we'll generate less support crud, and we'll avoid the whole issue 
with that extra 'nop' for padding instruction sizes etc.

			Linus

---
 arch/x86/Kconfig.cpu |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 527519b..f2824fb 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -400,7 +400,7 @@ config X86_TSC
 
 config X86_CMPXCHG64
 	def_bool y
-	depends on X86_PAE || X86_64
+	depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM
 
 # this should be set for all -march=.. options where the compiler
 # generates cmov.
@@ -412,6 +412,7 @@ config X86_MINIMUM_CPU_FAMILY
 	int
 	default "64" if X86_64
 	default "6" if X86_32 && X86_P6_NOP
+	default "5" if X86_32 && X86_CMPXCHG64
 	default "4" if X86_32 && (X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK)
 	default "3"
 



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

* Re: [GIT PULL] scheduler fixes
  2009-10-01  0:57                             ` Linus Torvalds
@ 2009-10-01  5:30                               ` Eric Dumazet
  2009-10-01  6:11                                 ` Ingo Molnar
  2009-10-01  6:49                                 ` [tip:x86/urgent] x86: Don't generate cmpxchg8b_emu if CONFIG_X86_CMPXCHG64=y tip-bot for Eric Dumazet
  2009-10-01  6:40                               ` [tip:x86/urgent] x86: Optimize cmpxchg64() at build-time some more tip-bot for Linus Torvalds
  2009-10-02 16:40                               ` [GIT PULL] scheduler fixes Yuhong Bao
  2 siblings, 2 replies; 79+ messages in thread
From: Eric Dumazet @ 2009-10-01  5:30 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra

Linus Torvalds a écrit :
> 
> On Wed, 30 Sep 2009, Linus Torvalds wrote:
> Oh, and we probably should try to avoid the 'alternates()' code when we 
> can statically determine that cmpxchg8b is fine. We already have that 
> CONFIG_x86_CMPXCHG64 (enabled by PAE support), and we could easily also 
> enable it for some of the CPU cases.
> 

Agreed.

Please find following patch to conditionaly compile cmpxchg8b_emu.o and
EXPORT_SYMBOL(cmpxchg8b_emu).

This patch doesnt depend on yours.

Thanks

[PATCH] x86: Dont generate cmpxchg8b_emu if CONFIG_X86_CMPXCHG64=y

cmpxchg8b_emu helper wont be used if CONFIG_X86_CMPXCHG64=y

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 arch/x86/kernel/i386_ksyms_32.c |    2 ++
 arch/x86/lib/Makefile           |    6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 1736c5a..9c3bd4a 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -15,8 +15,10 @@ EXPORT_SYMBOL(mcount);
  * the export, but dont use it from C code, it is used
  * by assembly code and is not using C calling convention!
  */
+#ifndef CONFIG_X86_CMPXCHG64
 extern void cmpxchg8b_emu(void);
 EXPORT_SYMBOL(cmpxchg8b_emu);
+#endif
 
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_generic);
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 3e549b8..c309b82 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -15,8 +15,10 @@ ifeq ($(CONFIG_X86_32),y)
         obj-y += atomic64_32.o
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
-
+        lib-y += semaphore_32.o string_32.o
+ifeq ($(CONFIG_X86_CMPXCHG64),n)
+        lib-y += cmpxchg8b_emu.o
+endif
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
         obj-y += io_64.o iomap_copy_64.o

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

* Re: [GIT PULL] scheduler fixes
  2009-10-01  0:42                           ` Linus Torvalds
  2009-10-01  0:57                             ` Linus Torvalds
@ 2009-10-01  6:05                             ` Ingo Molnar
  1 sibling, 0 replies; 79+ messages in thread
From: Ingo Molnar @ 2009-10-01  6:05 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: Eric Dumazet, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Thu, 1 Oct 2009, Ingo Molnar wrote:
> > 
> > Ok, it now looks good in all tests here so Linus please pull the latest 
> > sched-fixes-for-linus git tree from:
> > 
> >    git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git sched-fixes-for-linus
> 
> Pulled. I'd also like to see something that actually fails gracefully 
> on cmpxchg() of an unsupported size, though. The silent failure still 
> annoys me.

Yeah. It even works fine on 64-bit which makes it double dangerous.

	Ingo

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

* Re: [GIT PULL] scheduler fixes
  2009-10-01  5:30                               ` Eric Dumazet
@ 2009-10-01  6:11                                 ` Ingo Molnar
  2009-10-01  6:18                                   ` Eric Dumazet
  2009-10-01  6:49                                 ` [tip:x86/urgent] x86: Don't generate cmpxchg8b_emu if CONFIG_X86_CMPXCHG64=y tip-bot for Eric Dumazet
  1 sibling, 1 reply; 79+ messages in thread
From: Ingo Molnar @ 2009-10-01  6:11 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Linus Torvalds, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra


* Eric Dumazet <eric.dumazet@gmail.com> wrote:

> [PATCH] x86: Dont generate cmpxchg8b_emu if CONFIG_X86_CMPXCHG64=y
> 
> cmpxchg8b_emu helper wont be used if CONFIG_X86_CMPXCHG64=y
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
>  arch/x86/kernel/i386_ksyms_32.c |    2 ++
>  arch/x86/lib/Makefile           |    6 ++++--
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
> index 1736c5a..9c3bd4a 100644
> --- a/arch/x86/kernel/i386_ksyms_32.c
> +++ b/arch/x86/kernel/i386_ksyms_32.c
> @@ -15,8 +15,10 @@ EXPORT_SYMBOL(mcount);
>   * the export, but dont use it from C code, it is used
>   * by assembly code and is not using C calling convention!
>   */
> +#ifndef CONFIG_X86_CMPXCHG64
>  extern void cmpxchg8b_emu(void);
>  EXPORT_SYMBOL(cmpxchg8b_emu);
> +#endif
>  
>  /* Networking helper routines. */
>  EXPORT_SYMBOL(csum_partial_copy_generic);
> diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
> index 3e549b8..c309b82 100644
> --- a/arch/x86/lib/Makefile
> +++ b/arch/x86/lib/Makefile
> @@ -15,8 +15,10 @@ ifeq ($(CONFIG_X86_32),y)
>          obj-y += atomic64_32.o
>          lib-y += checksum_32.o
>          lib-y += strstr_32.o
> -        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
> -
> +        lib-y += semaphore_32.o string_32.o
> +ifeq ($(CONFIG_X86_CMPXCHG64),n)
> +        lib-y += cmpxchg8b_emu.o
> +endif
>          lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
>  else
>          obj-y += io_64.o iomap_copy_64.o

That's not enough - the inline assembly code in 
arch/x86/include/asm/cmpxchg_32.h should also not reference 
cmpxchg8b_emu in that case.

	Ingo

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

* Re: [GIT PULL] scheduler fixes
  2009-10-01  6:11                                 ` Ingo Molnar
@ 2009-10-01  6:18                                   ` Eric Dumazet
  2009-10-01  6:42                                     ` Ingo Molnar
  0 siblings, 1 reply; 79+ messages in thread
From: Eric Dumazet @ 2009-10-01  6:18 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra

Ingo Molnar a écrit :
> 
> That's not enough - the inline assembly code in 
> arch/x86/include/asm/cmpxchg_32.h should also not reference 
> cmpxchg8b_emu in that case.
> 

I believe it is OK as is, since cmpxchg8b_emu is referenced only
once, in a section guarded by :
#ifndef CONFIG_X86_CMPXCHG64

(But I'll re-check in a couple of hours)

extract from arch/x86/include/asm/cmpxchg_32.h :


#ifndef CONFIG_X86_CMPXCHG64


#define cmpxchg64(ptr, o, n)                                    \
({                                                              \
        __typeof__(*(ptr)) __ret;                               \
        __typeof__(*(ptr)) __old = (o);                         \
        __typeof__(*(ptr)) __new = (n);                         \
        alternative_io("call cmpxchg8b_emu",                    \
                        "lock; cmpxchg8b (%%esi)" ,             \
                       X86_FEATURE_CX8,                         \
                       "=A" (__ret),                            \
                       "S" ((ptr)), "0" (__old),                \
                       "b" ((unsigned int)__new),               \
                       "c" ((unsigned int)(__new>>32))          \
                       : "memory");                             \
        __ret; })



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

* [tip:x86/urgent] x86: Optimize cmpxchg64() at build-time some more
  2009-10-01  0:57                             ` Linus Torvalds
  2009-10-01  5:30                               ` Eric Dumazet
@ 2009-10-01  6:40                               ` tip-bot for Linus Torvalds
  2009-10-02 16:40                               ` [GIT PULL] scheduler fixes Yuhong Bao
  2 siblings, 0 replies; 79+ messages in thread
From: tip-bot for Linus Torvalds @ 2009-10-01  6:40 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, torvalds, tglx, mingo

Commit-ID:  982d007a6eec4a0abb404d2355eeec2c041c61ea
Gitweb:     http://git.kernel.org/tip/982d007a6eec4a0abb404d2355eeec2c041c61ea
Author:     Linus Torvalds <torvalds@linux-foundation.org>
AuthorDate: Wed, 30 Sep 2009 17:57:27 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 1 Oct 2009 08:01:08 +0200

x86: Optimize cmpxchg64() at build-time some more

Try to avoid the 'alternates()' code when we can statically
determine that cmpxchg8b is fine. We already have that
CONFIG_x86_CMPXCHG64 (enabled by PAE support), and we could easily
also enable it for some of the CPU cases.

Note, this patch only adds CMPXCHG8B for the obvious Intel CPU's,
not for others. (There was something really messy about cmpxchg8b
and clone CPU's, so if you enable it on other CPUs later, do it
carefully.)

If we avoid that asm-alternative thing when we can assume the
instruction exists, we'll generate less support crud, and we'll
avoid the whole issue with that extra 'nop' for padding instruction
sizes etc.

LKML-Reference: <alpine.LFD.2.01.0909301743150.6996@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/Kconfig.cpu |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 527519b..f2824fb 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -400,7 +400,7 @@ config X86_TSC
 
 config X86_CMPXCHG64
 	def_bool y
-	depends on X86_PAE || X86_64
+	depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM
 
 # this should be set for all -march=.. options where the compiler
 # generates cmov.
@@ -412,6 +412,7 @@ config X86_MINIMUM_CPU_FAMILY
 	int
 	default "64" if X86_64
 	default "6" if X86_32 && X86_P6_NOP
+	default "5" if X86_32 && X86_CMPXCHG64
 	default "4" if X86_32 && (X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK)
 	default "3"
 

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

* Re: [GIT PULL] scheduler fixes
  2009-10-01  6:18                                   ` Eric Dumazet
@ 2009-10-01  6:42                                     ` Ingo Molnar
  2009-10-01  6:59                                       ` Eric Dumazet
  2009-10-01  7:28                                       ` Sam Ravnborg
  0 siblings, 2 replies; 79+ messages in thread
From: Ingo Molnar @ 2009-10-01  6:42 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Linus Torvalds, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra


* Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Ingo Molnar a écrit :
> > 
> > That's not enough - the inline assembly code in 
> > arch/x86/include/asm/cmpxchg_32.h should also not reference 
> > cmpxchg8b_emu in that case.
> > 
> 
> I believe it is OK as is, since cmpxchg8b_emu is referenced only
> once, in a section guarded by :
> #ifndef CONFIG_X86_CMPXCHG64

yeah. But this bit is wrong:

> +++ b/arch/x86/lib/Makefile
> @@ -15,8 +15,10 @@ ifeq ($(CONFIG_X86_32),y)
>          obj-y += atomic64_32.o
>          lib-y += checksum_32.o
>          lib-y += strstr_32.o
> -        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
> -
> +        lib-y += semaphore_32.o string_32.o
> +ifeq ($(CONFIG_X86_CMPXCHG64),n)
> +        lib-y += cmpxchg8b_emu.o
> +endif
>          lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
>  else
>          obj-y += io_64.o iomap_copy_64.o

The way to check for a disabled option in a Make rule is:

	ifneq ($(CONFIG_X86_CMPXCHG64),y)

As in the disabled case the config variable will be undefined. (and wont 
have a value of 'n'). I've done the fix below on your patch.

	Ingo

Index: linux2/arch/x86/lib/Makefile
===================================================================
--- linux2.orig/arch/x86/lib/Makefile
+++ linux2/arch/x86/lib/Makefile
@@ -16,7 +16,7 @@ ifeq ($(CONFIG_X86_32),y)
         lib-y += checksum_32.o
         lib-y += strstr_32.o
         lib-y += semaphore_32.o string_32.o
-ifeq ($(CONFIG_X86_CMPXCHG64),n)
+ifneq ($(CONFIG_X86_CMPXCHG64),y)
         lib-y += cmpxchg8b_emu.o
 endif
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o

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

* [tip:x86/urgent] x86: Don't generate cmpxchg8b_emu if CONFIG_X86_CMPXCHG64=y
  2009-10-01  5:30                               ` Eric Dumazet
  2009-10-01  6:11                                 ` Ingo Molnar
@ 2009-10-01  6:49                                 ` tip-bot for Eric Dumazet
  1 sibling, 0 replies; 79+ messages in thread
From: tip-bot for Eric Dumazet @ 2009-10-01  6:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, eric.dumazet, torvalds, a.p.zijlstra,
	johnstul, schwidefsky, arjan, tglx, mingo

Commit-ID:  04edbdef02ec4386a2ae38cab7ae7d166e17a756
Gitweb:     http://git.kernel.org/tip/04edbdef02ec4386a2ae38cab7ae7d166e17a756
Author:     Eric Dumazet <eric.dumazet@gmail.com>
AuthorDate: Thu, 1 Oct 2009 07:30:38 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 1 Oct 2009 08:42:24 +0200

x86: Don't generate cmpxchg8b_emu if CONFIG_X86_CMPXCHG64=y

Conditionaly compile cmpxchg8b_emu.o and EXPORT_SYMBOL(cmpxchg8b_emu).

This reduces the kernel size a bit.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <4AC43E7E.1000600@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/kernel/i386_ksyms_32.c |    2 ++
 arch/x86/lib/Makefile           |    6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index 1736c5a..9c3bd4a 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -15,8 +15,10 @@ EXPORT_SYMBOL(mcount);
  * the export, but dont use it from C code, it is used
  * by assembly code and is not using C calling convention!
  */
+#ifndef CONFIG_X86_CMPXCHG64
 extern void cmpxchg8b_emu(void);
 EXPORT_SYMBOL(cmpxchg8b_emu);
+#endif
 
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy_generic);
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 3e549b8..85f5db9 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -15,8 +15,10 @@ ifeq ($(CONFIG_X86_32),y)
         obj-y += atomic64_32.o
         lib-y += checksum_32.o
         lib-y += strstr_32.o
-        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
-
+        lib-y += semaphore_32.o string_32.o
+ifneq ($(CONFIG_X86_CMPXCHG64),y)
+        lib-y += cmpxchg8b_emu.o
+endif
         lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
 else
         obj-y += io_64.o iomap_copy_64.o

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

* Re: [GIT PULL] scheduler fixes
  2009-10-01  6:42                                     ` Ingo Molnar
@ 2009-10-01  6:59                                       ` Eric Dumazet
  2009-10-01  7:28                                       ` Sam Ravnborg
  1 sibling, 0 replies; 79+ messages in thread
From: Eric Dumazet @ 2009-10-01  6:59 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra

Ingo Molnar a écrit :


> The way to check for a disabled option in a Make rule is:
> 
> 	ifneq ($(CONFIG_X86_CMPXCHG64),y)
> 

Ah OK, thanks for the explanation, my test 486-build (before your change) just finished to :

arch/x86/built-in.o:(__ksymtab+0xa8): undefined reference to `cmpxchg8b_emu'
kernel/built-in.o: In function `sched_clock_local':
/opt/src/linux-2.6/kernel/sched_clock.c:130: undefined reference to `cmpxchg8b_emu'
kernel/built-in.o: In function `sched_clock_remote':
/opt/src/linux-2.6/kernel/sched_clock.c:166: undefined reference to `cmpxchg8b_emu'
make: *** [.tmp_vmlinux1] Error 1



> As in the disabled case the config variable will be undefined. (and wont 
> have a value of 'n'). I've done the fix below on your patch.
> 
> 	Ingo
> 
> Index: linux2/arch/x86/lib/Makefile
> ===================================================================
> --- linux2.orig/arch/x86/lib/Makefile
> +++ linux2/arch/x86/lib/Makefile
> @@ -16,7 +16,7 @@ ifeq ($(CONFIG_X86_32),y)
>          lib-y += checksum_32.o
>          lib-y += strstr_32.o
>          lib-y += semaphore_32.o string_32.o
> -ifeq ($(CONFIG_X86_CMPXCHG64),n)
> +ifneq ($(CONFIG_X86_CMPXCHG64),y)
>          lib-y += cmpxchg8b_emu.o
>  endif
>          lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o


Thats perfect this fixed my 486-build, thanks again.

Looking at disassembly I still see atomic64_cmpxchg(),
atomic64_xchg(), atomic64_add_return(),  and friends being
included... (but not used)

I'll check if similar patch could be done as well for atomic64 functions.

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:38                           ` Ingo Molnar
@ 2009-10-01  7:18                             ` Arjan van de Ven
  0 siblings, 0 replies; 79+ messages in thread
From: Arjan van de Ven @ 2009-10-01  7:18 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Eric Dumazet, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra

On Wed, 30 Sep 2009 22:38:18 +0200
Ingo Molnar <mingo@elte.hu> wrote:

> > > > probably a "memory" clobber is needed, alternative_io() doesnt
> > > > provide it.
> > > 
> > > Yeah, good catch.
> > 
> > Yeah - i'm testing this right now, it looks like something that
> > could explain the hang.
> 
> Yeah - that was the cause of the hang

I woke up at 2am realizing that this was missing.. but you beat me to
it ;)


-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

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

* Re: [GIT PULL] scheduler fixes
  2009-10-01  6:42                                     ` Ingo Molnar
  2009-10-01  6:59                                       ` Eric Dumazet
@ 2009-10-01  7:28                                       ` Sam Ravnborg
  1 sibling, 0 replies; 79+ messages in thread
From: Sam Ravnborg @ 2009-10-01  7:28 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Eric Dumazet, Linus Torvalds, Arjan van de Ven,
	Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra

On Thu, Oct 01, 2009 at 08:42:09AM +0200, Ingo Molnar wrote:
> 
> * Eric Dumazet <eric.dumazet@gmail.com> wrote:
> 
> > Ingo Molnar a écrit :
> > > 
> > > That's not enough - the inline assembly code in 
> > > arch/x86/include/asm/cmpxchg_32.h should also not reference 
> > > cmpxchg8b_emu in that case.
> > > 
> > 
> > I believe it is OK as is, since cmpxchg8b_emu is referenced only
> > once, in a section guarded by :
> > #ifndef CONFIG_X86_CMPXCHG64
> 
> yeah. But this bit is wrong:
> 
> > +++ b/arch/x86/lib/Makefile
> > @@ -15,8 +15,10 @@ ifeq ($(CONFIG_X86_32),y)
> >          obj-y += atomic64_32.o
> >          lib-y += checksum_32.o
> >          lib-y += strstr_32.o
> > -        lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o
> > -
> > +        lib-y += semaphore_32.o string_32.o
> > +ifeq ($(CONFIG_X86_CMPXCHG64),n)
> > +        lib-y += cmpxchg8b_emu.o
> > +endif
> >          lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
> >  else
> >          obj-y += io_64.o iomap_copy_64.o
> 
> The way to check for a disabled option in a Make rule is:
> 
> 	ifneq ($(CONFIG_X86_CMPXCHG64),y)
or
 	ifeq ($(CONFIG_X86_CMPXCHG64),)

Both variants are suboptimal - but I have not been
able to come up with something readable in this situation.

Looking at the above the first is the better version as
it is a bit more obvious what we test for (assuming reader
knows this is a boolean value and not tristate).

	Sam

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

* Re: Linux 2.6.32-rc1
  2009-09-30 20:41                       ` Linus Torvalds
                                           ` (2 preceding siblings ...)
  2009-09-30 21:53                         ` David Miller
@ 2009-10-01 12:48                         ` Christoph Hellwig
  2009-10-01 16:08                           ` Valdis.Kletnieks
  3 siblings, 1 reply; 79+ messages in thread
From: Christoph Hellwig @ 2009-10-01 12:48 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Arjan van de Ven, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Peter Zijlstra, Ingo Molnar

On Wed, Sep 30, 2009 at 01:41:26PM -0700, Linus Torvalds wrote:
> On Wed, 30 Sep 2009, Eric Dumazet wrote:
> > 
> > Yes, I provided following version in my first answer but apparently it 
> > was too complex :)
> 
> It wasn't too complex, but YOU QUOTED THE WHOL F*CKING EMAIL.
> 
> I don't know about anybody else, but if I see a couple of screenfuls of 
> quotes, with no actual interesting new data, I just move on. I suspect 
> everybody else did too. 

I do most of the time.  But if everyone did all the time Linux
development would become almost defunct.  Fullquotes are spreading like
a cancer, mostly by people using thunderbird, evolution and similar
crap.


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

* Re: Linux 2.6.32-rc1
  2009-10-01 12:48                         ` Christoph Hellwig
@ 2009-10-01 16:08                           ` Valdis.Kletnieks
  2009-10-05 14:39                             ` Peter Zijlstra
  0 siblings, 1 reply; 79+ messages in thread
From: Valdis.Kletnieks @ 2009-10-01 16:08 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Linus Torvalds, Eric Dumazet, Arjan van de Ven,
	Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Peter Zijlstra, Ingo Molnar

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

On Thu, 01 Oct 2009 08:48:32 EDT, Christoph Hellwig said:

> I do most of the time.  But if everyone did all the time Linux
> development would become almost defunct.  Fullquotes are spreading like
> a cancer, mostly by people using thunderbird, evolution and similar
> crap.

What? There's mainline graphic MUAs that *don't* do "select big chunk of text
with mouse drag, hit delete"?

No, I suspect people are just lazy.  Just like the ones that say "Sorry for
top-posting, MUA XYZ makes me" - in the time it took them to type that, they
could have scrolled down to where they should reply and start typing *there*.

[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]

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

* RE: [GIT PULL] scheduler fixes
  2009-10-01  0:57                             ` Linus Torvalds
  2009-10-01  5:30                               ` Eric Dumazet
  2009-10-01  6:40                               ` [tip:x86/urgent] x86: Optimize cmpxchg64() at build-time some more tip-bot for Linus Torvalds
@ 2009-10-02 16:40                               ` Yuhong Bao
  2 siblings, 0 replies; 79+ messages in thread
From: Yuhong Bao @ 2009-10-02 16:40 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: eric.dumazet, arjan, schwidefsky, tglx, johnstul, linux-kernel, mingo


 <alpine.LFD.2.01.0909301743150.6996@localhost.localdomain>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0



> [ If I recall correctly=2C cmpxchg8b support detection was something that
> was totally messed up in WNT=2C and I have this memory of TMTA _not_
> claiming to support CX8 in the cpuid bits=2C but happily supporting the
> instruction itself - because otherwise WNT would blue-screen on boot or
> something silly like that.
Yep=2C Geoff Chappell describe this bug excellently:http://www.geoffchappel=
l.com/viewer.htm?doc=3Dstudies/windows/km/cpu/cx8.htm
> As a result=2C the patch below only adds CMPXCHG8B for the obvious Intel
> CPU's=2C not for others. There was something really messy about cmpxchg8b
> and clone CPU's=2C but I'm not 100% sure about the details=2C so take thi=
s
> patch with a pinch of salt=2C and some thinking ]
Basically=2C pre-SP4 NT 4 would crash if the CX8 bit was set in CPUID and v=
endor was not GenuineIntel=2C AuthenticAMD=2C or CyrixInstead due to a bug =
in the CPU detection=2C XP had to workaround it too when it began requiring=
 CX8.
Yuhong bao 		 	   		  =0A=
_________________________________________________________________=0A=
Insert movie times and more without leaving Hotmail=AE.=0A=
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=3DTXT_TAGLM_WL_HM_Tut=
orial_QuickAdd_062009=

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

* Re: Linux 2.6.32-rc1
  2009-10-01 16:08                           ` Valdis.Kletnieks
@ 2009-10-05 14:39                             ` Peter Zijlstra
  0 siblings, 0 replies; 79+ messages in thread
From: Peter Zijlstra @ 2009-10-05 14:39 UTC (permalink / raw)
  To: Valdis.Kletnieks
  Cc: Christoph Hellwig, Linus Torvalds, Eric Dumazet,
	Arjan van de Ven, Martin Schwidefsky, Thomas Gleixner,
	John Stultz, Linux Kernel Mailing List, Ingo Molnar

On Thu, 2009-10-01 at 12:08 -0400, Valdis.Kletnieks@vt.edu wrote:
> What? There's mainline graphic MUAs that *don't* do "select big chunk of text
> with mouse drag, hit delete"?

Better yet, using evo, if you select part of the msg using your mouse
and then hit reply-all, it will only quote the selected bit.



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

* [PATCH] x86: Generate cmpxchg build failures
  2009-09-29 21:17           ` Linus Torvalds
  2009-09-29 21:22             ` Arjan van de Ven
@ 2009-10-05 16:00             ` Peter Zijlstra
  2009-10-05 18:51               ` Maciej Żenczykowski
  2009-10-05 19:16               ` Linus Torvalds
  1 sibling, 2 replies; 79+ messages in thread
From: Peter Zijlstra @ 2009-10-05 16:00 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Ingo Molnar, Arjan van de Ven

On Tue, 2009-09-29 at 14:17 -0700, Linus Torvalds wrote:

> And regardless, we should fix the silent cmpxchg failure, even if it's 
> just a link-time failure or something.

Something like the below?

Seems to build defconfig-i386, defconfig-x86_64 and generates a build
failure on i386 with the sched_clock cmpxchg64 thing undone.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 arch/x86/include/asm/cmpxchg_32.h |  274 ++++++++++++++++++----------------
 arch/x86/include/asm/cmpxchg_64.h |  296 +++++++++++++++++++-----------------
 2 files changed, 298 insertions(+), 272 deletions(-)

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index ee1931b..45ed563 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -8,14 +8,50 @@
  *       you need to test for the feature in boot_cpu_data.
  */
 
-#define xchg(ptr, v)							\
-	((__typeof__(*(ptr)))__xchg((unsigned long)(v), (ptr), sizeof(*(ptr))))
+extern void __xchg_wrong_size(void);
+
+/*
+ * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
+ * Note 2: xchg has side effect, so that attribute volatile is necessary,
+ *	  but generally the primitive is invalid, *ptr is output argument. --ANK
+ */
 
 struct __xchg_dummy {
 	unsigned long a[100];
 };
 #define __xg(x) ((struct __xchg_dummy *)(x))
 
+#define __xchg(x, ptr, size)						\
+({									\
+ 	__typeof(*(ptr)) __x = (x);					\
+	switch (size) {							\
+ 	case 1:								\
+		asm volatile("xchgb %b0,%1"				\
+			     : "=q" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 2:								\
+		asm volatile("xchgw %w0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 4:								\
+		asm volatile("xchgl %0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__xchg_wrong_size();					\
+	}								\
+	__x;								\
+})
+
+#define xchg(ptr, v)							\
+	__xchg((v), (ptr), sizeof(*ptr))
+
 /*
  * The semantics of XCHGCMP8B are a bit strange, this is why
  * there is a loop and the loading of %%eax and %%edx has to
@@ -71,57 +107,119 @@ static inline void __set_64bit_var(unsigned long long *ptr,
 		       (unsigned int)((value) >> 32))			\
 	 : __set_64bit(ptr, ll_low((value)), ll_high((value))))
 
-/*
- * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
- * Note 2: xchg has side effect, so that attribute volatile is necessary,
- *	  but generally the primitive is invalid, *ptr is output argument. --ANK
- */
-static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
-				   int size)
-{
-	switch (size) {
-	case 1:
-		asm volatile("xchgb %b0,%1"
-			     : "=q" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 2:
-		asm volatile("xchgw %w0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 4:
-		asm volatile("xchgl %0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	}
-	return x;
-}
+extern void __cmpxchg_wrong_size(void);
 
 /*
  * Atomic compare and exchange.  Compare OLD with MEM, if identical,
  * store NEW in MEM.  Return the initial value in MEM.  Success is
  * indicated by comparing RETURN with OLD.
  */
+#define __cmpxchg(ptr, old, new, size)					\
+({									\
+ 	__typeof__(*(ptr)) __ret;					\
+ 	__typeof__(*(ptr)) __old = (old);				\
+ 	__typeof__(*(ptr)) __new = (new);				\
+	switch (size) {							\
+	case 1:								\
+		asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"		\
+			     : "=a"(__ret)				\
+			     : "q"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 2:								\
+		asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"		\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 4:								\
+		asm volatile(LOCK_PREFIX "cmpxchgl %1,%2"		\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	default:							\
+		__cmpxchg_wrong_size();					\
+	}								\
+	__ret;								\
+})
+
+/*
+ * Always use locked operations when touching memory shared with a
+ * hypervisor, since the system may be SMP even if the guest kernel
+ * isn't.
+ */
+#define __sync_cmpxchg(ptr, old, new, size)				\
+({									\
+ 	__typeof__(*(ptr)) __ret;					\
+ 	__typeof__(*(ptr)) __old = (old);				\
+ 	__typeof__(*(ptr)) __new = (new);				\
+	switch (size) {							\
+	case 1:								\
+		asm volatile("lock; cmpxchgb %b1,%2"			\
+			     : "=a"(__ret)				\
+			     : "q"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 2:								\
+		asm volatile("lock; cmpxchgw %w1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 4:								\
+		asm volatile("lock; cmpxchgl %1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	default:							\
+		__cmpxchg_wrong_size();					\
+	}								\
+	__ret;								\
+})
+
+#define __cmpxchg_local(ptr, old, new, size)				\
+({									\
+ 	__typeof__(*(ptr)) __ret;					\
+ 	__typeof__(*(ptr)) __old = (old);				\
+ 	__typeof__(*(ptr)) __new = (new);				\
+	switch (size) {							\
+	case 1:								\
+		asm volatile("cmpxchgb %b1,%2"				\
+			     : "=a"(__ret)				\
+			     : "q"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 2:								\
+		asm volatile("cmpxchgw %w1,%2"				\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 4:								\
+		asm volatile("cmpxchgl %1,%2"				\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	default:							\
+		__cmpxchg_wrong_size();					\
+	}								\
+	__ret;								\
+})
 
 #ifdef CONFIG_X86_CMPXCHG
 #define __HAVE_ARCH_CMPXCHG 1
-#define cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o),	\
-				       (unsigned long)(n),		\
-				       sizeof(*(ptr))))
-#define sync_cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o),	\
-					    (unsigned long)(n),		\
-					    sizeof(*(ptr))))
-#define cmpxchg_local(ptr, o, n)					\
-	((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o),	\
-					     (unsigned long)(n),	\
-					     sizeof(*(ptr))))
+
+#define cmpxchg(ptr, old, new)						\
+	__cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define sync_cmpxchg(ptr, old, new)					\
+	__sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define cmpxchg_local(ptr, old, new)					\
+	__cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
 #endif
 
 #ifdef CONFIG_X86_CMPXCHG64
@@ -133,94 +231,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
 					       (unsigned long long)(n)))
 #endif
 
-static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-				      unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile(LOCK_PREFIX "cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
-
-/*
- * Always use locked operations when touching memory shared with a
- * hypervisor, since the system may be SMP even if the guest kernel
- * isn't.
- */
-static inline unsigned long __sync_cmpxchg(volatile void *ptr,
-					   unsigned long old,
-					   unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("lock; cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("lock; cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("lock; cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
-
-static inline unsigned long __cmpxchg_local(volatile void *ptr,
-					    unsigned long old,
-					    unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
-
 static inline unsigned long long __cmpxchg64(volatile void *ptr,
 					     unsigned long long old,
 					     unsigned long long new)
diff --git a/arch/x86/include/asm/cmpxchg_64.h b/arch/x86/include/asm/cmpxchg_64.h
index 52de72e..df20c6e 100644
--- a/arch/x86/include/asm/cmpxchg_64.h
+++ b/arch/x86/include/asm/cmpxchg_64.h
@@ -3,9 +3,6 @@
 
 #include <asm/alternative.h> /* Provides LOCK_PREFIX */
 
-#define xchg(ptr, v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v), \
-						 (ptr), sizeof(*(ptr))))
-
 #define __xg(x) ((volatile long *)(x))
 
 static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
@@ -15,167 +12,186 @@ static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
 
 #define _set_64bit set_64bit
 
+extern void __xchg_wrong_size(void);
+extern void __cmpxchg_wrong_size(void);
+
 /*
  * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
  * Note 2: xchg has side effect, so that attribute volatile is necessary,
  *	  but generally the primitive is invalid, *ptr is output argument. --ANK
  */
-static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
-				   int size)
-{
-	switch (size) {
-	case 1:
-		asm volatile("xchgb %b0,%1"
-			     : "=q" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 2:
-		asm volatile("xchgw %w0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 4:
-		asm volatile("xchgl %k0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 8:
-		asm volatile("xchgq %0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	}
-	return x;
-}
+#define __xchg(x, ptr, size)						\
+({									\
+ 	__typeof(*(ptr)) __x = (x);					\
+	switch (size) {							\
+ 	case 1:								\
+		asm volatile("xchgb %b0,%1"				\
+			     : "=q" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 2:								\
+		asm volatile("xchgw %w0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 4:								\
+		asm volatile("xchgl %k0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 8:								\
+		asm volatile("xchgq %0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__xchg_wrong_size();					\
+	}								\
+	__x;								\
+})
+
+#define xchg(ptr, v)							\
+	__xchg((v), (ptr), sizeof(*ptr))
 
 /*
  * Atomic compare and exchange.  Compare OLD with MEM, if identical,
  * store NEW in MEM.  Return the initial value in MEM.  Success is
  * indicated by comparing RETURN with OLD.
  */
-
-#define __HAVE_ARCH_CMPXCHG 1
-
-static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-				      unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile(LOCK_PREFIX "cmpxchgl %k1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 8:
-		asm volatile(LOCK_PREFIX "cmpxchgq %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
+#define __cmpxchg(ptr, old, new, size)					\
+({									\
+ 	__typeof__(*(ptr)) __ret;					\
+ 	__typeof__(*(ptr)) __old = (old);				\
+ 	__typeof__(*(ptr)) __new = (new);				\
+	switch (size) {							\
+	case 1:								\
+		asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"		\
+			     : "=a"(__ret)				\
+			     : "q"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 2:								\
+		asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"		\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 4:								\
+		asm volatile(LOCK_PREFIX "cmpxchgl %k1,%2"		\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 8:								\
+		asm volatile(LOCK_PREFIX "cmpxchgq %1,%2"		\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__cmpxchg_wrong_size();					\
+	}								\
+	__ret;								\
+})
 
 /*
  * Always use locked operations when touching memory shared with a
  * hypervisor, since the system may be SMP even if the guest kernel
  * isn't.
  */
-static inline unsigned long __sync_cmpxchg(volatile void *ptr,
-					   unsigned long old,
-					   unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("lock; cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("lock; cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("lock; cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
+#define __sync_cmpxchg(ptr, old, new, size)				\
+({									\
+ 	__typeof__(*(ptr)) __ret;					\
+ 	__typeof__(*(ptr)) __old = (old);				\
+ 	__typeof__(*(ptr)) __new = (new);				\
+	switch (size) {							\
+	case 1:								\
+		asm volatile("lock; cmpxchgb %b1,%2"			\
+			     : "=a"(__ret)				\
+			     : "q"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 2:								\
+		asm volatile("lock; cmpxchgw %w1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 4:								\
+		asm volatile("lock; cmpxchgl %k1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 8:								\
+		asm volatile("lock; cmpxchgq %1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__cmpxchg_wrong_size();					\
+	}								\
+	__ret;								\
+})
 
-static inline unsigned long __cmpxchg_local(volatile void *ptr,
-					    unsigned long old,
-					    unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("cmpxchgl %k1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 8:
-		asm volatile("cmpxchgq %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
+#define __cmpxchg_local(ptr, old, new, size)				\
+({									\
+ 	__typeof__(*(ptr)) __ret;					\
+ 	__typeof__(*(ptr)) __old = (old);				\
+ 	__typeof__(*(ptr)) __new = (new);				\
+	switch (size) {							\
+	case 1:								\
+		asm volatile("cmpxchgb %b1,%2"				\
+			     : "=a"(__ret)				\
+			     : "q"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 2:								\
+		asm volatile("cmpxchgw %w1,%2"				\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 4:								\
+		asm volatile("cmpxchgl %k1,%2"				\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 8:								\
+		asm volatile("cmpxchgq %1,%2"				\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__cmpxchg_wrong_size();					\
+	}								\
+	__ret;								\
+})
+
+#define __HAVE_ARCH_CMPXCHG 1
+
+#define cmpxchg(ptr, old, new)						\
+	__cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define sync_cmpxchg(ptr, old, new)					\
+	__sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define cmpxchg_local(ptr, old, new)					\
+	__cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
 
-#define cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o),	\
-				       (unsigned long)(n), sizeof(*(ptr))))
 #define cmpxchg64(ptr, o, n)						\
 ({									\
 	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\
 	cmpxchg((ptr), (o), (n));					\
 })
-#define cmpxchg_local(ptr, o, n)					\
-	((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o),	\
-					     (unsigned long)(n),	\
-					     sizeof(*(ptr))))
-#define sync_cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o),	\
-					    (unsigned long)(n),		\
-					    sizeof(*(ptr))))
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\



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

* Re: [PATCH] x86: Generate cmpxchg build failures
  2009-10-05 16:00             ` [PATCH] x86: Generate cmpxchg build failures Peter Zijlstra
@ 2009-10-05 18:51               ` Maciej Żenczykowski
  2009-10-05 19:16               ` Linus Torvalds
  1 sibling, 0 replies; 79+ messages in thread
From: Maciej Żenczykowski @ 2009-10-05 18:51 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Linus Torvalds, Eric Dumazet, Martin Schwidefsky,
	Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	Ingo Molnar, Arjan van de Ven

Strictly speaking isn't there a cmpxchg8b on newer than ancient cpus...

I'm guessing that it's deliberately not supported/used?

Maciej

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

* Re: [PATCH] x86: Generate cmpxchg build failures
  2009-10-05 16:00             ` [PATCH] x86: Generate cmpxchg build failures Peter Zijlstra
  2009-10-05 18:51               ` Maciej Żenczykowski
@ 2009-10-05 19:16               ` Linus Torvalds
  2009-10-05 19:33                 ` Peter Zijlstra
  1 sibling, 1 reply; 79+ messages in thread
From: Linus Torvalds @ 2009-10-05 19:16 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Eric Dumazet, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Ingo Molnar, Arjan van de Ven



On Mon, 5 Oct 2009, Peter Zijlstra wrote:

> On Tue, 2009-09-29 at 14:17 -0700, Linus Torvalds wrote:
> 
> > And regardless, we should fix the silent cmpxchg failure, even if it's 
> > just a link-time failure or something.
> 
> Something like the below?

Looks good to me. This is also one of the cases where a macro will do 
better than an inline function, since the return value depends on the size 
of the pointer, and it doesn't do the whole 'unsigned long' thing any 
more.

It should also be fairly easy to make this now just do a cmpxchg8b for the 
64-bit case (again, that wouldn't have worked sanely due to the fixed type 
in the inline function version - expanding that size to 64-bit would have 
been insane). But that's a separate issue (and maybe we don't want to do 
it, due to the whole "it's not DMA-atomic" etc issue - we may be better 
off with a build failure, and forcing people who really want 64-bit 
accesses to use the explicit cmpxchg64 thing)

That said, I think that you should merge the insane three versions of this 
macro into one. Having separate versions for "__[sync_|local_|]cmpxchg()" 
is disgusting. I bet you can do it with a single macro, and just pass in 
the LOCK_PREFIX (or empty, or "lock;") to that as needed. Rather than 
duplicating it three times.

			Linus

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

* Re: [PATCH] x86: Generate cmpxchg build failures
  2009-10-05 19:16               ` Linus Torvalds
@ 2009-10-05 19:33                 ` Peter Zijlstra
  2009-10-05 20:54                   ` Linus Torvalds
  2009-10-09 14:23                   ` [tip:x86/asm] " tip-bot for Peter Zijlstra
  0 siblings, 2 replies; 79+ messages in thread
From: Peter Zijlstra @ 2009-10-05 19:33 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Eric Dumazet, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Ingo Molnar, Arjan van de Ven

On Mon, 2009-10-05 at 12:16 -0700, Linus Torvalds wrote:
> 
> On Mon, 5 Oct 2009, Peter Zijlstra wrote:
> 
> > On Tue, 2009-09-29 at 14:17 -0700, Linus Torvalds wrote:
> > 
> > > And regardless, we should fix the silent cmpxchg failure, even if it's 
> > > just a link-time failure or something.
> > 
> > Something like the below?
> 
> Looks good to me. This is also one of the cases where a macro will do 
> better than an inline function, since the return value depends on the size 
> of the pointer, and it doesn't do the whole 'unsigned long' thing any 
> more.

Indeed, I was glad to see that go.

> It should also be fairly easy to make this now just do a cmpxchg8b for the 
> 64-bit case (again, that wouldn't have worked sanely due to the fixed type 
> in the inline function version - expanding that size to 64-bit would have 
> been insane). But that's a separate issue (and maybe we don't want to do 
> it, due to the whole "it's not DMA-atomic" etc issue - we may be better 
> off with a build failure, and forcing people who really want 64-bit 
> accesses to use the explicit cmpxchg64 thing)

Right, that would be a second patch if we think its a sane thing to do.

> That said, I think that you should merge the insane three versions of this 
> macro into one. Having separate versions for "__[sync_|local_|]cmpxchg()" 
> is disgusting. I bet you can do it with a single macro, and just pass in 
> the LOCK_PREFIX (or empty, or "lock;") to that as needed. Rather than 
> duplicating it three times.

You're right, what was I thinking doing all this copy/paste stuff.

Here's a new one, still seems to build i386 and x86_64 defconfigs.


Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 arch/x86/include/asm/cmpxchg_32.h |  218 ++++++++++++++---------------------
 arch/x86/include/asm/cmpxchg_64.h |  234 ++++++++++++++----------------------
 2 files changed, 177 insertions(+), 275 deletions(-)

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index ee1931b..720c3d4 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -8,14 +8,50 @@
  *       you need to test for the feature in boot_cpu_data.
  */
 
-#define xchg(ptr, v)							\
-	((__typeof__(*(ptr)))__xchg((unsigned long)(v), (ptr), sizeof(*(ptr))))
+extern void __xchg_wrong_size(void);
+
+/*
+ * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
+ * Note 2: xchg has side effect, so that attribute volatile is necessary,
+ *	  but generally the primitive is invalid, *ptr is output argument. --ANK
+ */
 
 struct __xchg_dummy {
 	unsigned long a[100];
 };
 #define __xg(x) ((struct __xchg_dummy *)(x))
 
+#define __xchg(x, ptr, size)						\
+({									\
+ 	__typeof(*(ptr)) __x = (x);					\
+	switch (size) {							\
+ 	case 1:								\
+		asm volatile("xchgb %b0,%1"				\
+			     : "=q" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 2:								\
+		asm volatile("xchgw %w0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 4:								\
+		asm volatile("xchgl %0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__xchg_wrong_size();					\
+	}								\
+	__x;								\
+})
+
+#define xchg(ptr, v)							\
+	__xchg((v), (ptr), sizeof(*ptr))
+
 /*
  * The semantics of XCHGCMP8B are a bit strange, this is why
  * there is a loop and the loading of %%eax and %%edx has to
@@ -71,57 +107,63 @@ static inline void __set_64bit_var(unsigned long long *ptr,
 		       (unsigned int)((value) >> 32))			\
 	 : __set_64bit(ptr, ll_low((value)), ll_high((value))))
 
-/*
- * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
- * Note 2: xchg has side effect, so that attribute volatile is necessary,
- *	  but generally the primitive is invalid, *ptr is output argument. --ANK
- */
-static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
-				   int size)
-{
-	switch (size) {
-	case 1:
-		asm volatile("xchgb %b0,%1"
-			     : "=q" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 2:
-		asm volatile("xchgw %w0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 4:
-		asm volatile("xchgl %0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	}
-	return x;
-}
+extern void __cmpxchg_wrong_size(void);
 
 /*
  * Atomic compare and exchange.  Compare OLD with MEM, if identical,
  * store NEW in MEM.  Return the initial value in MEM.  Success is
  * indicated by comparing RETURN with OLD.
  */
+#define __raw_cmpxchg(ptr, old, new, size, lock)			\
+({									\
+ 	__typeof__(*(ptr)) __ret;					\
+ 	__typeof__(*(ptr)) __old = (old);				\
+ 	__typeof__(*(ptr)) __new = (new);				\
+	switch (size) {							\
+	case 1:								\
+		asm volatile(lock "cmpxchgb %b1,%2"			\
+			     : "=a"(__ret)				\
+			     : "q"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 2:								\
+		asm volatile(lock "cmpxchgw %w1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 4:								\
+		asm volatile(lock "cmpxchgl %1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	default:							\
+		__cmpxchg_wrong_size();					\
+	}								\
+	__ret;								\
+})
+
+#define __cmpxchg(ptr, old, new, size)					\
+	__raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
+
+#define __sync_cmpxchg(ptr, old, new, size)				\
+	__raw_cmpxchg((ptr), (old), (new), (size), "lock; ")
+
+#define __cmpxchg_local(ptr, old, new, size)				\
+	__raw_cmpxchg((ptr), (old), (new), (size), "")
 
 #ifdef CONFIG_X86_CMPXCHG
 #define __HAVE_ARCH_CMPXCHG 1
-#define cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o),	\
-				       (unsigned long)(n),		\
-				       sizeof(*(ptr))))
-#define sync_cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o),	\
-					    (unsigned long)(n),		\
-					    sizeof(*(ptr))))
-#define cmpxchg_local(ptr, o, n)					\
-	((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o),	\
-					     (unsigned long)(n),	\
-					     sizeof(*(ptr))))
+
+#define cmpxchg(ptr, old, new)						\
+	__cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define sync_cmpxchg(ptr, old, new)					\
+	__sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define cmpxchg_local(ptr, old, new)					\
+	__cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
 #endif
 
 #ifdef CONFIG_X86_CMPXCHG64
@@ -133,94 +175,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
 					       (unsigned long long)(n)))
 #endif
 
-static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-				      unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile(LOCK_PREFIX "cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
-
-/*
- * Always use locked operations when touching memory shared with a
- * hypervisor, since the system may be SMP even if the guest kernel
- * isn't.
- */
-static inline unsigned long __sync_cmpxchg(volatile void *ptr,
-					   unsigned long old,
-					   unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("lock; cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("lock; cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("lock; cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
-
-static inline unsigned long __cmpxchg_local(volatile void *ptr,
-					    unsigned long old,
-					    unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
-
 static inline unsigned long long __cmpxchg64(volatile void *ptr,
 					     unsigned long long old,
 					     unsigned long long new)
diff --git a/arch/x86/include/asm/cmpxchg_64.h b/arch/x86/include/asm/cmpxchg_64.h
index 52de72e..d565670 100644
--- a/arch/x86/include/asm/cmpxchg_64.h
+++ b/arch/x86/include/asm/cmpxchg_64.h
@@ -3,9 +3,6 @@
 
 #include <asm/alternative.h> /* Provides LOCK_PREFIX */
 
-#define xchg(ptr, v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v), \
-						 (ptr), sizeof(*(ptr))))
-
 #define __xg(x) ((volatile long *)(x))
 
 static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
@@ -15,167 +12,118 @@ static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
 
 #define _set_64bit set_64bit
 
+extern void __xchg_wrong_size(void);
+extern void __cmpxchg_wrong_size(void);
+
 /*
  * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
  * Note 2: xchg has side effect, so that attribute volatile is necessary,
  *	  but generally the primitive is invalid, *ptr is output argument. --ANK
  */
-static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
-				   int size)
-{
-	switch (size) {
-	case 1:
-		asm volatile("xchgb %b0,%1"
-			     : "=q" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 2:
-		asm volatile("xchgw %w0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 4:
-		asm volatile("xchgl %k0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 8:
-		asm volatile("xchgq %0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	}
-	return x;
-}
+#define __xchg(x, ptr, size)						\
+({									\
+ 	__typeof(*(ptr)) __x = (x);					\
+	switch (size) {							\
+ 	case 1:								\
+		asm volatile("xchgb %b0,%1"				\
+			     : "=q" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 2:								\
+		asm volatile("xchgw %w0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 4:								\
+		asm volatile("xchgl %k0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 8:								\
+		asm volatile("xchgq %0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__xchg_wrong_size();					\
+	}								\
+	__x;								\
+})
+
+#define xchg(ptr, v)							\
+	__xchg((v), (ptr), sizeof(*ptr))
+
+#define __HAVE_ARCH_CMPXCHG 1
 
 /*
  * Atomic compare and exchange.  Compare OLD with MEM, if identical,
  * store NEW in MEM.  Return the initial value in MEM.  Success is
  * indicated by comparing RETURN with OLD.
  */
+#define __raw_cmpxchg(ptr, old, new, size, lock)			\
+({									\
+ 	__typeof__(*(ptr)) __ret;					\
+ 	__typeof__(*(ptr)) __old = (old);				\
+ 	__typeof__(*(ptr)) __new = (new);				\
+	switch (size) {							\
+	case 1:								\
+		asm volatile(lock "cmpxchgb %b1,%2"			\
+			     : "=a"(__ret)				\
+			     : "q"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 2:								\
+		asm volatile(lock "cmpxchgw %w1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 4:								\
+		asm volatile(lock "cmpxchgl %k1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+ 		break;							\
+	case 8:								\
+		asm volatile(lock "cmpxchgq %1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__cmpxchg_wrong_size();					\
+	}								\
+	__ret;								\
+})
 
-#define __HAVE_ARCH_CMPXCHG 1
+#define __cmpxchg(ptr, old, new, size)					\
+	__raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
 
-static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-				      unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile(LOCK_PREFIX "cmpxchgl %k1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 8:
-		asm volatile(LOCK_PREFIX "cmpxchgq %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
+#define __sync_cmpxchg(ptr, old, new, size)				\
+	__raw_cmpxchg((ptr), (old), (new), (size), "lock; ")
 
-/*
- * Always use locked operations when touching memory shared with a
- * hypervisor, since the system may be SMP even if the guest kernel
- * isn't.
- */
-static inline unsigned long __sync_cmpxchg(volatile void *ptr,
-					   unsigned long old,
-					   unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("lock; cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("lock; cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("lock; cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
+#define __cmpxchg_local(ptr, old, new, size)				\
+	__raw_cmpxchg((ptr), (old), (new), (size), "")
 
-static inline unsigned long __cmpxchg_local(volatile void *ptr,
-					    unsigned long old,
-					    unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("cmpxchgl %k1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 8:
-		asm volatile("cmpxchgq %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
+#define cmpxchg(ptr, old, new)						\
+	__cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define sync_cmpxchg(ptr, old, new)					\
+	__sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define cmpxchg_local(ptr, old, new)					\
+	__cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
 
-#define cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o),	\
-				       (unsigned long)(n), sizeof(*(ptr))))
 #define cmpxchg64(ptr, o, n)						\
 ({									\
 	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\
 	cmpxchg((ptr), (o), (n));					\
 })
-#define cmpxchg_local(ptr, o, n)					\
-	((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o),	\
-					     (unsigned long)(n),	\
-					     sizeof(*(ptr))))
-#define sync_cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o),	\
-					    (unsigned long)(n),		\
-					    sizeof(*(ptr))))
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\



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

* Re: [PATCH] x86: Generate cmpxchg build failures
  2009-10-05 19:33                 ` Peter Zijlstra
@ 2009-10-05 20:54                   ` Linus Torvalds
  2009-10-09 14:23                   ` [tip:x86/asm] " tip-bot for Peter Zijlstra
  1 sibling, 0 replies; 79+ messages in thread
From: Linus Torvalds @ 2009-10-05 20:54 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Eric Dumazet, Martin Schwidefsky, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Ingo Molnar, Arjan van de Ven



On Mon, 5 Oct 2009, Peter Zijlstra wrote:
> 
> Here's a new one, still seems to build i386 and x86_64 defconfigs.

Ack. Looks good to me.

		Linus

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

* [tip:x86/asm] x86: Generate cmpxchg build failures
  2009-10-05 19:33                 ` Peter Zijlstra
  2009-10-05 20:54                   ` Linus Torvalds
@ 2009-10-09 14:23                   ` tip-bot for Peter Zijlstra
  1 sibling, 0 replies; 79+ messages in thread
From: tip-bot for Peter Zijlstra @ 2009-10-09 14:23 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, torvalds, a.p.zijlstra, tglx, mingo

Commit-ID:  f3834b9ef68067199486740b31f691afb14dbdf5
Gitweb:     http://git.kernel.org/tip/f3834b9ef68067199486740b31f691afb14dbdf5
Author:     Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Fri, 9 Oct 2009 10:12:46 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 9 Oct 2009 15:57:00 +0200

x86: Generate cmpxchg build failures

Rework the x86 cmpxchg() implementation to generate build failures
when used on improper types.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <1254771187.21044.22.camel@laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/include/asm/cmpxchg_32.h |  218 ++++++++++++++---------------------
 arch/x86/include/asm/cmpxchg_64.h |  234 ++++++++++++++----------------------
 2 files changed, 177 insertions(+), 275 deletions(-)

diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index 82ceb78..5371174 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -8,14 +8,50 @@
  *       you need to test for the feature in boot_cpu_data.
  */
 
-#define xchg(ptr, v)							\
-	((__typeof__(*(ptr)))__xchg((unsigned long)(v), (ptr), sizeof(*(ptr))))
+extern void __xchg_wrong_size(void);
+
+/*
+ * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
+ * Note 2: xchg has side effect, so that attribute volatile is necessary,
+ *	  but generally the primitive is invalid, *ptr is output argument. --ANK
+ */
 
 struct __xchg_dummy {
 	unsigned long a[100];
 };
 #define __xg(x) ((struct __xchg_dummy *)(x))
 
+#define __xchg(x, ptr, size)						\
+({									\
+	__typeof(*(ptr)) __x = (x);					\
+	switch (size) {							\
+	case 1:								\
+		asm volatile("xchgb %b0,%1"				\
+			     : "=q" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 2:								\
+		asm volatile("xchgw %w0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 4:								\
+		asm volatile("xchgl %0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__xchg_wrong_size();					\
+	}								\
+	__x;								\
+})
+
+#define xchg(ptr, v)							\
+	__xchg((v), (ptr), sizeof(*ptr))
+
 /*
  * The semantics of XCHGCMP8B are a bit strange, this is why
  * there is a loop and the loading of %%eax and %%edx has to
@@ -71,57 +107,63 @@ static inline void __set_64bit_var(unsigned long long *ptr,
 		       (unsigned int)((value) >> 32))			\
 	 : __set_64bit(ptr, ll_low((value)), ll_high((value))))
 
-/*
- * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
- * Note 2: xchg has side effect, so that attribute volatile is necessary,
- *	  but generally the primitive is invalid, *ptr is output argument. --ANK
- */
-static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
-				   int size)
-{
-	switch (size) {
-	case 1:
-		asm volatile("xchgb %b0,%1"
-			     : "=q" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 2:
-		asm volatile("xchgw %w0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 4:
-		asm volatile("xchgl %0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	}
-	return x;
-}
+extern void __cmpxchg_wrong_size(void);
 
 /*
  * Atomic compare and exchange.  Compare OLD with MEM, if identical,
  * store NEW in MEM.  Return the initial value in MEM.  Success is
  * indicated by comparing RETURN with OLD.
  */
+#define __raw_cmpxchg(ptr, old, new, size, lock)			\
+({									\
+	__typeof__(*(ptr)) __ret;					\
+	__typeof__(*(ptr)) __old = (old);				\
+	__typeof__(*(ptr)) __new = (new);				\
+	switch (size) {							\
+	case 1:								\
+		asm volatile(lock "cmpxchgb %b1,%2"			\
+			     : "=a"(__ret)				\
+			     : "q"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	case 2:								\
+		asm volatile(lock "cmpxchgw %w1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	case 4:								\
+		asm volatile(lock "cmpxchgl %1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__cmpxchg_wrong_size();					\
+	}								\
+	__ret;								\
+})
+
+#define __cmpxchg(ptr, old, new, size)					\
+	__raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
+
+#define __sync_cmpxchg(ptr, old, new, size)				\
+	__raw_cmpxchg((ptr), (old), (new), (size), "lock; ")
+
+#define __cmpxchg_local(ptr, old, new, size)				\
+	__raw_cmpxchg((ptr), (old), (new), (size), "")
 
 #ifdef CONFIG_X86_CMPXCHG
 #define __HAVE_ARCH_CMPXCHG 1
-#define cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o),	\
-				       (unsigned long)(n),		\
-				       sizeof(*(ptr))))
-#define sync_cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o),	\
-					    (unsigned long)(n),		\
-					    sizeof(*(ptr))))
-#define cmpxchg_local(ptr, o, n)					\
-	((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o),	\
-					     (unsigned long)(n),	\
-					     sizeof(*(ptr))))
+
+#define cmpxchg(ptr, old, new)						\
+	__cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define sync_cmpxchg(ptr, old, new)					\
+	__sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define cmpxchg_local(ptr, old, new)					\
+	__cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
 #endif
 
 #ifdef CONFIG_X86_CMPXCHG64
@@ -133,94 +175,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
 					       (unsigned long long)(n)))
 #endif
 
-static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-				      unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile(LOCK_PREFIX "cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
-
-/*
- * Always use locked operations when touching memory shared with a
- * hypervisor, since the system may be SMP even if the guest kernel
- * isn't.
- */
-static inline unsigned long __sync_cmpxchg(volatile void *ptr,
-					   unsigned long old,
-					   unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("lock; cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("lock; cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("lock; cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
-
-static inline unsigned long __cmpxchg_local(volatile void *ptr,
-					    unsigned long old,
-					    unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
-
 static inline unsigned long long __cmpxchg64(volatile void *ptr,
 					     unsigned long long old,
 					     unsigned long long new)
diff --git a/arch/x86/include/asm/cmpxchg_64.h b/arch/x86/include/asm/cmpxchg_64.h
index 52de72e..485ae41 100644
--- a/arch/x86/include/asm/cmpxchg_64.h
+++ b/arch/x86/include/asm/cmpxchg_64.h
@@ -3,9 +3,6 @@
 
 #include <asm/alternative.h> /* Provides LOCK_PREFIX */
 
-#define xchg(ptr, v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v), \
-						 (ptr), sizeof(*(ptr))))
-
 #define __xg(x) ((volatile long *)(x))
 
 static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
@@ -15,167 +12,118 @@ static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
 
 #define _set_64bit set_64bit
 
+extern void __xchg_wrong_size(void);
+extern void __cmpxchg_wrong_size(void);
+
 /*
  * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
  * Note 2: xchg has side effect, so that attribute volatile is necessary,
  *	  but generally the primitive is invalid, *ptr is output argument. --ANK
  */
-static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
-				   int size)
-{
-	switch (size) {
-	case 1:
-		asm volatile("xchgb %b0,%1"
-			     : "=q" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 2:
-		asm volatile("xchgw %w0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 4:
-		asm volatile("xchgl %k0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	case 8:
-		asm volatile("xchgq %0,%1"
-			     : "=r" (x)
-			     : "m" (*__xg(ptr)), "0" (x)
-			     : "memory");
-		break;
-	}
-	return x;
-}
+#define __xchg(x, ptr, size)						\
+({									\
+	__typeof(*(ptr)) __x = (x);					\
+	switch (size) {							\
+	case 1:								\
+		asm volatile("xchgb %b0,%1"				\
+			     : "=q" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 2:								\
+		asm volatile("xchgw %w0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 4:								\
+		asm volatile("xchgl %k0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	case 8:								\
+		asm volatile("xchgq %0,%1"				\
+			     : "=r" (__x)				\
+			     : "m" (*__xg(ptr)), "0" (__x)		\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__xchg_wrong_size();					\
+	}								\
+	__x;								\
+})
+
+#define xchg(ptr, v)							\
+	__xchg((v), (ptr), sizeof(*ptr))
+
+#define __HAVE_ARCH_CMPXCHG 1
 
 /*
  * Atomic compare and exchange.  Compare OLD with MEM, if identical,
  * store NEW in MEM.  Return the initial value in MEM.  Success is
  * indicated by comparing RETURN with OLD.
  */
+#define __raw_cmpxchg(ptr, old, new, size, lock)			\
+({									\
+	__typeof__(*(ptr)) __ret;					\
+	__typeof__(*(ptr)) __old = (old);				\
+	__typeof__(*(ptr)) __new = (new);				\
+	switch (size) {							\
+	case 1:								\
+		asm volatile(lock "cmpxchgb %b1,%2"			\
+			     : "=a"(__ret)				\
+			     : "q"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	case 2:								\
+		asm volatile(lock "cmpxchgw %w1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	case 4:								\
+		asm volatile(lock "cmpxchgl %k1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	case 8:								\
+		asm volatile(lock "cmpxchgq %1,%2"			\
+			     : "=a"(__ret)				\
+			     : "r"(__new), "m"(*__xg(ptr)), "0"(__old)	\
+			     : "memory");				\
+		break;							\
+	default:							\
+		__cmpxchg_wrong_size();					\
+	}								\
+	__ret;								\
+})
 
-#define __HAVE_ARCH_CMPXCHG 1
+#define __cmpxchg(ptr, old, new, size)					\
+	__raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
 
-static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-				      unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile(LOCK_PREFIX "cmpxchgl %k1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 8:
-		asm volatile(LOCK_PREFIX "cmpxchgq %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
+#define __sync_cmpxchg(ptr, old, new, size)				\
+	__raw_cmpxchg((ptr), (old), (new), (size), "lock; ")
 
-/*
- * Always use locked operations when touching memory shared with a
- * hypervisor, since the system may be SMP even if the guest kernel
- * isn't.
- */
-static inline unsigned long __sync_cmpxchg(volatile void *ptr,
-					   unsigned long old,
-					   unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("lock; cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("lock; cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("lock; cmpxchgl %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
+#define __cmpxchg_local(ptr, old, new, size)				\
+	__raw_cmpxchg((ptr), (old), (new), (size), "")
 
-static inline unsigned long __cmpxchg_local(volatile void *ptr,
-					    unsigned long old,
-					    unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		asm volatile("cmpxchgb %b1,%2"
-			     : "=a"(prev)
-			     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 2:
-		asm volatile("cmpxchgw %w1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 4:
-		asm volatile("cmpxchgl %k1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	case 8:
-		asm volatile("cmpxchgq %1,%2"
-			     : "=a"(prev)
-			     : "r"(new), "m"(*__xg(ptr)), "0"(old)
-			     : "memory");
-		return prev;
-	}
-	return old;
-}
+#define cmpxchg(ptr, old, new)						\
+	__cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define sync_cmpxchg(ptr, old, new)					\
+	__sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
+
+#define cmpxchg_local(ptr, old, new)					\
+	__cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
 
-#define cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o),	\
-				       (unsigned long)(n), sizeof(*(ptr))))
 #define cmpxchg64(ptr, o, n)						\
 ({									\
 	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\
 	cmpxchg((ptr), (o), (n));					\
 })
-#define cmpxchg_local(ptr, o, n)					\
-	((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o),	\
-					     (unsigned long)(n),	\
-					     sizeof(*(ptr))))
-#define sync_cmpxchg(ptr, o, n)						\
-	((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o),	\
-					    (unsigned long)(n),		\
-					    sizeof(*(ptr))))
+
 #define cmpxchg64_local(ptr, o, n)					\
 ({									\
 	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\

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

end of thread, other threads:[~2009-10-09 14:24 UTC | newest]

Thread overview: 79+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-27 22:34 Linux 2.6.32-rc1 Linus Torvalds
2009-09-27 23:44 ` Stephen Rothwell
2009-09-27 23:48   ` Diego Calleja
2009-09-27 23:52   ` Linus Torvalds
2009-09-28  0:17     ` Stephen Rothwell
2009-09-28  7:07 ` Eric Dumazet
2009-09-28 15:39   ` Linus Torvalds
2009-09-28 17:15     ` Martin Schwidefsky
2009-09-28 18:41       ` Eric Dumazet
2009-09-28 20:56         ` Martin Schwidefsky
2009-09-29 20:42         ` Eric Dumazet
2009-09-29 21:17           ` Linus Torvalds
2009-09-29 21:22             ` Arjan van de Ven
2009-09-29 21:56               ` Linus Torvalds
2009-09-30 15:07                 ` Arjan van de Ven
2009-09-30 15:27                   ` Eric Dumazet
2009-09-30 15:31                     ` Arjan van de Ven
2009-10-01  0:42                       ` Yuhong Bao
2009-09-30 15:57                   ` Eric Dumazet
2009-09-30 16:13                     ` Arjan van de Ven
2009-09-30 16:14                     ` Linus Torvalds
2009-09-30 18:53                       ` Ingo Molnar
2009-09-30 22:03                         ` [GIT PULL] scheduler fixes Ingo Molnar
2009-10-01  0:42                           ` Linus Torvalds
2009-10-01  0:57                             ` Linus Torvalds
2009-10-01  5:30                               ` Eric Dumazet
2009-10-01  6:11                                 ` Ingo Molnar
2009-10-01  6:18                                   ` Eric Dumazet
2009-10-01  6:42                                     ` Ingo Molnar
2009-10-01  6:59                                       ` Eric Dumazet
2009-10-01  7:28                                       ` Sam Ravnborg
2009-10-01  6:49                                 ` [tip:x86/urgent] x86: Don't generate cmpxchg8b_emu if CONFIG_X86_CMPXCHG64=y tip-bot for Eric Dumazet
2009-10-01  6:40                               ` [tip:x86/urgent] x86: Optimize cmpxchg64() at build-time some more tip-bot for Linus Torvalds
2009-10-02 16:40                               ` [GIT PULL] scheduler fixes Yuhong Bao
2009-10-01  6:05                             ` Ingo Molnar
2009-09-30 16:14                     ` Linux 2.6.32-rc1 Cyrill Gorcunov
2009-09-30 16:55                   ` Stefan Richter
2009-09-30 17:08                     ` Linus Torvalds
2009-09-30 17:40                       ` Stefan Richter
2009-09-30 19:32                   ` Ingo Molnar
2009-09-30 19:35                     ` Ingo Molnar
2009-09-30 20:16                     ` Eric Dumazet
2009-09-30 20:20                       ` Linus Torvalds
2009-09-30 20:22                         ` Ingo Molnar
2009-09-30 20:38                           ` Ingo Molnar
2009-10-01  7:18                             ` Arjan van de Ven
2009-09-30 19:37                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
2009-09-30 19:37                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Arjan van de Ven
2009-09-30 19:39                     ` Ingo Molnar
2009-09-30 19:39                   ` tip-bot for Eric Dumazet
2009-09-30 20:19                   ` Linux 2.6.32-rc1 Linus Torvalds
2009-09-30 20:24                     ` Eric Dumazet
2009-09-30 20:41                       ` Linus Torvalds
2009-09-30 20:49                         ` Ingo Molnar
2009-09-30 20:53                           ` Eric Dumazet
2009-09-30 21:00                             ` Ingo Molnar
2009-09-30 20:54                         ` Linus Torvalds
2009-09-30 21:53                         ` David Miller
2009-10-01 12:48                         ` Christoph Hellwig
2009-10-01 16:08                           ` Valdis.Kletnieks
2009-10-05 14:39                             ` Peter Zijlstra
2009-09-30 20:40                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
2009-09-30 20:58                     ` Ingo Molnar
2009-09-30 20:40                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Eric Dumazet
2009-09-30 20:55                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
2009-09-30 20:55                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Eric Dumazet
2009-09-30 21:00                   ` [tip:sched/urgent] x86: Provide an alternative() based cmpxchg64() tip-bot for Arjan van de Ven
2009-09-30 21:01                   ` [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64() tip-bot for Eric Dumazet
2009-10-05 16:00             ` [PATCH] x86: Generate cmpxchg build failures Peter Zijlstra
2009-10-05 18:51               ` Maciej Żenczykowski
2009-10-05 19:16               ` Linus Torvalds
2009-10-05 19:33                 ` Peter Zijlstra
2009-10-05 20:54                   ` Linus Torvalds
2009-10-09 14:23                   ` [tip:x86/asm] " tip-bot for Peter Zijlstra
2009-09-28 14:34 ` Linux 2.6.32-rc1 compile error Wolfgang Erig
2009-09-28 15:10   ` Jaswinder Singh Rajput
2009-09-28 15:32     ` Wolfgang Erig
2009-09-28 16:25 ` [PATCH] isdn: fix netjet/isdnhdlc build errors Randy Dunlap
2009-09-28 19:47   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).