Patches contributed by Eötvös Lorand University


commit eff430de53be6f3328c3eebe93755f1ecf499e37
Merge: 9cbdb702092a 91e8549bde9e
Author: Ingo Molnar <mingo@elte.hu>
Date:   Fri Apr 22 10:19:26 2011 +0200

    Merge branch 'linus' into perf/core
    
    Merge reason: Pick up upstream fixes.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

commit b52c55c6a25e4515b5e075a989ff346fc251ed09
Author: Ingo Molnar <mingo@elte.hu>
Date:   Fri Apr 22 08:44:38 2011 +0200

    x86, perf event: Turn off unstructured raw event access to offcore registers
    
    Andi Kleen pointed out that the Intel offcore support patches were merged
    without user-space tool support to the functionality:
    
     |
     | The offcore_msr perf kernel code was merged into 2.6.39-rc*, but the
     | user space bits were not. This made it impossible to set the extra mask
     | and actually do the OFFCORE profiling
     |
    
    Andi submitted a preliminary patch for user-space support, as an
    extension to perf's raw event syntax:
    
     |
     | Some raw events -- like the Intel OFFCORE events -- support additional
     | parameters. These can be appended after a ':'.
     |
     | For example on a multi socket Intel Nehalem:
     |
     |    perf stat -e r1b7:20ff -a sleep 1
     |
     | Profile the OFFCORE_RESPONSE.ANY_REQUEST with event mask REMOTE_DRAM_0
     | that measures any access to DRAM on another socket.
     |
    
    But this kind of usability is absolutely unacceptable - users should not
    be expected to type in magic, CPU and model specific incantations to get
    access to useful hardware functionality.
    
    The proper solution is to expose useful offcore functionality via
    generalized events - that way users do not have to care which specific
    CPU model they are using, they can use the conceptual event and not some
    model specific quirky hexa number.
    
    We already have such generalization in place for CPU cache events,
    and it's all very extensible.
    
    "Offcore" events measure general DRAM access patters along various
    parameters. They are particularly useful in NUMA systems.
    
    We want to support them via generalized DRAM events: either as the
    fourth level of cache (after the last-level cache), or as a separate
    generalization category.
    
    That way user-space support would be very obvious, memory access
    profiling could be done via self-explanatory commands like:
    
      perf record -e dram ./myapp
      perf record -e dram-remote ./myapp
    
    ... to measure DRAM accesses or more expensive cross-node NUMA DRAM
    accesses.
    
    These generalized events would work on all CPUs and architectures that
    have comparable PMU features.
    
    ( Note, these are just examples: actual implementation could have more
      sophistication and more parameter - as long as they center around
      similarly simple usecases. )
    
    Now we do not want to revert *all* of the current offcore bits, as they
    are still somewhat useful for generic last-level-cache events, implemented
    in this commit:
    
      e994d7d23a0b: perf: Fix LLC-* events on Intel Nehalem/Westmere
    
    But we definitely do not yet want to expose the unstructured raw events
    to user-space, until better generalization and usability is implemented
    for these hardware event features.
    
    ( Note: after generalization has been implemented raw offcore events can be
      supported as well: there can always be an odd event that is marginally
      useful but not useful enough to generalize. DRAM profiling is definitely
      *not* such a category so generalization must be done first. )
    
    Furthermore, PERF_TYPE_RAW access to these registers was not intended
    to go upstream without proper support - it was a side-effect of the above
    e994d7d23a0b commit, not mentioned in the changelog.
    
    As v2.6.39 is nearing release we go for the simplest approach: disable
    the PERF_TYPE_RAW offcore hack for now, before it escapes into a released
    kernel and becomes an ABI.
    
    Once proper structure is implemented for these hardware events and users
    are offered usable solutions we can revisit this issue.
    
    Reported-by: Andi Kleen <ak@linux.intel.com>
    Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Link: http://lkml.kernel.org/r/1302658203-4239-1-git-send-email-andi@firstfloor.org
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index eed3673a8656..632e5dc9c9c0 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -586,8 +586,12 @@ static int x86_setup_perfctr(struct perf_event *event)
 			return -EOPNOTSUPP;
 	}
 
+	/*
+	 * Do not allow config1 (extended registers) to propagate,
+	 * there's no sane user-space generalization yet:
+	 */
 	if (attr->type == PERF_TYPE_RAW)
-		return x86_pmu_extra_regs(event->attr.config, event);
+		return 0;
 
 	if (attr->type == PERF_TYPE_HW_CACHE)
 		return set_ext_hw_attr(hwc, event);

commit 42ac9e87fdd89b77fa2ca0a5226023c1c2d83226
Merge: 057f3fadb347 f0e615c3cb72
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Apr 21 11:39:21 2011 +0200

    Merge commit 'v2.6.39-rc4' into sched/core
    
    Merge reason: Pick up upstream fixes.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

commit 68d2cf25d39324c54b5e42de7915c623a0917abe
Merge: 176fcc5c5f01 5d2cd90922c7
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Apr 19 07:55:58 2011 +0200

    Merge branch 'perf/urgent' into perf/core
    
    Merge reason: we'll be queueing up dependent changes.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

commit 6ddafdaab3f809b110ada253d2f2d4910ebd3ac5
Merge: 3905c54f2bd2 bd8e7dded88a
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Apr 18 14:53:18 2011 +0200

    Merge branch 'sched/locking' into sched/core
    
    Merge reason: the rq locking changes are stable,
                  propagate them into the .40 queue.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

commit a4c98f8bbeafee12c979c90743f6fda94f7515c7
Merge: f4ad9bd208c9 85f2e689a5c8
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Apr 14 08:50:37 2011 +0200

    Merge branch 'linus' into sched/locking
    
    Merge reason: Pick up this upstream commit:
    
      6631e635c65d: block: don't flush plugged IO on forced preemtion scheduling
    
    As it modifies the scheduler and we'll queue up dependent patches.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

commit f64fac86f9cd375743ed34385efc8a7732fa8e7b
Merge: 6221f222c0eb 1d46ea2a6a40
Author: Ingo Molnar <mingo@elte.hu>
Date:   Wed Apr 6 13:09:00 2011 +0200

    Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/urgent

commit 9402efaa96e4c047dcc63ad5db65384c328aee5f
Merge: 78fca1b95837 711b8c87a5fe
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Apr 4 16:39:20 2011 +0200

    Merge branch 'x86-mm' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc into x86/mm

commit 5679027e74126e0dfc860869b0e7ceab1dd06318
Merge: ccd0d44fad38 a4dd99250dc4
Author: Ingo Molnar <mingo@elte.hu>
Date:   Fri Apr 1 21:14:04 2011 +0200

    Merge branch 'rcu/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-2.6-rcu into core/urgent

commit 438008af63f8fb3a061c31d331e150fba6eaa103
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Nov 13 11:51:57 2008 +0100

    sound: Add delay.h to sound/soc/codecs/sn95031.c
    
    This is further fallout from delay.h removal from asm/apic.h and asm/dma.h:
    
      ca444564a947: x86: Stop including <linux/delay.h> in two asm header files
    
    Which caused this build failure:
    
      sound/soc/codecs/sn95031.c: In function ‘sn95031_get_mic_bias’:
      sound/soc/codecs/sn95031.c:153:2: error: implicit declaration of function ‘msleep’ [-Werror=implicit-function-declaration]
    
    Cc: Jean Delvare <khali@linux-fr.org>
    Cc: James E.J. Bottomley <James.Bottomley@suse.de>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Cc: Stephen Rothwell <sfr@canb.auug.org.au>
    LKML-Reference: <20110325152014.297890ec@endymion.delvare>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c
index 2a30eae1881c..a54d2a5b28f6 100644
--- a/sound/soc/codecs/sn95031.c
+++ b/sound/soc/codecs/sn95031.c
@@ -26,7 +26,9 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/platform_device.h>
+#include <linux/delay.h>
 #include <linux/slab.h>
+
 #include <asm/intel_scu_ipc.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>