android_kernel_motorola_sm6225/arch/x86/kernel/cpu
Peter Zijlstra fa73158710 perf: Fix capabilities bitfield compatibility in 'struct perf_event_mmap_page'
Solve the problems around the broken definition of perf_event_mmap_page::
cap_usr_time and cap_usr_rdpmc fields which used to overlap, partially
fixed by:

  860f085b74 ("perf: Fix broken union in 'struct perf_event_mmap_page'")

The problem with the fix (merged in v3.12-rc1 and not yet released
officially), noticed by Vince Weaver is that the new behavior is
not detectable by new user-space, and that due to the reuse of the
field names it's easy to mis-compile a binary if old headers are used
on a new kernel or new headers are used on an old kernel.

To solve all that make this change explicit, detectable and self-contained,
by iterating the ABI the following way:

 - Always clear bit 0, and rename it to usrpage->cap_bit0, to at least not
   confuse old user-space binaries. RDPMC will be marked as unavailable
   to old binaries but that's within the ABI, this is a capability bit.

 - Rename bit 1 to ->cap_bit0_is_deprecated and always set it to 1, so new
   libraries can reliably detect that bit 0 is deprecated and perma-zero
   without having to check the kernel version.

 - Use bits 2, 3, 4 for the newly defined, correct functionality:

	cap_user_rdpmc		: 1, /* The RDPMC instruction can be used to read counts */
	cap_user_time		: 1, /* The time_* fields are used */
	cap_user_time_zero	: 1, /* The time_zero field is used */

 - Rename all the bitfield names in perf_event.h to be different from the
   old names, to make sure it's not possible to mis-compile it
   accidentally with old assumptions.

The 'size' field can then be used in the future to add new fields and it
will act as a natural ABI version indicator as well.

Also adjust tools/perf/ userspace for the new definitions, noticed by
Adrian Hunter.

Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Also-Fixed-by: Adrian Hunter <adrian.hunter@intel.com>
Link: http://lkml.kernel.org/n/tip-zr03yxjrpXesOzzupszqglbv@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-09-20 09:45:11 +02:00
..
mcheck Bit 12 may or may not be set in MCi_STATUS.MCACOD when 2013-08-12 19:51:43 +02:00
mtrr mm: vmstats: track TLB flush stats on UP too 2013-09-11 15:57:09 -07:00
.gitignore Update .gitignore files for generated targets 2008-10-20 11:24:31 -07:00
amd.c Merge branch 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-09-04 08:42:44 -07:00
bugs.c x86: Get rid of ->hard_math and all the FPU asm fu 2013-06-06 14:32:04 -07:00
bugs_64.c x86/cpu: Clean up various files a bit 2009-07-11 11:24:09 +02:00
centaur.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
common.c x86, asmlinkage: Make several variables used from assembler/linker script visible 2013-08-06 14:20:13 -07:00
cpu.h x86/tlb_info: get last level TLB entry number of CPU 2012-06-27 19:28:24 -07:00
cyrix.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
hypervisor.c x86: Correctly detect hypervisor 2013-08-05 06:35:33 -07:00
intel.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
intel_cacheinfo.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
Makefile perf/x86/amd: AMD IOMMU Performance Counter PERF uncore PMU implementation 2013-06-19 13:04:53 +02:00
match.c x86: Fix typo in MODULE_DEVICE_TABLE example: s/x86_cpu/x86cpu/ 2012-04-16 14:20:19 +02:00
mkcapflags.sh mkcapflags.pl: convert to mkcapflags.sh 2013-04-29 15:54:27 -07:00
mshyperv.c x86: Correctly detect hypervisor 2013-08-05 06:35:33 -07:00
perf_event.c perf: Fix capabilities bitfield compatibility in 'struct perf_event_mmap_page' 2013-09-20 09:45:11 +02:00
perf_event.h perf/x86: Add Silvermont (22nm Atom) support 2013-09-02 08:42:47 +02:00
perf_event_amd.c perf: Convert kmalloc_node(...GFP_ZERO...) to kzalloc_node() 2013-09-02 08:42:49 +02:00
perf_event_amd_ibs.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
perf_event_amd_iommu.c perf/x86/amd: Do not print an error when the device is not present 2013-07-05 08:27:15 +02:00
perf_event_amd_iommu.h perf/x86/amd: AMD IOMMU Performance Counter PERF uncore PMU implementation 2013-06-19 13:04:53 +02:00
perf_event_amd_uncore.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
perf_event_intel.c perf/x86/intel: Fix Silvermont offcore masks 2013-09-12 19:12:27 +02:00
perf_event_intel_ds.c perf: Convert kmalloc_node(...GFP_ZERO...) to kzalloc_node() 2013-09-02 08:42:49 +02:00
perf_event_intel_lbr.c perf/x86/intel: Support Haswell/v4 LBR format 2013-06-19 14:43:35 +02:00
perf_event_intel_uncore.c perf/x86/intel/uncore: Don't use smp_processor_id() in validate_group() 2013-09-20 06:54:36 +02:00
perf_event_intel_uncore.h perf/x86/intel/uncore: Enable EV_SEL_EXT bit for PCU 2013-08-16 17:55:50 +02:00
perf_event_knc.c x86: Constify a few items 2013-03-11 15:11:03 +01:00
perf_event_p4.c perf/x86/intel/P4: Robistify P4 PMU types 2013-04-26 09:31:41 +02:00
perf_event_p6.c x86: Constify a few items 2013-03-11 15:11:03 +01:00
perfctr-watchdog.c perf/x86: Add support for Intel Xeon-Phi Knights Corner PMU 2012-10-04 13:32:37 +02:00
powerflags.c update AMD powerflags comments 2013-05-28 12:02:10 +02:00
proc.c x86: Get rid of ->hard_math and all the FPU asm fu 2013-06-06 14:32:04 -07:00
rdrand.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
scattered.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
topology.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
transmeta.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
umc.c x86: delete __cpuinit usage from all x86 files 2013-07-14 19:36:56 -04:00
vmware.c x86: Correctly detect hypervisor 2013-08-05 06:35:33 -07:00