Blame src/perfctr-2.6.x/linux/drivers/perfctr/RELEASE-NOTES

Packit 577717
$Id: RELEASE-NOTES,v 1.234.2.166 2010/11/07 19:48:14 mikpe Exp $
Packit 577717
Packit 577717
RELEASE NOTES
Packit 577717
=============
Packit 577717
Packit 577717
Version 2.6.42, 2010-11-07
Packit 577717
- x86.c: identify Intel Family 6 Models 37 and 44 as Westmere not Nehalem.
Packit 577717
- x86.c: do_init_tests() calls perfctr_x86_init_tests() which is __init,
Packit 577717
  therefore mark do_init_tests() also as __init.
Packit 577717
Packit 577717
Version 2.6.41, 2010-06-08
Packit 577717
- x86: Add support for OFFCORE_RSP_{0,1} on Nehalem/Westmere.
Packit 577717
- x86: Recognise Intel family 6 models 30 and 37 as Nehalems.
Packit 577717
  Update comments mapping product lines to model numbers.
Packit 577717
- x86: Rename PERFCTR_X86_INTEL_COREI7 CPU/PMU type constant to
Packit 577717
  PERFCTR_X86_INTEL_NHLM. Update driver to print "Nehalem" rather
Packit 577717
  than "Core i7" when a CPU of this type is detected.
Packit 577717
Packit 577717
Version 2.6.40, 2010-01-30
Packit 577717
- x86: add comment after #endif terminating big kernel >= 2.6.19 block
Packit 577717
- x86: handle cpumask API change in kernel 2.6.32
Packit 577717
- x86: recognize Intel Family 6 Model 2Eh processors (Nehalem Xeon 7500).
Packit 577717
- x86: recognize Intel Family 6 Model 2Ch processors (i7-980X, Gulftown).
Packit 577717
- x86: recognize AMD Family 11h processors, support them as 10h ones.
Packit 577717
Packit 577717
Version 2.6.39, 2009-06-11
Packit 577717
- ppc and arm: updates to match perfctr_cpu_update_control() changes,
Packit 577717
  add missing #include <asm/cputype.h> to arm.c
Packit 577717
- global.c: coding style fixups
Packit 577717
- x86.c: update AMD multicore detection to match the documentation
Packit 577717
  and actually work on current processors, set up cpumask of all
Packit 577717
  core0 CPUs, detect RevE processors, update p6_like_check_control()
Packit 577717
  to allow per-thread sessions to use AMD NB events on post-RevE
Packit 577717
  processors but limit them to core0 CPUs
Packit 577717
- x86.c: replace is_global parameter to perfctr_cpu_update_control()
Packit 577717
  with a cpumask_t pointer, make P4 update this cpumask instead of
Packit 577717
  hard-coding the use of perfctr_cpus_forbidden_mask in virtual.c,
Packit 577717
  add cpumask to struct vperfctr, update virtual.c to use the cpumask
Packit 577717
  from perfctr_cpu_update_control() not perfctr_cpus_forbidden_mask
Packit 577717
  to derive the task's new cpumask, update set_cpus_allowed() callback
Packit 577717
  to validate new cpumask against the vperfctr's private one, update
Packit 577717
  global.c to pass a NULL cpumask_t pointer
Packit 577717
- virtual.c: rearrange sys_vperfctr_control() so that set_cpus_allowed()
Packit 577717
  comes after perfctr_cpu_update_control(), record updater's ->tgid so
Packit 577717
  races with concurrent updaters can be detected and handled
Packit 577717
- virtual.c: make vperfctrfs_dentry_operations 'const' in 2.6.30 and
Packit 577717
  later kernels.
Packit 577717
- x86.c: silence MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL redefinition warning.
Packit 577717
Packit 577717
Version 2.6.38, 2009-01-23
Packit 577717
- Remove 2.4 kernel support from <linux/perfctr.h> (cpumask_t workaround).
Packit 577717
- Remove 2.4 kernel support from build system.
Packit 577717
- Remove 2.4 kernel support from .c files.
Packit 577717
- Remove 2.4 kernel support from .h files.
Packit 577717
- Kernel 2.6.29-rc1 changed remap_pfn_range() to WARN_ON when applied
Packit 577717
  to plain RAM. Update virtual.c to use vm_insert_page() instead.
Packit 577717
- Kernel 2.6.29-rc1 moved a task's fsuid/fsgid field to the ->cred
Packit 577717
  struct. Update virtual.c to use current_fsuid() and current_fsgid().
Packit 577717
  Update compat.h to supply these macros for older kernels.
Packit 577717
Packit 577717
Version 2.6.37, 2008-11-30
Packit 577717
- x86: Preliminary Intel Core i7 support, limited to handling it
Packit 577717
  as a Core2-like processor with four PMCs. The AnyThread evntsel
Packit 577717
  flag and off-core/uncore monitoring are not yet supported.
Packit 577717
- x86: Recognise Intel Family 6 Model 29 (Xeon 7400) as Core 2.
Packit 577717
- x86: Make core2_clear_counters() also clear the FREEZE_PERFMON_ON_PMI
Packit 577717
  bit in DEBUGCTLMSR. vtune leaves this bit set, which breaks perfctr.
Packit 577717
- x86: Make perfctr_clear_counters() initialise MSR_CORE_PERF_GLOBAL_CTRL
Packit 577717
  during initialisation. This fixes compatibility issues with drivers
Packit 577717
  that may leave this register cleared == all counters disabled. vtune
Packit 577717
  is reported to do this. Add ->clear_counters() op to perfctr_pmu_msrs
Packit 577717
  to handle this cleanly. Convert Via C3 to use this mechanism instead
Packit 577717
  of being a special case.
Packit 577717
Packit 577717
Version 2.6.36, 2008-10-19
Packit 577717
- x86: Limit the value written to a fixed-function counter's MSR
Packit 577717
  to 40 bits. Extraneous high bits cause GP faults on Model 23
Packit 577717
  Core2s, while earlier processors would just ignore them.
Packit 577717
- Kernel 2.6.27-rc1 dropped the retry parameter to on_each_cpu()
Packit 577717
  and smp_call_function(). Adjust accordingly. Add compatibility
Packit 577717
  wrappers for older kernels.
Packit 577717
- Kernel 2.6.27-rc1 removed find_task_by_pid(). Migrate to new
Packit 577717
  find_task_by_vpid(). Add compatibility wrapper for older kernels.
Packit 577717
- Starting with kernel 2.6.27-rc1 one should use alloc_intr_gate()
Packit 577717
  not set_intr_gate() on x86 when binding a specific vector, as this
Packit 577717
  also marks the vector as allocated. Adjust <asm-x86/perfctr.h>.
Packit 577717
Packit 577717
Version 2.6.35, 2008-06-30
Packit 577717
- x86: Preliminary Intel Atom support:
Packit 577717
  * add Atom CPU type, it differs from all previous models
Packit 577717
  * Atom is poorly documented, so query cpuid leaf 0xA for
Packit 577717
    its architectural PMU capabilities; initial Atoms appear
Packit 577717
    to have APM V3, 2 40-bit general-purpose counters, 7
Packit 577717
    architectural events, and 1 40-bit fixed-function counter
Packit 577717
- x86: Replace the p6_is_core2 flag with separate variables
Packit 577717
  indicating (a) having per-evntsel enable bits, and (b) the
Packit 577717
  number of fixed-function counters available.
Packit 577717
- x86: intel_p6_init(): recognise Celeron model 16h and
Packit 577717
  treat it as a Core 2.
Packit 577717
- x86: Clean up intel_p6_init(): replace complex if conditions
Packit 577717
  with explicit switches on x86_model, explicitly enumerate
Packit 577717
  accepted model numbers.
Packit 577717
- x86: Correct p6_like_check_control() to reject regular
Packit 577717
  pmcs >= 2 on Core2 before mapping fixed-function counters
Packit 577717
  0x40000000+N to pmcs 2+N for duplicate counter checking.
Packit 577717
  The failure to reject those invalid pmcs made it possible
Packit 577717
  for users to cause the driver to perform invalid wrmsr and
Packit 577717
  rdpmc accesses with kernel hangs as the result.
Packit 577717
Packit 577717
Version 2.6.35-pre1, 2008-06-23
Packit 577717
- Add optional close-on-exec feature for per-process perfctrs:
Packit 577717
  * reassign _reserved1 as flags in vperfctr_control
Packit 577717
  * add VPERFCTR_CONTROL_CLOEXEC flag
Packit 577717
  * add perfctr_flush_thread() hook to exec() path
Packit 577717
  * map perfctr_flush_thread() to __vperfctr_flush() via
Packit 577717
    inline functions and virtual_stub.c
Packit 577717
  * in __virtual_flush(), if CLOEXEC is set then unlink the state
Packit 577717
  * bump API version to 5.2
Packit 577717
Packit 577717
Version 2.6.34, 2008-05-29
Packit 577717
- Reorder kernel version and HAVE_EXPORT___put_task_struct
Packit 577717
  tests in compat.h to handle the SuSE 2.6.16.42-0.12 kernel
Packit 577717
  exporting __put_task_struct_cb().
Packit 577717
- Fix warning about DONT_HAVE_i_blksize being undefined in
Packit 577717
  the SuSE 2.6.16.42-0.12 kernel.
Packit 577717
Packit 577717
Version 2.6.33, 2008-05-18
Packit 577717
- x86: Intel Family 6 Model 23 support missed that it needs
Packit 577717
  to trigger LVTPC reinit. Fix that.
Packit 577717
Packit 577717
Version 2.6.32, 2008-04-20
Packit 577717
- x86: Recognize Intel Family 6 Model 23 as Core2.
Packit 577717
- x86: Update perfctr_sysclass definition for kernel 2.6.25.
Packit 577717
Packit 577717
Version 2.6.31, 2008-01-26
Packit 577717
- x86: Correct Barcelona CPU type to read FAM10H not FAM10
Packit 577717
  w/o the trailing H. In struct perfctr_cpu_control, place
Packit 577717
  p4 struct in a union and alias p4.escr[] with envtsel_high[]:
Packit 577717
  this allows passing high 32 evntsel bits for Barcelona.
Packit 577717
  Update driver to also manage high 32 evntsel bits on Barcelona,
Packit 577717
  on other processors those bits are forced to zero.
Packit 577717
Packit 577717
Version 2.6.30, 2007-10-28
Packit 577717
- x86: Kernel 2.6.24-rc1 changed the calling convention for
Packit 577717
  the cpu_data macro. Updated accordingly, and added compat
Packit 577717
  code providing the new behaviour in older kernels.
Packit 577717
- ppc32: Kernel 2.6.24-rc1 removed the get_property() compat
Packit 577717
  macro. Use of_get_property() with kernels >= 2.6.22.
Packit 577717
- The workaround for RHEL5 removing ptrace_check_attach()
Packit 577717
  only works when perfctr is built as a module. Fix it to
Packit 577717
  also work in the non-modular case.
Packit 577717
Packit 577717
Version 2.6.29, 2007-10-07
Packit 577717
- Add new cpu_type for AMD Family 10h, to reduce confusion.
Packit 577717
- Very preliminary support for AMD Family 10h processors.
Packit 577717
  They will need a new cpu_type and support for 64-bit evntsels.
Packit 577717
  For now pretend they are K8C processors.
Packit 577717
- Silence compilation warnings on ppc32.
Packit 577717
- Intel has finally documented how to read the Core 2's
Packit 577717
  fixed-function performance counters in user-space:
Packit 577717
  rdpmc 0x4000000N for N=0,1,2. Support them from user-space
Packit 577717
  by pretending they have P6-like evntsels, and extract the
Packit 577717
  useful controls (CPL+INT) into the fixed-function counters
Packit 577717
  control register. Update the P6 driver methods to handle the
Packit 577717
  fact that a fixed-function counter has no private evntsel MSR.
Packit 577717
  Update x86_tests to measure the cost of reading these counters
Packit 577717
  and writing their shared control register.
Packit 577717
- More Intel CPU detection cleanup: separate detection needed
Packit 577717
  by the driver from that done to supply cpu_type to user-space.
Packit 577717
- Clean up Intel CPU detection by moving family 5, 6, and 15
Packit 577717
  detection code to separate procedures.
Packit 577717
- Use #undef to silence macro redefinition warnings on x86.
Packit 577717
- Kernel 2.6.22 removed the rdtsc() macro from i386. Unbreak
Packit 577717
  and clean up x86_tests.c by using our own rdtsc_low() macro.
Packit 577717
Packit 577717
Version 2.6.28, 2007-07-18
Packit 577717
- x86: The kernel's perfctr/nmi management system changed again
Packit 577717
  in 2.6.22-rc5. Call {disable,enable}_lapic_nmi_watchdog() not
Packit 577717
  {stop,setup}_apic_nmi_watchdog() in kernels >= 2.6.22.
Packit 577717
- ppc.c: kernel 2.6.22-rc1 removed find_type_devices(),
Packit 577717
  use of_find_node_by_type() and of_node_put() instead
Packit 577717
- compat.h: fix warnings in CONFIG_UTRACE check
Packit 577717
Packit 577717
Version 2.6.27, 2007-04-09
Packit 577717
- Bumped copyright years on recently updated files.
Packit 577717
- RHEL5 2.6.18-8.1.1.el5 added export of __put_task_struct.
Packit 577717
  Patched <linux/config.h> to signal this.
Packit 577717
- RHEL5 2.6.18-8.1.1.el5 removed i_blksize. Patched
Packit 577717
  <linux/config.h> to signal this. Check this in virtual.c.
Packit 577717
- RHEL5 2.6.18-8.1.1.el5 replaced ptrace with utrace, breaking
Packit 577717
  the remote control API which needs ptrace_check_attach().
Packit 577717
  For now, stub ptrace_check_attach() so that things build.
Packit 577717
- The {reserve,release}_{perfctr,evntsel}_nmi() API changed
Packit 577717
  in kernel 2.6.21-rc6, from being CPU-local to being global.
Packit 577717
  Updated x86.c to handle this change.
Packit 577717
Packit 577717
Version 2.6.26, 2007-02-11
Packit 577717
- Updates to show my @it.uu.se email address in some messages,
Packit 577717
  as the old @csd.uu.se address now is /dev/null.
Packit 577717
- Added driver support for ARM/XScale processors. Overflow
Packit 577717
  interrupts are not yet supported, in part due to conflicts
Packit 577717
  with Intel's ixp400_eth driver. Plain event counting works.
Packit 577717
- Kernel 2.6.20-rc1 moved filp->f_dentry and filp->f_vfsmnt into
Packit 577717
  the filp->fpath substructure. Added compat macros to handle this.
Packit 577717
- Kernel 2.6.20-rc1 changed how pipefs handles its dentries.
Packit 577717
  Adapted those changes to vperfctrfs.
Packit 577717
Packit 577717
Version 2.6.25, 2006-10-15
Packit 577717
- x86.c: Intel Core 2 is substantially different from Intel Core.
Packit 577717
  Add new cpu_type for Core 2, map family 6 model 15 to Core 2,
Packit 577717
  and require Core 2 to set Enable in all EVNTSELs.
Packit 577717
- x86.c: kernel 2.6.19-rc1 removed the {reserve,release}_lapic_nmi()
Packit 577717
  API, and added a {reserve,release}_{perfctr,evntsel}_nmi() API.
Packit 577717
  Reimplement {reserve,release}_lapic_nmi(). Add data to describe
Packit 577717
  the set of perfctr, evntsel, and other MSRs used by a CPU type.
Packit 577717
  Add procedures to reserve and release all of the MSRs. Replace
Packit 577717
  the CPU-specific clear_counters() procedures with a generic one
Packit 577717
  that uses the MSR description data object. Add EXPORT_SYMBOL of
Packit 577717
  {setup,stop}_apic_nmi_watchdog() to x86_setup.c for 2.6.19+ kernels.
Packit 577717
- virtual.c: kernel 2.6.18 dropped EXPORT_SYMBOL(tasklist_lock),
Packit 577717
  so starting with 2.6.18 we must use rcu_read_{lock,unlock}()
Packit 577717
  around find_task_by_pid().
Packit 577717
- virtual.c: kernel 2.6.19-rc1 dropped the inode->i_blksize field.
Packit 577717
- Only #include <linux/config.h> for kernels older than 2.6.19,
Packit 577717
  since 2.6.19-rc1 marks it deprecated. The test is ugly: perhaps
Packit 577717
  this should be handled in the Makefile instead.
Packit 577717
Packit 577717
Version 2.6.24, 2006-09-17
Packit 577717
- x86_tests: fixed linkage error caused by p6_init_tests()
Packit 577717
  not being compiled in 64-bit builds.
Packit 577717
Packit 577717
Version 2.6.23, 2006-08-20
Packit 577717
- Testing done by the PAPI folks indicate that Intel Core 2 has
Packit 577717
  a single master Enable bit in EVNTSEL0, just like previous P6s.
Packit 577717
  Restore Intel Core to the classic P6 rule: EVNTSEL0 must be
Packit 577717
  enabled, EVNTSEL1 must not be enabled.
Packit 577717
- Intel Core updates: each EVNTSEL has its own Enable bit like
Packit 577717
  AMD and P4, recognise Model 15 (Core2), Core2 is 64-bit so
Packit 577717
  make P6 testing code available in both 32- and 64-bit builds.
Packit 577717
- ppc32: correct PMC1SEL and PMC4SEL definitions.
Packit 577717
- virtual: new vperfctrfs_get_sb() for kernel 2.6.18-rc1 and
Packit 577717
  later: ->get_sb() and get_sb_pseudo() changed prototype.
Packit 577717
- x86: #include <asm/nmi.h> to get lapic NMI declarations in
Packit 577717
  kernel 2.6.18-rc1 and later. Do not do this if we're going
Packit 577717
  to stub them because !CONFIG_X86_LOCAL_APIC.
Packit 577717
Packit 577717
Version 2.6.22, 2006-06-02
Packit 577717
- Preliminary support for Intel Core (family 6 model 14) processors.
Packit 577717
- x86: The code to extract max_cores_per_package from CPUID(4):EAX
Packit 577717
  needs cpuid() to put zero in ecx, but it only does that in fairly
Packit 577717
  new 32-bit kernels, not in 64-bit kernels or older 32-bit kernels.
Packit 577717
  This badly broke the SMT_ID detection on a dual-processor dual-core
Packit 577717
  hyper-threaded 64-bit Xeon machine. Fixed by using cpuid_count()
Packit 577717
  instead. Added compatibility definition of it for kernels < 2.6.12.
Packit 577717
- Fixed x86_tests.c compilation error in the i386 2.6.16 kernel
Packit 577717
  by moving sync_core() definition from x86_tests.c to x86_compat.h
Packit 577717
  and only defining it in i386 kernels older than 2.6.16.
Packit 577717
Packit 577717
Version 2.6.21, 2006-04-03
Packit 577717
- Converted mutex-like semaphores to the new mutex type
Packit 577717
  introduced in kernel 2.6.16. Added simulation of the
Packit 577717
  new API in terms of semaphores to compat.h and compat24.h.
Packit 577717
- put_task_struct() uses __put_task_struct() again starting
Packit 577717
  with the 2.6.17-rc1 kernel. Updated compat.h, compat24.h,
Packit 577717
  and virtual_stub.c accordingly.
Packit 577717
- Corrected a botched cleanup of compat24.h in perfctr-2.6.20
Packit 577717
  which broke support for RHEL3 2.4.21 kernels.
Packit 577717
Packit 577717
Version 2.6.20, 2006-03-12
Packit 577717
- Starting with 2.6.16-rc1, put_task_struct() uses an RCU callback
Packit 577717
  __put_task_struct_cb() instead of the old __put_task_struct().
Packit 577717
  2.6.16-rc6 dropped the EXPORT_SYMBOL() of __put_task_struct_cb().
Packit 577717
  Updated compat.h, compat24.h, and virtual_stub.c accordingly.
Packit 577717
Packit 577717
Version 2.6.19, 2006-01-22
Packit 577717
- Updated ppc32 driver for kernel 2.6.16-rc1: dynamically
Packit 577717
  claim the HW and register our interrupt handler via
Packit 577717
  {reserve,release}_pmc_hardware(); simulate these primitives
Packit 577717
  in older kernels; fully migrate patch kit from arch/ppc/
Packit 577717
  to arch/powerpc/.
Packit 577717
Packit 577717
Version 2.6.18, 2006-01-03
Packit 577717
- 2.6.5-7.201-suse added EXPORT_SYMBOL_GPL(__put_task_struct).
Packit 577717
  Added feature #define to the kernel patch, and modified compat.h
Packit 577717
  to disable our export of __put_task_struct in this case.
Packit 577717
- Merged the structure descriptor declarations in marshal.c
Packit 577717
  to avoid duplicating the parts that are identical across
Packit 577717
  all supported platforms.
Packit 577717
Packit 577717
Version 2.6.17, 2005-10-02
Packit 577717
- The dual-core P4s changed the layout rules for the initial
Packit 577717
  APIC ID, which broke the x86 driver on DC P4s. Updated the
Packit 577717
  HT thread ID detection code to match current IA32 SDM Vol3.
Packit 577717
- Kernel 2.4.21-37.EL added EXPORT_SYMBOL_GPL(__put_task_struct).
Packit 577717
  Added new feature #define to the kernel-specific patch for this
Packit 577717
  case. compat24.h now disables our export of __put_task_struct
Packit 577717
  when that feature #define is set.
Packit 577717
- Kernel 2.6.14-rc1 changed the state parameter to ->suspend()
Packit 577717
  methods to be of type 'pm_message_t'. Adjusted x86.c for this,
Packit 577717
  to eliminate a compile-time type mismatch warning.
Packit 577717
Packit 577717
Version 2.6.16, 2005-09-04
Packit 577717
- cpu_khz changed type in kernel 2.6.13. Adjusted x86_setup.c
Packit 577717
  accordingly, to avoid a compile-time error.
Packit 577717
- The ppc32 driver will now compile in kernels that lack Open
Packit 577717
  Firmware support, which is needed for some embedded systems.
Packit 577717
Packit 577717
Version 2.6.15, 2005-05-06
Packit 577717
- Added code to detect multicore K8s and prevent threads in the
Packit 577717
  thread-centric API from using northbridge events. This avoids
Packit 577717
  resource conflicts, and an erratum in Revision E chips.
Packit 577717
- #undef MMCR0_PMXE in ppc_compat.h, to avoid macro redefinition
Packit 577717
  complaints in 2.6 kernels.
Packit 577717
Packit 577717
Version 2.6.14, 2005-04-09
Packit 577717
- x86: Reverted the workaround in perfctr-2.6.13 for the problem
Packit 577717
  that gcc-4.0 snapshots appeared to ignore 'noinline' on static
Packit 577717
  functions, as recent gcc-4.0 prereleases seem to work correctly.
Packit 577717
Packit 577717
Version 2.6.13, 2005-02-13
Packit 577717
- global.c: Allow user-space to disable the in-kernel sampling
Packit 577717
  timer by setting interval_usec == 0 in the START command.
Packit 577717
  In this case sampling is done by the READ command.
Packit 577717
- Modified x86 call backpatching code to avoid breaking with
Packit 577717
  gcc-4.0 snapshots:
Packit 577717
  * gcc-4.0 may clone control flows, resulting in more sites
Packit 577717
    with backpatchable calls. finalise_backpatching() now sets
Packit 577717
    things up to exercise all affected control flow paths.
Packit 577717
  * gcc-4.0 appears to ignore 'noinline' on static functions
Packit 577717
    that are only called from one place, at least on x86-64.
Packit 577717
    This broke perfctr_cpu_{write_control,isuspend,iresume}().
Packit 577717
    Things work again if they are made non-static.
Packit 577717
- Only define our own version of get_sb_pseudo() in kernels older
Packit 577717
  than 2.6.11, since 2.6.11-rc1 added EXPORT_SYMBOL(get_sb_pseudo).
Packit 577717
- In 2.6.11-rc2 and newer kernels, bind ioctls to ->unlocked_ioctl
Packit 577717
  and ->compat_ioctl, and don't use register_ioctl32_conversion().
Packit 577717
- Remove unused inode parameter to gperfctr_ioctl().
Packit 577717
- Define static spinlocks with DEFINE_SPINLOCK(), following new
Packit 577717
  coding style in 2.6.11-rc1. Add compat macros for older kernels.
Packit 577717
Packit 577717
Version 2.6.12, 2004-12-19
Packit 577717
- PPC32 driver updated to be more robust in its detection of
Packit 577717
  timebase and core clock frequencies. Some information sources
Packit 577717
  can give wrong values for those frequencies, so the driver
Packit 577717
  now tries other more reliable methods first.
Packit 577717
Packit 577717
Version 2.6.11, 2004-11-14
Packit 577717
- Compat stuff updated for tsk->sighand->siglock,
Packit 577717
  recalc_sigpending(), and preempt_enable_no_resched().
Packit 577717
- Silence compiler warning from compat.h:remap_pfn_range().
Packit 577717
- PPC32 overflow interrupt support backported from perfctr-2.7.
Packit 577717
- Backported inheritance handling calls from perfctr-2.7
Packit 577717
  to kernel patch kit. They are currently stubs, but can be
Packit 577717
  implemented later without having to update the patch kit.
Packit 577717
- Overflow interrupts fixes backported from perfctr-2.7.7:
Packit 577717
  * x86/x86-64: move perfctr_suspend_thread() call from
Packit 577717
    __switch_to() to the start of switch_to()
Packit 577717
  * x86/x86-64: mask interrupts at suspend and record if
Packit 577717
    any overflows are pending; unmask interrupts at resume
Packit 577717
  * virtual: handle pending overflows in resume path
Packit 577717
  * ppc32: provide dummy pending overflow checking function
Packit 577717
Packit 577717
Version 2.6.10.3, 2004-10-24
Packit 577717
- virtual.c, linux/perfctr.h: reformatted "if( x )" to "if (x)"
Packit 577717
  and similarly for while and switch statements.
Packit 577717
- PPC32: Add support for MPC7447A. Add support for MPC7448,
Packit 577717
  except for decoding its PLL_CFG.
Packit 577717
- Move x86 cpu_type definitions from <linux/perfctr.h>
Packit 577717
  to <asm-i386/perfctr.h>.
Packit 577717
- Make PERFCTR_INTERRUPT_SUPPORT a Kconfig-derived option.
Packit 577717
  Ditto PERFCTR_CPUS_FORBIDDEN_MASK_NEEDED.
Packit 577717
  Also implement this in Config.in for 2.4 kernels.
Packit 577717
- Kernel 2.6.10-rc1 removed the export of put_filp().
Packit 577717
  Reordered the allocations in vperfctr_get_filp() to
Packit 577717
  avoid the need to use put_filp().
Packit 577717
- remap_page_range() was replaced with remap_pfn_range() in
Packit 577717
  kernel 2.6.10-rc1. Updated virtual.c accordingly, and added
Packit 577717
  remap_pfn_range() emulations for older kernels.
Packit 577717
Packit 577717
Version 2.6.10.2, 2004-10-19
Packit 577717
- virtual.c: replace nrctrs_lock with a mutex. Avoids illegal
Packit 577717
  may-sleep-while-holding-lock, caused by mutex operations in
Packit 577717
  perfctr_cpu_{reserve,release}().
Packit 577717
  Backport from perfctr-2.7.6.
Packit 577717
- PPC32: Correct MMCR0 handling for FCECE/TRIGGER. Read
Packit 577717
  MMCR0 at suspend and then freeze the counters. Move
Packit 577717
  this code from read_counters() to suspend(). At resume,
Packit 577717
  reload MMCR0 to unfreeze the counters. Clean up the
Packit 577717
  cstatus checks controlling this behaviour.
Packit 577717
  Backport from perfctr-2.7.6.
Packit 577717
Packit 577717
Version 2.6.10, 2004-09-14
Packit 577717
- Fixed p4_clear_counters() to not access IQ_ESCR{0,1}
Packit 577717
  on P4 models >= 3.
Packit 577717
Packit 577717
Version 2.6.10-pre1, 2004-08-03
Packit 577717
- Changed x86-64 to use the x86 include file and driver.
Packit 577717
  Intel's 64-bit P4 should now work in the x86-64 kernel.
Packit 577717
- Replaced PERFCTR_INTERRUPT_SUPPORT and NMI_LOCAL_APIC
Packit 577717
  #if:s in x86 code by #ifdef:s on CONFIG_X86_LOCAL_APIC.
Packit 577717
- Use macros to clean up x86 per-cpu cache accesses.
Packit 577717
- Recognize model 13 Pentium-Ms.
Packit 577717
- Changed isuspend_cpu on x86 to be like x86-64's: it
Packit 577717
  now stores a CPU number instead of a cache pointer.
Packit 577717
- x86: make perfctr_cpu_name more approximate.
Packit 577717
- The x86 driver records a simplified CPU type for x86_tests,
Packit 577717
  but this only occurs if PERFCTR_INIT_TESTS is configured.
Packit 577717
  perfctr_info.cpu_type is now unused.
Packit 577717
- Changed P4 driver to set up and check an explicit flag
Packit 577717
  for EXTENDED_CASCADE availability. perfctr_info.cpu_type
Packit 577717
  is now unused except for perfctr_x86_init_tests().
Packit 577717
- x86: Reformatted "if( x )" to "if (x)" and similarly for while
Packit 577717
  and switch statements. Deleted #if 0 blocks.
Packit 577717
Packit 577717
Version 2.6.9, 2004-07-27
Packit 577717
- Fix ppc_check_control() to allow 7400/7410 processors to
Packit 577717
  specify MMCR2[THRESHMULT].
Packit 577717
- PPC32 cleanups: make get_cpu_cache() return pointer not lvalue,
Packit 577717
  eliminate duplicated initialisation/cleanup code.
Packit 577717
- Makefile: enforce -fno-unit-at-a-time with gcc-3.4 on x86,
Packit 577717
  to prevent stack overflow in 2.6 kernels < 2.6.6.
Packit 577717
- Do sync_core() before rdtsc() in x86_tests, to avoid bogus
Packit 577717
  benchmarking data on K8. Add sync_core() implementation for
Packit 577717
  the 32-bit kernel. Add sync_core() benchmark.
Packit 577717
- Added __perfctr_mk_cstatus() to allow x86.c:finalise_backpatching()
Packit 577717
  to create a cstatus with i-mode counters marked as present, but
Packit 577717
  with zero actual counters. This prevents perfctr_cpu_isuspend()
Packit 577717
  from clearing the control register for counter #0 at init-time,
Packit 577717
  when the hardware doesn't belong to this driver. On AMD and P6
Packit 577717
  this would accidentally disable the NMI watchdog.
Packit 577717
- x86: Marked initial targets of backpatchable calls
Packit 577717
  'noinline' to prevent gcc from inlining them, which
Packit 577717
  completely breaks the backpatching mechanism.
Packit 577717
- x86_tests: fix CONFIG_X86_LOCAL_APIC=n linkage error.
Packit 577717
- 2.6.8-rc1 no longer makes cpu_online_map a #define on UP,
Packit 577717
  breaking modules. Reintroduce the macro.
Packit 577717
- 2.6.8-rc1 changed cpus_complement() calling convention.
Packit 577717
  Replace cpus_complement();cpus_and() with cpus_andnot(),
Packit 577717
  and provide cpus_andnot() compat macro.
Packit 577717
- PPC32: support generic CPUs using only the TB.
Packit 577717
- PPC32: query OF for CPU/TB frequencies, drop /proc/cpuinfo
Packit 577717
  parsing code.
Packit 577717
- PPC32: avoid CPU re-detection in tests code.
Packit 577717
- PPC32: clean up and sync with current perfctr-2.7 code.
Packit 577717
Packit 577717
Version 2.6.8, 2004-05-29
Packit 577717
- Added recognition of PowerPC 750GX.
Packit 577717
- Changes for the {reserve,release}_lapic_nmi() API added in
Packit 577717
  kernel 2.6.6 backported from perfctr-2.7.1:
Packit 577717
  * Starting with kernel 2.6.6 we no longer need access to
Packit 577717
    nmi_perfctr_msr, so removed EXPORT_SYMBOL() and <asm/apic.h>
Packit 577717
    patches related to this variable (except for older kernels).
Packit 577717
  * Updated x86.c to use the new API. Added simulation (without
Packit 577717
    the non-conflict guarantees) for older kernels.
Packit 577717
  * Moved hardware reservation to x86.c's "reserve" procedure.
Packit 577717
    The init code now only does read-only hardware detection.
Packit 577717
  * Added a mutex to the reserve/release procedures, eliminating
Packit 577717
  * a long-standing race possibility.
Packit 577717
  * Changed x86.c to reserve and release the hardware around its
Packit 577717
    call to perfctr_x86_init_tests().
Packit 577717
  * Similarly updated x86_64.c for the new API.
Packit 577717
Packit 577717
Version 2.6.7, 2004-05-04
Packit 577717
- Replaced x86_64_tests.{c,h} with x86_tests.{c,h}.
Packit 577717
- sys_device_{,un}register() was renamed as sysdev_{,un}register()
Packit 577717
  in 2.6.4-rc2. Updated x86.c and x86_64.c accordingly, and
Packit 577717
  added a compatibility definition in compat.h.
Packit 577717
- Removed unnecessary '#include "compat.h"' from x86_tests.c.
Packit 577717
- Replaced x86_64_setup.c with x86_setup.c.
Packit 577717
- Replaced x86_64_compat.h with x86_compat.h.
Packit 577717
- Moved perfctr_interrupt entry point from x86_setup.c to patch kit,
Packit 577717
  for kernels older than 2.4.21. Cleanup to facilitate future merge
Packit 577717
  of x86_setup.c and x86_64_setup.c.
Packit 577717
Packit 577717
Version 2.6.6, 2004-02-21
Packit 577717
- Fixed a bug in x86-64's perfctr interrupt entry code in 2.4 kernels,
Packit 577717
  causing it to pass the wrong value for "struct pt_regs*". This
Packit 577717
  was harmless since the retrieved "rip" was unused, but still wrong.
Packit 577717
  Renamed do_perfctr_interrupt to smp_perfctr_interrupt to allow
Packit 577717
  using the 2.4 kernel's standard BUILD_SMP_INTERRUPT macro.
Packit 577717
- Unmask LVTPC after interrupt on Pentium-M. An oprofile user
Packit 577717
  reports that P-M auto-masks LVTPC just like P4. Preliminary
Packit 577717
  measurements indicate a 40 to 60 cycle cost for the apic write
Packit 577717
  on P4s and P6s, so the unmask is not done unconditionally.
Packit 577717
- Measure LVTPC write overhead in x86{,_64}_tests.c.
Packit 577717
- Add Pentium 4 Model 3 detection.
Packit 577717
- The 2.4.21-193 SuSE kernel does EXPORT_SYMBOL(mmu_cr4_features).
Packit 577717
  Add compat24.h workaround for this.
Packit 577717
Packit 577717
Version 2.6.5, 2004-01-26
Packit 577717
- Added perfctr_info.cpu_type constants to <asm-ppc/perfctr.h>.
Packit 577717
- Init filp->f_mapping in virtual.c for 2.6.2-rc1+ kernels.
Packit 577717
- Updated p4_check_control():
Packit 577717
  * Allow ESCR.CPL_T1 to be non-zero when using global-mode
Packit 577717
    counters on HT processors.
Packit 577717
  * Don't require ESCR.CPL_T0 to be non-zero. CPL_T0==0b00
Packit 577717
    is safe and potentially useful (global counters on HT).
Packit 577717
  * Require CCCR.ACTIVE_THREAD==0b11 on non-HT processors, as
Packit 577717
    documented in the IA32 Volume 3 manual. Old non-HT P4s
Packit 577717
    seem to work Ok for all four values (see perfctr-2.6.0-pre3
Packit 577717
    notes), but this is neither guaranteed nor useful.
Packit 577717
- x86.c now detects & records P4 HT-ness also in UP kernels.
Packit 577717
- Added 'is_global' parameter to perfctr_cpu_update_control().
Packit 577717
  This flag is ignored on everything except P4 (sigh).
Packit 577717
Packit 577717
Version 2.6.4, 2004-01-12
Packit 577717
- Added 'tsc_to_cpu_mult' field to struct perfctr_info, replacing
Packit 577717
  '_reserved1'. This is needed on PowerPC to map time-base ticks
Packit 577717
  to actual time. On x86/AMD64, tsc_to_cpu_mult == 1.
Packit 577717
- Added support for PowerPC 604/7xx/74xx processors. Overflow
Packit 577717
  interrupts are currently not allowed due to the PMI/DECR erratum.
Packit 577717
- Replaced perfctr_cpus_mask() with cpus_addr(). Updated cpumask.h
Packit 577717
  to define cpus_addr() for kernels older than 2.6.1.
Packit 577717
Packit 577717
Version 2.6.3-pl1, 2004-01-01
Packit 577717
- Moved the x86 interrupt handler definition from x86_setup.c to
Packit 577717
  the patch kit for 2.4.21 and later 2.4 kernels, like it already
Packit 577717
  is done for 2.6 kernels. This change is needed due to extensive
Packit 577717
  interrupt handler changes in RedHat's 2.4.21-6.EL kernel.
Packit 577717
- Simplified <asm-i386/perfctr.h>: now that early 2.4 kernels no
Packit 577717
  longer are supported, LOCAL_PERFCTR_VECTOR is known to be defined,
Packit 577717
  so CONFIG_X86_LOCAL_APIC implies PERFCTR_INTERRUPT_SUPPORT.
Packit 577717
Packit 577717
Version 2.6.3, 2003-12-21
Packit 577717
- Removed gperfctr_cpu_state_only_cpu_sdesc's total_sizeof
Packit 577717
  optimisation. The ABI change in 2.6.2 broke it, leading to
Packit 577717
  the new fields not being cleared and later causing EOVERFLOW.
Packit 577717
- The perfctr_ioctl32_handler() workaround is now only applied
Packit 577717
  to kernels older than 2.4.23, since 2.4.23 added the "NULL
Packit 577717
  handler == sys_ioctl" logic.
Packit 577717
Packit 577717
Version 2.6.2, 2003-11-23
Packit 577717
- Added 16 bytes (four fields) of reserved data to perfctr_info,
Packit 577717
  perfctr_cpu_control, vperfctr_control, gperfctr_cpu_control,
Packit 577717
  and gperfctr_cpu_state. Renumbered marshalling tags for
Packit 577717
  generic structures. Bumped ABI versions.
Packit 577717
- Only allow use of IQ_ESCR{0,1} on P4 models <= 2. These ESCRs
Packit 577717
  were removed from later models, according to a recent Intel
Packit 577717
  documentation update (252046-006).
Packit 577717
- Fixes for Fedora Core 1's 2.4.22-1.2115.nptl kernel:
Packit 577717
  * Work around their incomplete and broken cpumask_t backport.
Packit 577717
  * Avoid name conflict due to their on_each_cpu() backport.
Packit 577717
  * Handle their preempt_disable()/enable() macros.
Packit 577717
- Added new perfctr_cpu_is_forbidden() macro to fix a
Packit 577717
  compilation error affecting AMD64 in SMP 2.6 kernels.
Packit 577717
  SMP cpu_isset() requires that mask is an lvalue, but
Packit 577717
  for AMD64 the mask is a constant.
Packit 577717
Packit 577717
Version 2.6.1, 2003-10-05
Packit 577717
- Kernel 2.6.0-test6 changed /proc/self and the /proc/<pid>/
Packit 577717
  namespace to refer to "processes" (groups of CLONE tasks)
Packit 577717
  instead of actual kernel tasks. This forced the planned
Packit 577717
  transition of the vperfctr API from /proc/<pid>/perfctr
Packit 577717
  to /dev/perfctr to occur immediately. Changes:
Packit 577717
  * Moved /dev/perfctr implementation from global.c to init.c.
Packit 577717
  * Implemented VPERFCTR_{CREAT,OPEN}, vperfctr_attach(), and
Packit 577717
    the vperfctrfs pseudo-fs needed to support the magic files.
Packit 577717
    The fs code was ported from perfctr-1.6/3.1, but updated
Packit 577717
    for 2.6 and fixed to permit module unloading in 2.4.
Packit 577717
  * Fixed VPERFCTR_OPEN to accept tsk->thread.perfctr == NULL.
Packit 577717
    (Needed to info querying commands.)
Packit 577717
  * Removed /proc/<pid>/perfctr code. Simplified vperfctr_stub code.
Packit 577717
  * Updated vperfctr_attach() to mimic the old /proc vperfctr_open().
Packit 577717
    This fixes some synchronisation issues.
Packit 577717
- Cleanups:
Packit 577717
  * Removed #if checks and code for kernels older than 2.4.16.
Packit 577717
  * Eliminated compat macros that are identical in 2.6 and 2.4.
Packit 577717
  * Moved ptrace_check_attach EXPORT_SYMBOL from x86{,_64}_setup.c
Packit 577717
    to virtual_stub.c.
Packit 577717
  * get_task_by_proc_pid_inode() is now trivial. Eliminated it.
Packit 577717
  * p4_ht_finalise() is now trivial. Eliminated it.
Packit 577717
- Added MODULE_ALIAS() declaration, eliminating the need for
Packit 577717
  an alias in /etc/modprobe.conf with 2.6 kernels. Added
Packit 577717
  MODULE_ALIAS() compatibility #define in compat24.h.
Packit 577717
- Added detection of AMD K8 Revision C processors.
Packit 577717
- Updated K8C detection for Revision C Athlon64s.
Packit 577717
Packit 577717
Version 2.6.0, 2003-09-08
Packit 577717
- Handle set_cpus_allowed() when PERFCTR_CPUS_FORBIDDEN_MASK_NEEDED:
Packit 577717
  * Add bad_cpus_allowed flag to struct vperfctr.
Packit 577717
  * Check bad_cpus_allowed in __vperfctr_resume: if resuming
Packit 577717
    with PMCs on forbidden CPU, kill counters and SIGILL current.
Packit 577717
  * __vperfctr_set_cpus_allowed() callback: set bad_cpus_allowed
Packit 577717
    and print warning if mask allows forbidden CPUs.
Packit 577717
  * Use task_lock/unlock instead of preempt_disable/enable to
Packit 577717
    synchronise task_struct accesses.
Packit 577717
  * Ensure sampling_timer and bad_cpus_allowed share cache line.
Packit 577717
  * #include <linux/compiler.h> explicitly for 2.4.18 and older
Packit 577717
    kernels; newer kernels include it from <linux/kernel.h>.
Packit 577717
  * Hook in virtual_stub.c.
Packit 577717
  * Hook and cpumask_t typedef in <linux/perfctr.h>.
Packit 577717
- Simplify #if test for set_cpus_allowed() emulation code.
Packit 577717
  Also don't define it if CONFIG_PERFCTR_VIRTUAL isn't set.
Packit 577717
- cpumask.h only typedefs cpumask_t if <linux/perfctr.h> hasn't.
Packit 577717
- Don't hide #include <linux/kernel.h> in compat24.h.
Packit 577717
- Fixed compat24.h to test for MODULE not CONFIG_MODULES at the
Packit 577717
  __module_get/module_put macros.
Packit 577717
Packit 577717
Version 2.6.0-pre5, 2003-08-31
Packit 577717
- printk() is not allowed in switch_to(). Disabled debug code
Packit 577717
  which could violate that rule. Changed virtual_stub.c to BUG()
Packit 577717
  instead of printk() if the driver is invoked when not loaded.
Packit 577717
- Renamed vperfctr_exit2() to vperfctr_unlink() for clarity.
Packit 577717
- gcc-3.3.1 issued several "dereferencing type-punned pointer will
Packit 577717
  break strict-aliasing rules" warnings for marshal.c. Used explicit
Packit 577717
  unions to fix the warnings and clean up the code.
Packit 577717
- Removed compat22.h.
Packit 577717
- cpumask_t was included in standard 2.6.0-test4; replace #ifndef
Packit 577717
  test in cpumask.h with normal kernel version test.
Packit 577717
- x86-64 fix: sys_ioctl() isn't exported to modules, so call
Packit 577717
  filp->f_op->ioctl() instead in perfctr_ioctl32_handler().
Packit 577717
- x86-64 fix: init.c must include <asm/ioctl32.h> not <linux/ioctl32.h>
Packit 577717
  for compatibility with 2.4 kernels.
Packit 577717
Packit 577717
Version 2.6.0-pre4, 2003-08-19
Packit 577717
- Fix x86-64 register_ioctl32_conversion() usage for 2.4 kernels:
Packit 577717
  * Supply dummy handler since a NULL handler oopses the kernel.
Packit 577717
  * Test CONFIG_IA32_EMULATION since CONFIG_COMPAT is post-2.4.
Packit 577717
- Fixed and merged the new API struct marshalling code:
Packit 577717
  * New files marshal.c and marshal.h contain the marshalling code
Packit 577717
    and high-level helper functions (source shared with the library).
Packit 577717
  * User-space structs are struct perfctr_struct_buf and accessed using
Packit 577717
    perfctr_copy_{from,to}_user() with ptr to appropriate descriptor.
Packit 577717
    The cpumask stuff isn't changed.
Packit 577717
  * All ioctls registered as trivially 32-bit compatible on x86-64.
Packit 577717
  * Changed perfctr_info cpu_type/cpu_features from short to int:
Packit 577717
    this avoids the need for UINT16 marshalling support, and cpumask_t
Packit 577717
    caused perfctr_info to change binary representation anyway.
Packit 577717
- Declared VPERFCTR_{CREAT,OPEN} ioctls, but left them unimplemented.
Packit 577717
- Fixed vperfctr_open() preemption bug. The O_CREAT check+install
Packit 577717
  code could be preempted, leading to remote-control races.
Packit 577717
- Fixed perfctr_exit_thread() preemption bug. It detached the vperfctr
Packit 577717
  before calling __vperfctr_exit(). If current was preempted before
Packit 577717
  __vperfctr_exit() called vperfctr_suspend(), perfctr_suspend_thread()
Packit 577717
  would fail to suspend the counters. The suspend+detach is now done
Packit 577717
  atomically within __vperfctr_exit().
Packit 577717
- Changes to handle 2.6 kernels with the cpumask_t patch (-mm, -osdl):
Packit 577717
  * Convert perfctr_cpus_forbidden_mask accesses to cpumask_t API.
Packit 577717
    Based in part on a patch for the -osdl kernel by Stephen Hemminger.
Packit 577717
  * Remove cpus and cpus_forbidden from struct perfctr_info,
Packit 577717
    since their sizes depend on the kernel configuration.
Packit 577717
  * Add struct perfctr_cpu_mask to export cpumask_t objects
Packit 577717
    sanely (i.e., using ints not longs) to user-space.
Packit 577717
  * Add CPUS and CPUS_FORBIDDEN commands to retrieve these sets.
Packit 577717
  * Add cpumask.h to emulate cpumask_t API in cpumask_t-free kernels.
Packit 577717
  * Move perfctr_cpus_forbidden_mask declaration/#define from
Packit 577717
    <asm/perfctr.h> to cpumask.h -- necessary since <asm/perfctr.h>
Packit 577717
    doesn't have access to the driver's compatibility definitions.
Packit 577717
- Cleaned up perfctr_cpu_ireload().
Packit 577717
- Removed struct field offset check from init.c.
Packit 577717
- 2.4.22-rc1 does EXPORT_SYMBOL(mmu_cr4_features). Added
Packit 577717
  new compat #define to handle this.
Packit 577717
- Rename x86.c's rdmsrl() to rdmsr_low() to work around msr.h
Packit 577717
  changes in 2.6.0-test3. Also rename rdpmcl() to rdpmc_low().
Packit 577717
- Replaced __attribute__((__aligned__(SMP_CACHE_BYTES))) usage
Packit 577717
  with the official ____cacheline_aligned macro.
Packit 577717
- Detect cpuid 0x69x VIA C3s (Antaur/Nehemiah).
Packit 577717
Packit 577717
Version 2.6.0-pre3, 2003-08-03
Packit 577717
- Changed perfctr_info.cpus and cpus_forbidden to be int instead of
Packit 577717
  long, to make x86-32 and x86-64 compatible. This is a temporary
Packit 577717
  solution, as there are patches for >32 CPUs on x86-32. The real
Packit 577717
  solution is to make these sets variable-sized, and have user-space
Packit 577717
  retrieve them with a new command.
Packit 577717
- Simplified GPERFCTR_CONTROL to update a single CPU instead of
Packit 577717
  a set of CPUs. Moved cstatus clearing to release_hardware().
Packit 577717
- Moved gperfctr start to new GPERFCTR_START command.
Packit 577717
- Simplified GPERFCTR_READ to access a single CPU instead of a
Packit 577717
  set of CPUs.
Packit 577717
- Removed the requirement that CCCR.ACTIVE_THREAD == 3 on P4.
Packit 577717
  HT processors define behaviour for all four possible values,
Packit 577717
  and non-HT processors behave sanely for all four values.
Packit 577717
- Moved struct perfctr_low_ctrs definition from <asm/perfctr.h> to
Packit 577717
  the corresponding low-level driver, since it's only used there.
Packit 577717
- Changed perfctr_info.cpu_khz and vperfctr_control.preserve to be
Packit 577717
  int instead of long. This corrects x86-64 and makes it compatible
Packit 577717
  with x86-32.
Packit 577717
- Updated x86.c to permit extended cascading on P4M2.
Packit 577717
- Fixed a bug where the perfctr module's refcount could be zero with
Packit 577717
  code still running in the module (pending returns to exit_thread()).
Packit 577717
  This could race with rmmod in preemptive kernels, and in theory
Packit 577717
  also in SMP kernels.
Packit 577717
  * module owner field added to vperfctr_stub
Packit 577717
  * _vperfctr_exit() in the modular case is now a function in
Packit 577717
    vperfctr_stub.c, which brackets the vperfctr_stub.exit() call
Packit 577717
    with __module_get() and module_put() on vperfctr_stub.owner
Packit 577717
  * updated 2.4 and 2.2 compat definitions of __module_get() and
Packit 577717
    module_put() to work for modules != THIS_MODULE  
Packit 577717
- Replaced uses of (void)try_module_get() with __module_get() as the
Packit 577717
  latter is more appropriate for 2.6 kernels. Updated compat stuff.
Packit 577717
Packit 577717
Version 2.6.0-pre2, 2003-07-13
Packit 577717
- vperfctr API fixes:
Packit 577717
  * The new VPERFCTR_READ_CONTROL command retrieves a vperfctr's
Packit 577717
    control data.
Packit 577717
  * Renamed VPERFCTR_SAMPLE to VPERFCTR_READ_SUM, and made it
Packit 577717
    write the sums to a perfctr_sum_ctrs user-space buffer.
Packit 577717
  * Non-write commands are now always permitted on unlinked perfctrs.
Packit 577717
  The first change was needed since the control data no longer is
Packit 577717
  accessible via the mmap()ed state. The other changes clean up and
Packit 577717
  simplify perfex and the library's slow-path read_ctrs() operation.
Packit 577717
- sys_vperfctr_ functions now mark the tsk parameter as "const" if
Packit 577717
  they don't need write access to it. Typically they only need to
Packit 577717
  compare it with current to detect self-access cases.
Packit 577717
- perfctr_cpu_state no longer makes the perfctr_cpu_control part
Packit 577717
  accessible to user-space (via mmap() of vperfctrs).
Packit 577717
- Simplified {set,is}_isuspend_cpu() in x86_64.c by having callers
Packit 577717
  pass the CPU number instead of the cache pointer (which was only
Packit 577717
  used to derive the CPU number).
Packit 577717
- Eliminated NMI_LOCAL_APIC #ifs from x86-64 code since x86-64
Packit 577717
  always defines it.
Packit 577717
- x86.c cleanups: the non-PERFCTR_INTERRUPT_SUPPORT case now uses
Packit 577717
  dummy stub functions, eliminated six #ifdefs.
Packit 577717
- x86_64_setup.c needs <asm/fixmap.h>.
Packit 577717
- Protected cpu_has_mmx and cpu_has_ht #defines in x86_compat.h
Packit 577717
  with #ifndef since 2.4.22-pre3 added those #defines.
Packit 577717
- Eliminated PERFCTR_INTERRUPT_SUPPORT #ifs from x86-64 code
Packit 577717
  since x86-64 always defines CONFIG_X86_LOCAL_APIC.
Packit 577717
- Removed the P4-specific versions of isuspend() and iresume().
Packit 577717
  P4 now uses p6_like_{isuspend,iresume}(), just like P6/K7/K8.
Packit 577717
- Long overdue cleanup in x86.c/x86_64.c: renamed per_cpu_cache
Packit 577717
  pointer variables from 'cpu' to 'cache'.
Packit 577717
- Added inline functions in virtual.c for registering the overflow
Packit 577717
  handler and for clearing iresume_cstatus. Cleaned out several
Packit 577717
  #if PERFCTR_INTERRUPT_SUPPORT occurrences from the main code.
Packit 577717
  (Partial backport from the abandoned perfctr-3.1 branch.)
Packit 577717
- Inlined now useless 'struct vperfctr_state' in 'struct vperfctr'.
Packit 577717
Packit 577717
Version 2.6.0-pre1, 2003-07-02
Packit 577717
- Rearranged 'struct perfctr_cpu_state' to reduce the number of
Packit 577717
  cache lines needed to be touched by key operations (suspend,
Packit 577717
  resume, sample). Switched from struct-of-arrays to array-of-struct
Packit 577717
  for perfctr counts, and copied pmc_map into the PMC data array.
Packit 577717
  The old representation touched at least 3 cache lines at key
Packit 577717
  operations, the new one only needs one cache line in most cases.
Packit 577717
  The user-space mmap() view of the new representation is binary
Packit 577717
  compatible between x86 and x86-64.
Packit 577717
- Changed 'isuspend_cpu' in perfctr_cpu_state on x86-64 to be a
Packit 577717
  32-bit CPU number, to maintain binary compatibility with x86.
Packit 577717
- Removed the union of p5_cesr and id; use id throughout.
Packit 577717
- Removed _filler and si_signo from 'struct vperfctr_state', making
Packit 577717
  the user-space view of it identical to 'struct perfctr_cpu_state'.
Packit 577717
Packit 577717
Version 2.5.5, 2003-06-15
Packit 577717
- Updated x86 driver for 2.5.71 local APIC driver model changes.
Packit 577717
- Updated x86-64 driver for 2.5.71 NMI watchdog enable/disable API.
Packit 577717
- x86-64 is broken in 2.5.71 since x86-64 updated to driver model
Packit 577717
  for local APIC and NMI watchdog, at the same time as x86 moved
Packit 577717
  to a newer version of the "system device" driver model. Updated
Packit 577717
  the x86-64 driver for the new model, which is expected to be in
Packit 577717
  x86-64 by 2.5.72 (patch exists for 2.5.71).
Packit 577717
Packit 577717
Version 2.5.4, 2003-06-01
Packit 577717
- The generic-x86-with-TSC driver now uses rdpmc_read_counters
Packit 577717
  and p6_write_control instead of its own procedures.
Packit 577717
- K8 docs are now available. Updated comment in x86.c accordingly.
Packit 577717
- P4 OVF_PMI+FORCE_OVF counters didn't work at all, resulting in
Packit 577717
  BUG messages from the driver since identify_overflow failed to
Packit 577717
  detect which counters had overflowed, and vperfctr_ihandler
Packit 577717
  left the vperfctr in an inconsistent state. This works now.
Packit 577717
  However, hardware quirks makes this configuration only useful
Packit 577717
  for one-shot counters, since resuming generates a new interrupt
Packit 577717
  and the faulting instruction again doesn't complete. The same
Packit 577717
  problem can occur with regular OVF_PMI counters if ireset is
Packit 577717
  a small-magnitude value, like -5.
Packit 577717
  This is a user-space problem; the driver survives.
Packit 577717
- On P4, OVF_PMI+FORCE_OVF counters must have an ireset value of -1.
Packit 577717
  This allows the regular overflow check to also handle FORCE_OVF
Packit 577717
  counters. Not having this restriction would lead to MAJOR
Packit 577717
  complications in the driver's "detect overflow counters" code.
Packit 577717
  There is no loss of functionality since the ireset value doesn't
Packit 577717
  affect the counter's PMI rate for FORCE_OVF counters.
Packit 577717
- Moved P4 APIC_LVTPC reinit from p4_isuspend() to identify_overflow().
Packit 577717
  Reduces context-switch overheads when i-mode counters are active.
Packit 577717
- Corrected vperfctr_suspend()'s precondition.
Packit 577717
- Corrected comment in <asm/perfctr.h> to state that ireset[]
Packit 577717
  values must be negative rather than non-positive.
Packit 577717
- Made 'perfctr_cpu_name' __initdata, like its predecessor.
Packit 577717
Packit 577717
Version 2.5.3.1, 2003-05-21
Packit 577717
- Replaced 'char *perfctr_cpu_name[]' by 'char *perfctr_cpu_name'.
Packit 577717
  This is needed for x86-64 and other non-x86 architectures.
Packit 577717
- Changed <asm-x86_64/perfctr.h> to use 'long long' for 64-bit sums.
Packit 577717
  This doesn't change the ABI, but improves user-space source code
Packit 577717
  compatibility with 32-bit x86.
Packit 577717
- Removed the !defined(set_cpus_allowed) check added to compat24.h
Packit 577717
  in 2.5.3. It's wrong for SMP builds with modules and MODVERSIONS,
Packit 577717
  since the set_cpus_allowed() emulation function becomes a #define
Packit 577717
  from include/linux/modules/x86_setup.ver. Instead add the already
Packit 577717
  used HAVE_SET_CPUS_ALLOWED #define to include/linux/config.h in
Packit 577717
  the kernel patch, but make it conditional on CONFIG_X86_64.
Packit 577717
Packit 577717
Version 2.5.3, 2003-05-16
Packit 577717
- Added detection code for Pentium M. MISC_ENABLE_PERF_AVAIL is
Packit 577717
  now checked on both P4 and Pentium M.
Packit 577717
- Added x86_64 driver code. Both x86_64.c and asm-x86_64/perfctr.h
Packit 577717
  are basically simplified versions of corresponding x86 files,
Packit 577717
  with P5 and P4 support removed, 2.2 kernel support removed, and
Packit 577717
  'long long' for sums replaced by 'long'. The last change is
Packit 577717
  painful for user-space and may be reverted.
Packit 577717
- compat24.h: don't define set_cpus_allowed() if already #defined,
Packit 577717
  workaround for RawHide's 2.4.20-9.2 x86_64 kernel.
Packit 577717
- Removed list of supported CPUs from Kconfig. That information
Packit 577717
  belongs elsewhere (and it's a pain to maintain for 2.2/2.4).
Packit 577717
Packit 577717
Version 2.5.2, 2003-04-13
Packit 577717
- Minor cleanup: use PROC_I() unconditionally in virtual.c,
Packit 577717
  implement trivial compat macro in compat24.h.
Packit 577717
- Updated power management code for the local APIC and NMI
Packit 577717
  watchdog driver model changes in kernel 2.5.67.
Packit 577717
  The suspend/resume procedures are still no-ops, however.
Packit 577717
  This revealed a bug in the lapic_nmi_watchdog resume code:
Packit 577717
  it resumes the lapic_nmi_watchdog even when it was disabled
Packit 577717
  before suspend. Perfctr's 2.5.67 kernel patch includes a fix.
Packit 577717
- perfctr_sample_thread() is now used also on UP. Anton Ertl's
Packit 577717
  2.26GHz UP P4 managed to execute a process for more than 2^32
Packit 577717
  cycles before suspending it, causing TSC inaccuracies.
Packit 577717
- RH9's 2.4.20-8 kernel changed cpu_online(), put_task_struct() and
Packit 577717
  remap_page_range() to be more like in 2.5 kernels, and moved the
Packit 577717
  declaration of ptrace_check_attach() from mm.h to ptrace.h, also
Packit 577717
  like in 2.5 kernels, requiring fixes to compat24.h and x86_setup.c.
Packit 577717
- Added note in x86.c about the new Pentium M processor.
Packit 577717
Packit 577717
Version 2.5.1, 2003-03-23
Packit 577717
- Fix P4 HT initialisation. I've seen several boot logs from
Packit 577717
  people running MP P4 Xeons with HT disabled: this produces
Packit 577717
  an ugly "restricting access for CPUs 0x0" message, and would
Packit 577717
  cause P4 HT init to unnecessarily return error in older kernels
Packit 577717
  lacking set_cpus_allowed(). Now only print the message or
Packit 577717
  signal error if non-zero siblings actually are found.
Packit 577717
- The set_cpus_allowed() emulation doesn't compile in 2.4
Packit 577717
  kernels older than 2.4.15 due to the p->cpus_running field.
Packit 577717
  Updated version checks to skip it in 2.4.x when x<15.
Packit 577717
- Fix set_cpus_allowed() emulation compile error on BUG_ON()
Packit 577717
  in 2.4 kernels older than 2.4.19.
Packit 577717
- Added Nehemiah note/reminder in x86.c:centaur_init().
Packit 577717
Packit 577717
Version 2.5.0, 2003-03-10
Packit 577717
- Reverted the 2.5.0-pre2 change that replaced the PERFCTR_INFO
Packit 577717
  ioctl by read(): it made the API look too weird.
Packit 577717
  Added a PERFCTR_ABI ioctl which only retrieves 'abi_version'.
Packit 577717
- Cleaned up struct perfctr_info: renamed abi_magic to abi_version,
Packit 577717
  and version to driver_version. Renamed PERFCTR_*_MAGIC too.
Packit 577717
- Cleaned up struct perfctr_cpu_control: moved evntsel_aux[]
Packit 577717
  into the p4 sub-struct and renamed it as escr[]. Only P4 needs
Packit 577717
  it anyway, and the new name clarifies its purpose.
Packit 577717
- Renumbered the vperfctr ioctls to the 8-15 range (8-11 are used)
Packit 577717
  and reserved 0-7 (0-1 are used) for generic ioctls.
Packit 577717
- Added 'use_nmi' field to struct gperfctr_control, reserved for
Packit 577717
  future use if/when support for i-mode gperfctrs is implemented.
Packit 577717
- Replaced some preempt/smp_call_function combinations with 2.5.64's
Packit 577717
  new on_each_cpu() construct. Added compatibility definitions to
Packit 577717
  compat24.h and compat22.h.
Packit 577717
Packit 577717
Version 2.5.0-pre2, 2003-03-03
Packit 577717
- Added ABI version to perfctr_info. Replaced PERFCTR_INFO ioctl
Packit 577717
  by read() on the fd, since that allows reading the ABI version
Packit 577717
  even in the case of a version mismatch. Removed binary layout
Packit 577717
  magic number from vperfctr_state. Rearranged perfctr_info to
Packit 577717
  make the 'long' fields 8-byte aligned.
Packit 577717
- Added #ifdef CONFIG_KPERFCTR to <linux/perfctr.h> to ensure
Packit 577717
  that <asm/perfctr.h> isn't included unless CONFIG_KPERFCTR=y.
Packit 577717
  This allows the patched kernel source to compile cleanly also
Packit 577717
  in archs not yet supported by perfctr.
Packit 577717
- Removed PERFCTR_PROC_PID_MODE #define and replaced it with
Packit 577717
  /*notype*/S_IRUSR in the patch files.
Packit 577717
- Added perfctr_vector_init() to <asm-i386/perfctr.h>. Cleaned
Packit 577717
  up arch/i386/kernel/i8259.c patch.
Packit 577717
- Removed apic_lvtpc_irqs[] array. Removed irq.c patch.
Packit 577717
- Updated CONFIG_PERFCTR_INIT_TESTS help text to match reality.
Packit 577717
- Kernel 2.4.21-pre5 added set_cpus_allowed(), which required
Packit 577717
  fixing compat24.h and x86_setup.c.
Packit 577717
- Fixed init.c for kernel 2.5.63 removing EXPORT_NO_SYMBOLS.
Packit 577717
- Cleaned up compat.h by moving 2.2/2.4 stuff to separate files.
Packit 577717
Packit 577717
Version 2.5.0-pre1, 2003-02-19
Packit 577717
- Repair global perfctr API: the target CPUs are now explicit
Packit 577717
  in the calls to write control and read state. Global perfctrs
Packit 577717
  now work on 2.5 SMP kernels (which no longer have smp_num_cpus
Packit 577717
  or cpu_logical_map()), and HT P4s (asymmetric MPs).
Packit 577717
- struct perfctr_info has new bitmask fields for the set of CPUs
Packit 577717
  (cpu_online_map) and forbidden CPUs; dropped the nrcpus field.
Packit 577717
- add cpu_online() compat macro to compat.h
Packit 577717
- VPERFCTR_STOP is subsumed by VPERFCTR_CONTROL. Removed it.
Packit 577717
- Detect K8 as K8 not K7. They are not identical.
Packit 577717
- Makefile cleanup: moved 2.4/2.2 kernel stuff to Makefile24.
Packit 577717
- Makefile fix: removed export-objs for 2.5 kernels.
Packit 577717
- Kconfig fix: don't mention obsolete .o module suffix.
Packit 577717
Packit 577717
Version 2.4.5, 2003-02-09
Packit 577717
- Fixed two minor compile warnings in x86_tests.c for 2.5 kernels.
Packit 577717
Packit 577717
Version 2.4.4, 2003-01-18
Packit 577717
- Fixed a bug in iresume() where an interrupt-mode counter could
Packit 577717
  increment unexpectedly, and also miss the overflow interrupt.
Packit 577717
  The following setup would cause the problem:
Packit 577717
      P1 has EVNTSELn in non-interrupt mode, counting some high-
Packit 577717
  frequency event (e.g. INST_RETIRED) in kernel-mode. P2 has
Packit 577717
  EVNTSELn in interrupt-mode, counting some low-frequency event
Packit 577717
  (e.g. MMX_ASSIST) in user-mode. P1 suspends. Since EVNTSELn is
Packit 577717
  in non-interrupt mode, it is not disabled. P2 resumes. First
Packit 577717
  iresume() finds that the CPU cache ID is not P2's, so it reloads
Packit 577717
  PERFCTRn with P2's restart value. Then write_control() reloads
Packit 577717
  EVNTSELn with P2's EVNTSEL. At this point, P2's PERFCTRn has been
Packit 577717
  counting with P1's EVNTSELn since iresume(), so it will no longer
Packit 577717
  equal P2's restart value. And if PERFCTRn overflowed, the overflow
Packit 577717
  will go undetected since P1's EVNTSELn was in non-interrupt mode.
Packit 577717
      To avoid this problem, iresume() now ensures that a counter's
Packit 577717
  control register is disabled before reloading the counter.
Packit 577717
- Fixed some ugly log messages from the new HT P4 init code:
Packit 577717
  * forbidden_mask would be printed as "0X<mask>" (capital X)
Packit 577717
  * finalise_backpatching() could trigger a BUG! printk from
Packit 577717
    p4_write_control() if the CPU the init code runs on was
Packit 577717
    in the forbidden set. At init-time this is not an error.
Packit 577717
    Avoided this by temporarily resetting the forbidden_mask.
Packit 577717
- Added preliminary support for AMD K8 processors with the
Packit 577717
  regular 32-bit x86 kernel. The K8 performance counters appear
Packit 577717
  to be identical or very similar to the K7 performance counters.
Packit 577717
Packit 577717
Version 2.4.3, 2002-12-11
Packit 577717
- Added x86.c:perfctr_cpus_forbidden_mask. This bitmask describes
Packit 577717
  the set of CPUs that must not access the perfctrs. On HT P4 MPs,
Packit 577717
  only logical CPU #0 in each package is allowed access -- this
Packit 577717
  avoids the resource conflict that would occur if both logical
Packit 577717
  processors were to access the perfctrs. In other cases (UP or
Packit 577717
  non-HT-P4 MPs) the mask is zero.
Packit 577717
- vperfctr_control() now calls set_cpus_allowed() to ensure that
Packit 577717
  the task stays away from CPUs in perfctr_cpus_forbidden_mask.
Packit 577717
  This is racy with sys_sched_setaffinity(), and possibly some
Packit 577717
  of the kernel's internal set_cpus_allowed() calls, but the race
Packit 577717
  is unlikely to occur in current 2.4 kernels.
Packit 577717
- Cleaned up the parameter passing protocol between vperfctr_ioctl()
Packit 577717
  and the individual vperfctr "system call" procedures.
Packit 577717
- Added safety check in global.c to disallow global-mode perfctrs
Packit 577717
  on asymmetric MPs until the API has been fixed.
Packit 577717
- Added set_cpus_allowed() implementation for 2.4 kernels, except
Packit 577717
  those that already have it as indicated by HAVE_SET_CPUS_ALLOWED:
Packit 577717
  this symbol is added to <linux/config.h> by the kernel patch.
Packit 577717
- 2.2 kernels can't enforce CPU affinity masks, so x86.c warns if
Packit 577717
  a HT P4 MP runs a 2.2 kernel, and falls back to generic x86 mode.
Packit 577717
  Added dummy set_cpus_allowed() macro for 2.2 kernels.
Packit 577717
- x86_compat.h now implements cpuid_ebx() and cpu_has_ht for old kernels.
Packit 577717
- Makefile cleanup: Rules.make is obsolete in 2.5.
Packit 577717
- Compile fixes in x86.c and virtual_stub.c: <linux/fs.h> needs to
Packit 577717
  be included explicitly for the 2.5.50 kernel.
Packit 577717
Packit 577717
Version 2.4.2, 2002-11-25
Packit 577717
- Fixed virtual.c:inc_nrctrs() to handle the -EBUSY case correctly.
Packit 577717
  If the HW was busy (e.g. global running), then the first attempt
Packit 577717
  to open a vperfctr would fail but further attempts would succeed.
Packit 577717
  Updated error propagation to distinguish -EBUSY from -ENOMEM.
Packit 577717
- Updated global.c for preempt-safety.
Packit 577717
- Made the driver safe for preemptible kernels. This required a lot
Packit 577717
  of analysis, but resulted in relatively few actual code changes.
Packit 577717
  (Backport from the perfctr-3.1 branch.)
Packit 577717
- Ported to 2.5.48: Replaced MOD_INC_USE_COUNT by try_module_get()
Packit 577717
  and MOD_DEC_USE_COUNT by module_put(). Updated compat.h.
Packit 577717
- Ported to 2.5.45: added Kconfig, removed Config.help.
Packit 577717
Packit 577717
Version 2.4.1, 2002-10-12
Packit 577717
- RedHat 8.0's 2.4.18-14 kernel does EXPORT_SYMBOL(cpu_khz) while
Packit 577717
  the vanilla 2.4.18 does not. This clashes with x86_setup.c's
Packit 577717
  EXPORT_SYMBOL(cpu_khz). I've found no easy way to distinguish
Packit 577717
  between these kernels at C preprocessing time, so I changed
Packit 577717
  x86_setup.c to define a trivial perfctr_cpu_khz() function and
Packit 577717
  EXPORT_SYMBOL that one instead.
Packit 577717
Packit 577717
Version 2.4.0, 2002-09-26
Packit 577717
- Config.help updated to state that Pentium 4 is supported.
Packit 577717
- 2.5.32 moved ptrace_check_attach() declaration to <linux/ptrace.h>.
Packit 577717
- Removed redundant /proc/<pid>/perfctr access control check
Packit 577717
  from vperfctr_stub_open(). Since 2.4.0-pre1 this check didn't
Packit 577717
  match the real one, which prevented remote opens when the
Packit 577717
  driver was built as a module.
Packit 577717
Packit 577717
Version 2.4.0-pre2, 2002-08-27
Packit 577717
- vperfctr_control() now allows the user to specify that some PMC
Packit 577717
  sums are not to be cleared when updating the control.
Packit 577717
  There is a new bitmap field `preserve' in struct vperfctr_control:
Packit 577717
  if bit i is set then PMC(i)'s sum is not cleared.
Packit 577717
  `preserve' is a simple `unsigned long' for now, since this type
Packit 577717
  fits all currently known CPU types.
Packit 577717
  This change breaks binary compatibility, but user-space code which
Packit 577717
  clears the entire control record before filling in relevant fields
Packit 577717
  will continue to work as before after a recompile.
Packit 577717
  This feature removes a limitation which some people felt was a
Packit 577717
  problem for some usage scenarios.
Packit 577717
Packit 577717
Version 2.4.0-pre1, 2002-08-12
Packit 577717
- Initial implementation of a new remote-control API for virtual
Packit 577717
  per-process perfctrs. A monitor process may access a target
Packit 577717
  process' perfctrs via /proc/pid/perfctr and operations on that
Packit 577717
  file, if the monitor holds the target under ptrace ATTACH control.
Packit 577717
  Updated virtual.c to allow remote access.
Packit 577717
  Updated x86.c:perfctr_cpu_ireload() to work also in the remote
Packit 577717
  control case on SMP machines.
Packit 577717
Packit 577717
Version 2.3.12, 2002-08-12
Packit 577717
- Trivial comment fixes in compat.h and x86_compat.h.
Packit 577717
- Removed __vperfctr_sample(), vperfctr_stub.sample, and bug_sample()
Packit 577717
  from UP builds, since they are needed only on SMP.
Packit 577717
Packit 577717
Version 2.3.11, 2002-07-21
Packit 577717
- Accumulated sums are now maintained for interrupt-mode perfctrs.
Packit 577717
  User-space can use the standard syscall-less algorithm for computing
Packit 577717
  these counters' current sums, should that be needed.
Packit 577717
Packit 577717
Version 2.3.10, 2002-07-19
Packit 577717
- Added PERFCTR_X86_INTEL_P4M2 CPU type for Model 2 P4s, since
Packit 577717
  they have ESCR Event Mask changes in a few events.
Packit 577717
- The driver now supports replay tagging events on P4, using the
Packit 577717
  pebs_enable and pebs_matrix_vert control fields added in 2.3.8.
Packit 577717
- Some Pentium MMX and Pentium Pro processors have an erratum
Packit 577717
  (Pentium erratum #74, Pentium Pro erratum 26) which causes SMM
Packit 577717
  to shut down if CR4.PCE is set. intel_init() now clears the
Packit 577717
  RDPMC feature on the affected steppings, to avoid the problem.
Packit 577717
- perfctr_cpu_release() now clears the hardware registers and
Packit 577717
  invalidates the per-cpu cache. This should allow the counter
Packit 577717
  hardware to power down when not used, especially on P4.
Packit 577717
- Callers of update_control() have no active i-mode counters.
Packit 577717
  Documented this as a precondition, and changed update_control()
Packit 577717
  to not call isuspend(). update_control() no longer needs hardware
Packit 577717
  access, which should ease a port to CONFIG_PREEMPT=y.
Packit 577717
Packit 577717
Version 2.3.9, 2002-06-27
Packit 577717
- Updated p4_escr_addr() in x86.c to match the latest revision of
Packit 577717
  Intel's IA32 Volume 3 manual, #245472-007. An error in previous
Packit 577717
  revisions of this document caused the driver to program the wrong
Packit 577717
  ESCR in some cases. (CCCRs 12/13/16 with ESCR_SELECT(2) were mapped
Packit 577717
  to SSU_ESCR0 instead of RAT_ESCR0, affecting the uop_type event.)
Packit 577717
Packit 577717
Version 2.3.8, 2002-06-26
Packit 577717
- Added counter overflow interrupt support for Intel P4.
Packit 577717
- 2.5.23 dropped smp_num_cpus and cpu_logical_map(). Added
Packit 577717
  temporary workarounds to x86.c and global.c to allow compilation
Packit 577717
  and testing under 2.5. May have to change the API (esp. global's)
Packit 577717
  to be based on the sparse cpu_online_map instead.
Packit 577717
- RedHat's 2.4.9-34 defines cpu_relax(). Updated compat.h.
Packit 577717
- Added pebs_enable and pebs_matrix_vert fields (currently unused)
Packit 577717
  to perfctr_cpu_control to support replay tagging events on P4.
Packit 577717
  Updated the perfctr_cpu_state binary layout magic number.
Packit 577717
- Silenced redefinition warnings for MSR_P6_PERFCTR0 and cpu_has_mmx.
Packit 577717
- Updated Makefile for the 2.5.19 kernel's Makefile changes.
Packit 577717
- Merged the P6 and K7 isuspend/iresume/write_control driver code.
Packit 577717
- Added a VC3 specific clear_counters() procedure.
Packit 577717
- Removed pointless code from perfctr_cpu_identify_overflow().
Packit 577717
- Removed _vperfctr_get/set_thread() wrappers and thread->perfctr
Packit 577717
  clobber checks from the DEBUG code. Removed unused "ibuf" and
Packit 577717
  obsolete si_code fields from vperfctr state and control objects.
Packit 577717
  Updated the vperfctr state magic number.
Packit 577717
- Fixed the CONFIG_PREEMPT anti-dependency check in Config.in.
Packit 577717
- vperfctr_control() now preserves the TSC sum on STOP;CONTROL
Packit 577717
  transitions. The failure to do this caused problems for the
Packit 577717
  PAPI P4 support being developed.
Packit 577717
Packit 577717
Version 2.3.7, 2002-04-14
Packit 577717
- Kernel 2.5.8-pre3 changed the way APIC/SMP interrupt entries
Packit 577717
  are defined. Defining these with asm() in C is no longer
Packit 577717
  practical, so the kernel patch for 2.5.8-pre3 now defines
Packit 577717
  the perfctr interrupt entry in arch/i386/kernel/entry.S.
Packit 577717
- Permit use of cascading counters on P4: in the slave counter
Packit 577717
  one sets the CASCADE flag instead of the ENABLE flag.
Packit 577717
- Added P4 hyperthreading bit field definitions.
Packit 577717
- Preliminary infrastructure to support a new remote-control
Packit 577717
  interface via ptrace(). Updates to compat.h, virtual.c,
Packit 577717
  virtual_stub.c, and x86_setup.c. ptrace_check_attach()
Packit 577717
  emulation for older kernels is in x86_setup.c since
Packit 577717
  virtual_stub.c isn't compiled if the driver isn't a module.
Packit 577717
Packit 577717
Version 2.3.6, 2002-03-21
Packit 577717
- Rewrote sys_vperfctr_control() to do a proper suspend before
Packit 577717
  updating the control, and to skip trying to preserve the TSC
Packit 577717
  start value around the resume. This cleaned up the code and
Packit 577717
  eliminated the bogus "BUG! resuming non-suspended perfctr"
Packit 577717
  warnings that control calls to active perfctrs caused.
Packit 577717
- Rewrote sys_vperfctr_iresume() to not preserve the TSC start
Packit 577717
  value around the resume. Since we had just done a suspend(),
Packit 577717
  this would cause double-accounting of the TSC.
Packit 577717
Packit 577717
Version 2.3.5, 2002-03-17
Packit 577717
- Added detection of the VIA C3 Ezra-T processor.
Packit 577717
- CPU detection now uses current_cpu_data instead of boot_cpu_data,
Packit 577717
  to avoid the boot_cpu_data.x86_vendor bug which is present is
Packit 577717
  all current 2.2/2.4/2.5 kernels. The bug caused the x86_vendor
Packit 577717
  field to be cleared on SMP machines, which in turn tricked the
Packit 577717
  driver to identify MP AMD K7 machines as MP Intel P6, with
Packit 577717
  disastrous results when the wrong MSRs were programmed.
Packit 577717
- Updated compat.h for /proc/<pid>/ inode change in 2.5.4.
Packit 577717
- Added a check to prevent building on preemptible 2.4/2.5 kernels,
Packit 577717
  since the driver isn't yet safe for those.
Packit 577717
- Put perfctr's configuration help text in Config.help in this
Packit 577717
  directory: kernel 2.5.3-pre5 changed from a having a common
Packit 577717
  Configure.help file to having local Config.help files.
Packit 577717
Packit 577717
Version 2.3.4, 2002-01-23
Packit 577717
- Updated virtual.c for remap_page_range() change in 2.5.3-pre1.
Packit 577717
  Added emulation for older kernels to compat.h.
Packit 577717
- Permit use of tagging on P4 for at-retirement counting. This may
Packit 577717
  not yet work as expected, since up-stream (tag producing) counters
Packit 577717
  aren't disabled at context switches: a process may therefore see
Packit 577717
  more tagged uops than expected.
Packit 577717
- Fixed uses of __FUNCTION__ to comply with changes in GCC 3.0.3.
Packit 577717
Packit 577717
Version 2.3.3, 2001-12-31
Packit 577717
- Minor x86.c cleanup: reordered function definitions so that
Packit 577717
  write_control comes after isuspend/iresume: this makes it easier
Packit 577717
  to follow the runtime control flow.
Packit 577717
- Fixed isuspend()/iresume()'s broken cache checking protocol. The
Packit 577717
  old protocol didn't handle process migration across CPUs in SMP
Packit 577717
  machines correctly, as illustrated by the following scenario:
Packit 577717
      P1 runs on CPU1 and suspends. P1 and CPU1 now have the same
Packit 577717
  cache id (->k1.id). P1 is resumed and suspended on CPU2: the state
Packit 577717
  in CPU1 is now stale. Then P1 is resumed on CPU1, and no other
Packit 577717
  process has been using CPU1's performance counters since P1's last
Packit 577717
  suspend on CPU1. The old protocol would see matching cache ids and
Packit 577717
  that P1's i-mode EVNTSELs are stopped, so it would accept the cache
Packit 577717
  and resume P1 with CPU1's stale PERFCTRS values.
Packit 577717
      In the new protocol isuspend() records the active CPU in the
Packit 577717
  state object, and iresume() checks if both the CPU and the control
Packit 577717
  id match. The new protocol is also simpler since iresume() no longer
Packit 577717
  checks if the i-mode EVNTSELs are cleared or not.
Packit 577717
- P6 nasty i-mode to a-mode context switch bug fixed: p6_isuspend()
Packit 577717
  used to simply clear EVNTSEL0's Enable flag in order to stop all
Packit 577717
  i-mode counters. Unfortunately, that was insufficient as shown by
Packit 577717
  the following case (which actually happened).
Packit 577717
      P1 has EVNTSEL0 in a-mode and EVNTSEL1 in i-mode. P1 suspends:
Packit 577717
  PERFCTR1 is stopped but EVNTSEL1 is still in i-mode. P2 has EVNTSEL0
Packit 577717
  in a-mode and no EVNTSEL1. P2 resumes and updates EVNTSEL0. This
Packit 577717
  activates not only P2's PERFCTR0 but also the dormant PERFCTR1. If
Packit 577717
  PERFCTR1 overflows, then P2 will receive an unexpected interrupt. If
Packit 577717
  PERFCTR1 doesn't overflow, but P2 suspends and P1 resumes, then P1
Packit 577717
  will find that PERFCTR1 has a larger than expected value.
Packit 577717
      p6_isuspend() and p6_iresume() were changed to ignore the global
Packit 577717
  Enable flag and to disable/enable each i-mode EVNTSEL individually,
Packit 577717
  just like how it's done on the K7.
Packit 577717
- x86.c cleanups: P5MMX, MII, C6, VC3, P6, K7, and P4 now all
Packit 577717
  use the same rdpmc_read_counters() method. VIA C3 now uses
Packit 577717
  p6_write_control() instead of its own method.
Packit 577717
- Removed "pmc_map[] must be identity" restriction from P6 and K7.
Packit 577717
  The API uses the virtual counter index to distinguish a-mode
Packit 577717
  and i-mode counters, but P6 events aren't entirely symmetric:
Packit 577717
  this lead to some strange cases with the old pmc_map[] rule.
Packit 577717
      P6 and K7 isuspend() now need access to the control, so
Packit 577717
  update_control() and its callers had to be changed to allow it
Packit 577717
  to isuspend() _before_ the new control is installed.
Packit 577717
- P4 write_control fixes: changed the ESCR cache to be indexed by
Packit 577717
  MSR offset from 0x3A0, and changed P4 write_control to index the
Packit 577717
  CCCR/ESCR cache with physical instead of virtual indices. Added
Packit 577717
  call to debug_evntsel_cache(), after updating it for pmc_map[].
Packit 577717
- Added P4 and Generic support to x86_tests.c, and some cleanups.
Packit 577717
Packit 577717
Version 2.3.2, 2001-11-19
Packit 577717
- P4 fix: the mapping from CCCR 17 to its associated ESCRs was
Packit 577717
  wrong due to an off-by-one error in x86.c:p4_escr_addr().
Packit 577717
- P4 fix: also clear the PEBS MSRs when initialising the driver.
Packit 577717
- Minor cleanup in x86.c: replaced the "clear MSRs" loops with
Packit 577717
  calls to a helper procedure.
Packit 577717
Packit 577717
Version 2.3.1, 2001-11-06
Packit 577717
- Microscopic P4 cleanups. Testing on my new P4 box has confirmed
Packit 577717
  that the PMAVAIL flag in MSR_IA32_MISC_ENABLE is read-only.
Packit 577717
Packit 577717
Version 2.3, 2001-10-24
Packit 577717
- Added support for multiple interrupt-mode virtual perfctrs
Packit 577717
  with automatic restart. Added an identify_overflow() method
Packit 577717
  to x86.c to identify and reset the overflowed counters.
Packit 577717
  Added checks to ensure that the user-specified restart values
Packit 577717
  for interrupt-mode counters are negative.
Packit 577717
  Updated virtual.c's signal delivery interface to pass a
Packit 577717
  bitmask describing which counters overflowed; the siginfo
Packit 577717
  si_code is now fixed as SI_PMC_OVF (fault-class).
Packit 577717
- Fixed some typos in x86.c. Added a note about the C3 Ezra.
Packit 577717
- Added EXPORT_NO_SYMBOLS to init.c, for compatibility with
Packit 577717
  announced changes in modutils 2.5.
Packit 577717
Packit 577717
Version 2.2, 2001-10-09
Packit 577717
- Added preliminary support for the Pentium 4. Only basic stuff
Packit 577717
  for now: no cascading counters, overflow interrupts, tagged
Packit 577717
  micro-ops, or use of DS/PEBS. The code compiles but hasn't been
Packit 577717
  tested on an actual Pentium 4.
Packit 577717
Packit 577717
Version 2.1.4, 2001-09-30
Packit 577717
- No driver-level changes.
Packit 577717
Packit 577717
Version 2.1.3, 2001-09-13
Packit 577717
- Fixed a compilation problem where virtual_stub couldn't be compiled
Packit 577717
  in modular kernels older than 2.2.20pre10 if KMOD was disabled, due
Packit 577717
  to an incompatible stub definition of request_module().
Packit 577717
- Replaced most occurrences of "VIA Cyrix III / C3" with "VIA C3".
Packit 577717
Packit 577717
Version 2.1.2, 2001-09-05
Packit 577717
- Added MODULE_LICENSE() tag, for compatibility with the tainted/
Packit 577717
  non-tainted kernel stuff being put into 2.4.9-ac and modutils.
Packit 577717
- VIA C3 support is not "preliminary" any more. Testing has revealed
Packit 577717
  that the reserved bits in the C3's EVNTSEL1 have no function and
Packit 577717
  need not be preserved. The driver now fills these bits with zeroes.
Packit 577717
  (Thanks to Dave Jones @ SuSE for running these tests.)
Packit 577717
- Minor bug fix in the perfctr interrupt assembly code.
Packit 577717
  (Inherited from the 2.4 kernel. Fixed in 2.4.9-ac4.)
Packit 577717
Packit 577717
Version 2.1.1, 2001-08-28
Packit 577717
- Preliminary recognition of Pentium 4 processors, including
Packit 577717
  checking the IA32_MISC_ENABLE MSR.
Packit 577717
- Moved %cr4 access functions from <asm-i386/perfctr.h> to
Packit 577717
  x86_compat.h, to work around changes in 2.4.9-ac3.
Packit 577717
- More %cr4 cleanups possible since the removal of dodgy_tsc()
Packit 577717
  in Version 2.1: moved {set,clear}_in_cr4_local() into x86.c,
Packit 577717
  and eliminated the set_in_cr4() compat macro.
Packit 577717
- Fixed a bug in x86.c:finalise_backpatching(): the fake cstatus
Packit 577717
  mustn't include i-mode counters unless we have PCINT support.
Packit 577717
  Failure to check this cased fatal init-time oopses in some
Packit 577717
  configs (CONFIG_X86_UP_APIC set but no local APIC in the CPU).
Packit 577717
- Minor comment updates in x86.c due to AMD #22007 Revision J.
Packit 577717
- Removed '%' before 'cr4' in printouts from x86_tests.c, to
Packit 577717
  avoid the '%' being mutated by log-reading user-space code.
Packit 577717
Packit 577717
Version 2.1, 2001-08-19
Packit 577717
- Fixed a call backpatching bug, caused by an incompatibility
Packit 577717
  between the 2.4 and 2.2 kernels' xchg() macros. The 2.2 version
Packit 577717
  lacks a "volatile" causing gcc to remove the entire statement
Packit 577717
  if xchg() is used for side-effect only. Reverted to a plain
Packit 577717
  assignment, which is safe since the 2.0.1 backpatching changes.
Packit 577717
- Fixed a bug where an attempt to use /proc/<pid>/perfctr on an
Packit 577717
  unsupported processor would cause a (well-behaved) kernel oops,
Packit 577717
  due to calling a NULL function pointer in x86.c, vperfctr_open()
Packit 577717
  now returns -ENODEV if virtual.c hasn't been initialised.
Packit 577717
- Removed the WinChip configuration option, the dodgy_tsc() callback,
Packit 577717
  and the clr_cap_tsc() x86_compat macro. WinChip users should configure
Packit 577717
  for generic 586 or less and use the kernel's "notsc" boot parameter.
Packit 577717
  This cleans up the driver and the 2.4 kernel patches, at the expense
Packit 577717
  of more code in the 2.2 kernel patches to implement "notsc" support.
Packit 577717
- Minor cleanup: moved version number definition from init.c to
Packit 577717
  a separate file, version.h.
Packit 577717
Packit 577717
Version 2.0.1, 2001-08-14
Packit 577717
- The unsynchronised backpatching in x86.c didn't work on SMP,
Packit 577717
  due to Pentium III erratum E49, and similar errata for other
Packit 577717
  P6 processors. (The change in 2.0-pre6 was insufficient.)
Packit 577717
  x86.c now finalises the backpatching at driver init time,
Packit 577717
  by "priming" the relevant code paths. To make this feasible,
Packit 577717
  the isuspend() and iresume() methods are now merged into
Packit 577717
  the other high-level methods; virtual.c became a bit cleaner.
Packit 577717
- Removed obsolete "WinChip pmc_map[] must be identity" check.
Packit 577717
Packit 577717
Version 2.0, 2001-08-08
Packit 577717
- Resurrected partial support for interrupt-mode virtual perfctrs.
Packit 577717
  virtual.c permits a single i-mode perfctr, in addition to TSC
Packit 577717
  and a number of a-mode perfctrs. BUG: The i-mode PMC must be last,
Packit 577717
  which constrains CPUs like the P6 where we currently restrict
Packit 577717
  the pmc_map[] to be the identity mapping. (Not a problem for
Packit 577717
  K7 since it is symmetric, or P4 since it is expected to use a
Packit 577717
  non-identity pmc_map[].)
Packit 577717
  New perfctr_cpu_ireload() procedure to force reload of i-mode
Packit 577717
  PMCs from their start values before resuming. Currently, this
Packit 577717
  just invalidates the CPU cache, which forces the following
Packit 577717
  iresume() and resume() to do the right thing.
Packit 577717
  perfctr_cpu_update_control() now calls setup_imode_start_values()
Packit 577717
  to "prime" i-mode PMCs from the control.ireset[] array.
Packit 577717
- Bug fix in perfctr_cpu_update_control(): start by clearing cstatus.
Packit 577717
  Prevents a failed attempt to update the control from leaving the
Packit 577717
  object in a state with old cstatus != 0 but new control.
Packit 577717
Packit 577717
Version 2.0-pre7, 2001-08-07
Packit 577717
- Cleaned up the driver's debugging code (virtual, x86).
Packit 577717
- Internal driver rearrangements. The low-level driver (x86) now handles
Packit 577717
  sampling/suspending/resuming counters. Merged counter state (sums and
Packit 577717
  start values) and CPU control data to a single "CPU state" object.
Packit 577717
  This simplifies the high-level drivers, and permits some optimisations
Packit 577717
  in the low-level driver by avoiding the need to buffer tsc/pmc samples
Packit 577717
  in memory before updating the accumulated sums (not yet implemented).
Packit 577717
- Removed the read_counters, write_control, disable_rdpmc, and enable_rdpmc
Packit 577717
  methods from <asm/perfctr.h>, since they have been obsoleted by the
Packit 577717
  new suspend/resume/sample methods.
Packit 577717
- Rearranged the 'cstatus' encoding slightly by putting 'nractrs' in
Packit 577717
  the low 7 bits; this was done because 'nractrs' is retrieved more
Packit 577717
  often than 'nrctrs'.
Packit 577717
- Removed the obsolete 'status' field from vperfctr_state. Exported
Packit 577717
  'cstatus' and its access methods to user-space. (Remove the
Packit 577717
  control.tsc_on/nractrs/nrictrs fields entirely?)
Packit 577717
- Removed WinChip "fake TSC" support. The user-space library can now
Packit 577717
  sample with slightly less overhead on sane processors.
Packit 577717
- WinChip and VIA C3 now use p5mmx_read_counters() instead of their
Packit 577717
  own versions.
Packit 577717
Packit 577717
Version 2.0-pre6, 2001-07-27
Packit 577717
- New patches for kernels 2.4.6, 2.4.7, and 2.4.7-ac1.
Packit 577717
- Sampling bug fix for SMP. Normally processes are suspended and
Packit 577717
  resumed many times per second, but on SMP machines it is possible
Packit 577717
  for a process to run for a long time without being suspended.
Packit 577717
  Since sampling is performed at the suspend and resume actions,
Packit 577717
  a performance counter may wrap around more than once between
Packit 577717
  sampling points. When this occurs, the accumulated counts will
Packit 577717
  be highly variable and much lower than expected.
Packit 577717
  A software timer is now used to ensure that sampling deadlines
Packit 577717
  aren't missed on SMP machines. (The timer is run by the same code
Packit 577717
  which runs the ITIMER_VIRTUAL interval timer.)
Packit 577717
- Bug fix in the x86 "redirect call" backpatching routine. To be
Packit 577717
  SMP safe, a bus-locked write to the code must be used.
Packit 577717
- Bug fix in the internal debugging code (CONFIG_PERFCTR_DEBUG).
Packit 577717
  The "shadow" data structure used to detect if a process' perfctr
Packit 577717
  pointer has been clobbered could cause lockups with SMP kernels.
Packit 577717
  Rewrote the code to be simpler and more robust.
Packit 577717
- Minor performance tweak for the P5/P5MMX read counters procedures,
Packit 577717
  to work around the P5's cache which doesn't allocate a cache line
Packit 577717
  on a write miss.
Packit 577717
- To avoid undetected data layout mismatches, the user-space library
Packit 577717
  now checks the data layout version field in a virtual perfctr when
Packit 577717
  it is being mmap:ed into the user's address space.
Packit 577717
- A few minor cleanups.  
Packit 577717
Packit 577717
Version 2.0-pre5, 2001-06-11
Packit 577717
- Internally use a single 'cstatus' field instead of the three
Packit 577717
  tsc_on/nractrs/nrictrs fields. Should reduce overhead slightly.
Packit 577717
- Reorder the fields in cpu_control so that 'cstatus' and other
Packit 577717
  frequently used fields get small offsets -- avoids some disp32
Packit 577717
  addressing modes in timing-critical code.
Packit 577717
- Fixed a bug in p6_iresume where it forgot to invalidate the
Packit 577717
  EVNTSEL cache, causing p6_write_control to fail to reload the
Packit 577717
  MSRs. (K7 had a similar bug.) Since i-mode support is disabled
Packit 577717
  at the moment, no-one was actually bitten by this.
Packit 577717
- Fixed another iresume/write_control cache invalidation bug where a
Packit 577717
  switch to an "uninitialised" CPU would fail to initialise the MSRs.
Packit 577717
- Added a CONFIG_PERFCTR_DEBUG option to enable internal consistency
Packit 577717
  checks. Currently, this checks that a task's vperfctr pointer
Packit 577717
  isn't clobbered behind our backs, that resume and suspend for
Packit 577717
  a vperfctr are performed on the same CPU, and that the EVNTSEL
Packit 577717
  cache is semi-consistent when reloading is optimised away.
Packit 577717
  ("semi" because it only checks that the cache agrees with the
Packit 577717
  user's control data, and not that the cache agrees with the MSRs.)
Packit 577717
- Minor cleanups.
Packit 577717
Packit 577717
Version 2.0-pre4, 2001-04-30
Packit 577717
- Cleanups in x86.c. #defines introduced for magic constants.
Packit 577717
  More sharing of procedures between different CPU drivers.
Packit 577717
  Fixed a bug where k7_iresume() could cause k7_write_control()
Packit 577717
  to fail to reload the correct EVNTSELs.
Packit 577717
  The WinChip C6/2/3 driver now "fakes" an incrementing TSC.
Packit 577717
- General cleanups: s/__inline__/inline/ following Linux kernel
Packit 577717
  coding standards, and renamed the low-level control objects to
Packit 577717
  cpu_control to distinguish them from {v,g}perfctr_control objects.
Packit 577717
- O_CREAT is now interpreted when /proc/self/perfctr is opened:
Packit 577717
  if the vperfctr does not exist, then it is created; if the
Packit 577717
  vperfctr does exist, then EEXIST is returned (unfortunately
Packit 577717
  O_EXCL doesn't work, since it's intercepted by the VFS layer).
Packit 577717
  "perfex -i" uses this to avoid having to create a vperfctr when
Packit 577717
  only an INFO command is to be issued.
Packit 577717
  libperfctr.c:vperfctr_open() uses this to decide whether to
Packit 577717
  UNLINK the newly opened vperfctr in case of errors or not.
Packit 577717
- Cleaned up virtual.c's 2.4/2.2 VFS interface code a little,
Packit 577717
  and eliminated the OWNER_THIS_MODULE compat macro.
Packit 577717
- Added MOD_{INC,DEC}_USE_COUNTs to virtual.c's file_operations
Packit 577717
  open and release procedures for 2.2 kernels. This should
Packit 577717
  simulate 2.4's fops_get/put at >open() and >release().
Packit 577717
Packit 577717
Version 2.0-pre3, 2001-04-17
Packit 577717
- Interrupt-mode virtual perfctrs are temporarily disabled since
Packit 577717
  x86.c doesn't yet detect which PMC overflowed. The old API
Packit 577717
  could be made to work, but it was broken anyway.
Packit 577717
- Integrated the new P4-ready data structures and APIs.
Packit 577717
  The driver compiles but the user-space stuff hasn't been
Packit 577717
  updated yet, so there may be some remaining bugs.
Packit 577717
Packit 577717
  I have not yet committed to all details of this API. Some
Packit 577717
  things, like accumulating counters in virtual.c and global.c,
Packit 577717
  are uglier now, and going from a single "status == nrctrs"
Packit 577717
  field to three separate fields (tsc_on, nrctrs, nrictrs)
Packit 577717
  cannot be good for performance.
Packit 577717
Packit 577717
  In the new API the control information is split in separate
Packit 577717
  arrays depending on their use, i.e. a struct-of-arrays layout
Packit 577717
  instead of an array-of-struct layout. The advantage of the
Packit 577717
  struct-of-arrays layout is that it should cause fewer cache
Packit 577717
  lines to be touched at the performance-critical operations.
Packit 577717
  The disadvantage is that the layout changes whenever the
Packit 577717
  number of array elements has to be increased -- as is the
Packit 577717
  case for the future Pentium 4 support (18 counters).
Packit 577717
Packit 577717
Version 2.0-pre2, 2001-04-07
Packit 577717
- Removed automatic inheritance of per-process virtual perfctrs
Packit 577717
  across fork(). Unless wait4() is modified, it's difficult to
Packit 577717
  communicate the final values back to the parent: the now
Packit 577717
  abandoned code did this in a way which made it impossible
Packit 577717
  to distinguish one child's final counts from another's.
Packit 577717
  Inheritance can be implemented in user-space anyway, so the
Packit 577717
  loss is not great. The interface between the driver and the rest
Packit 577717
  of the kernel is now smaller and simpler than before.
Packit 577717
- Simulating cpu_khz by a macro in very old kernels broke since
Packit 577717
  there's also a struct field with that name :-( Instead of
Packit 577717
  putting the ugly workaround back in, I decided to drop support
Packit 577717
  for kernels older than 2.2.16.
Packit 577717
- Preliminary support for the VIA C3 processor -- the C3 is
Packit 577717
  apparently a faster version of the VIA Cyrix III.
Packit 577717
- Added rdtsc cost deduction to the init tests code, and changed
Packit 577717
  it to output per-instruction costs as well.
Packit 577717
- More cleanups, making 2.2 compatibility crud less visible.
Packit 577717
Packit 577717
Version 2.0-pre1, 2001-03-25
Packit 577717
- First round of API and coding changes/cleanups for version 2.0:
Packit 577717
  made perfctr_info.version a string, moved some perfctr_info inits
Packit 577717
  to x86.c and eliminated some redundant variables, removed dead VFS
Packit 577717
  code from virtual.c, removed obsolete K7 tests from x86_tests.c,
Packit 577717
  removed mmu_cr4_features wrappers from x86_compat.h, minor cleanup
Packit 577717
  in virtual_stub.c.
Packit 577717
- Fixed an include file problem which made some C compilers (not gcc)
Packit 577717
  fail when compiling user-space applications using the driver.
Packit 577717
- Added missing EXPORT_SYMBOL declarations needed by the UP-APIC PM
Packit 577717
  code when the driver is built as a module.
Packit 577717
- Preliminary changes in x86.c to deal with UP-APIC power management
Packit 577717
  issues in 2.4-ac kernels. The PM callback is only a stub for now.
Packit 577717
Packit 577717
Version 1.9, 2001-02-13
Packit 577717
- Fixed compilation problems for 2.2 and SMP kernels.
Packit 577717
- Found updated documentation on "VIA Cyrix III". Apparently, there
Packit 577717
  are two distinct chips: the older Joshua (a Cyrix design) and the
Packit 577717
  newer Samuel (a Centaur design). Our current code supported Joshua,
Packit 577717
  but mistook Samuel for Joshua. Corrected the identification of Samuel
Packit 577717
  and added explicit support for it. Samuel's EVNTSEL1 is not well-
Packit 577717
  documented, so there are some new Samuel-specific tests in x86_tests.c.
Packit 577717
- Added preliminary interrupt-mode support for AMD K7.
Packit 577717
- Small tweaks to virtual.c's interrupt handling.
Packit 577717
Packit 577717
Version 1.8, 2001-01-23
Packit 577717
- Added preliminary interrupt-mode support to virtual perfctrs.
Packit 577717
  Currently for P6 only, and the local APIC must have been enabled.
Packit 577717
  Tested on 2.4.0-ac10 with CONFIG_X86_UP_APIC=y.
Packit 577717
  When an i-mode vperfctr interrupts on overflow, the counters are
Packit 577717
  suspended and a user-specified signal is sent to the process. The
Packit 577717
  user's signal handler can read the trap pc from the mmap:ed vperfctr,
Packit 577717
  and should then issue an IRESUME ioctl to restart the counters.
Packit 577717
  The next version will support buffering and automatic restart.
Packit 577717
- Some cleanups in the x86.c init and exit code. Removed the implicit
Packit 577717
  smp_call_function() calls from x86_compat.h.
Packit 577717
Packit 577717
Version 1.7, 2001-01-01
Packit 577717
- Updated Makefile for 2.4.0-test13-pre3 Rules.make changes.
Packit 577717
- Removed PERFCTR_ATTACH ioctl from /dev/perfctr, making the
Packit 577717
  vperfctrs only accessible via /proc/self/perfctr. Removed
Packit 577717
  the "attach" code from virtual.c, and temporarily commented
Packit 577717
  out the "vperfctr fs" code. Moved /dev/perfctr initialisation
Packit 577717
  and implementation from init.c to global.c.
Packit 577717
- Eliminated CONFIG_VPERFCTR_PROC, making /proc/pid/perfctr
Packit 577717
  mandatory if CONFIG_PERFCTR_VIRTUAL is set.
Packit 577717
- Some 2.2/2.4 compatibility cleanups.
Packit 577717
- VIA Cyrix III detection bug fix. Contrary to VIA's documentation,
Packit 577717
  the Cyrix III vendor field is Centaur, not Cyrix.
Packit 577717
Packit 577717
Version 1.6, 2000-11-21
Packit 577717
- Preliminary implementation of /proc/pid/perfctr. Seems to work,
Packit 577717
  but virtual.c and virtual_stub.c is again filled with
Packit 577717
  #if LINUX_VERSION_CODE crap which will need to be cleaned up.
Packit 577717
  The INFO ioctl is now implemented by vperfctrs too, to avoid the
Packit 577717
  need for opening /dev/perfctr.
Packit 577717
- virtual.c now puts the perfctr pointer in filp->private_data
Packit 577717
  instead of inode->u.generic_ip. The main reason for this change
Packit 577717
  is that proc-fs places a dentry pointer in inode->u.generic_ip.
Packit 577717
- sys_vperfctr_control() no longer resets the virtual TSC
Packit 577717
  if it already is active. The virtual TSC therefore runs
Packit 577717
  continuously from its first activation until the process
Packit 577717
  stops or unlinks its vperfctrs.
Packit 577717
- Updates for 2.4.0-test11pre6. Use 2.4-style cpu_has_XXX
Packit 577717
  feature testing macros. Updated x86_compat.h to implement
Packit 577717
  missing cpu_has_mmx and cpu_has_msr, and compatibility
Packit 577717
  macros for 2.2. Changed vperfctr_fs_read_super() to use
Packit 577717
  new_inode(sb) instead of get_empty_inode() + some init code.
Packit 577717
- Updates for 2.4.0-test9. Fixed x86_compat.h for cpu_khz change.
Packit 577717
  Since drivers/Makefile was converted to the new list style,
Packit 577717
  it became more difficult to handle CONFIG_PERFCTR=m. Changed
Packit 577717
  Config.in to set CONFIG_KPERFCTR=y when CONFIG_PERFCTR != n,
Packit 577717
  resulting in a much cleaner kernel patch for 2.4.0-test9.
Packit 577717
- Removed d_alloc_root wrapper since 2.2 doesn't need it any more.
Packit 577717
- When building for 2.2.18pre, use some of its 2.4 compatibility
Packit 577717
  features (module_init, module_exit and DECLARE_MUTEX).
Packit 577717
- Updates for 2.4.0-test8: repaired kernel patch for new parameter
Packit 577717
  in do_fork, and fixed CLONE_PERFCTR conflict with CLONE_THREAD.
Packit 577717
Packit 577717
Version 1.5, 2000-09-03
Packit 577717
- Dropped support for intermediate 2.3 and early 2.4.0-test kernels.
Packit 577717
  The code now supports kernels 2.2.xx and 2.4.0-test7 or later only.
Packit 577717
  Cleanups in compat.h and virtual.c.
Packit 577717
- Rewrote the Makefile to use object file lists instead of conditionals.
Packit 577717
  This gets slightly hairy since kernel extensions are needed even
Packit 577717
  when the driver proper is built as a module.
Packit 577717
- Removed the definition of CONFIG_PERFCTR_X86 from Config.in.
Packit 577717
  Use the 2.4 standard CONFIG_X86 instead. The 2.2.xx kernel
Packit 577717
  patches now define CONFIG_X86 in arch/i386/config.in.
Packit 577717
- Cleaned up the vperfctr inheritance filter. Instead of setting
Packit 577717
  a disable flag (CLONE_KTHREAD) when kernel-internal threads are
Packit 577717
  created, I now set CLONE_PERFCTR in sys_fork and sys_vfork.
Packit 577717
- /dev/perfctr no longer accepts the SAMPLE and UNLINK ioctls.
Packit 577717
  All operations pertaining to a process' virtual perfctrs must
Packit 577717
  be applied to the fd returned from the ATTACH ioctl.
Packit 577717
- Removed the remote-control features from the virtual perfctrs.
Packit 577717
  Significant simplifications in virtual.c. Removed some now
Packit 577717
  unused stuff from compat.h and virtual_stub.c.
Packit 577717
Packit 577717
Version 1.4, 2000-08-11
Packit 577717
- Fixed a memory leak bug in virtual.c. An extraneous dget() in
Packit 577717
  get_vperfctr_filp() prevented reclaiming the dentry and inode
Packit 577717
  allocated for a vperfctr file.
Packit 577717
- Major changes to the VFS interface in virtual.c. Starting with
Packit 577717
  2.4.0-test6, inode->i_sb == NULL no longer works. Added code to
Packit 577717
  register a "vperfctr" fs and define a superblock and a mount point.
Packit 577717
  Completely rewrote the dentry init code. Most of the new code is
Packit 577717
  adapted from fs/pipe.c, with simplifications and macros to continue
Packit 577717
  supporting 2.2.x kernels. `ls -l /proc/*/fd/' now prints recognizable
Packit 577717
  names for vperfctr files.
Packit 577717
- Cleaned up virtual.c slightly. Removed "#if 1" tests around the
Packit 577717
  vperfctr inheritance code. Rewrote vperfctr_alloc and vperfctr_free
Packit 577717
  to use the virt_to_page and {Set,Clear}PageReserved macros;
Packit 577717
  also updated compat.h to provide these for older kernels.
Packit 577717
- Updated for 2.4.0-test3: a dummy `open' file operation is no longer
Packit 577717
  required by drivers/char/misc.c.
Packit 577717
- Updated for `owner' field in file_operations added in 2.4.0-test2.
Packit 577717
  Removed MOD_{INC,DEC}_USE_COUNT from init.c (except when compiling
Packit 577717
  for 2.2.x) and virtual.c. Added MOD_{INC,DEC}_USE_COUNT to the
Packit 577717
  reserve/release functions in x86.c -- needed because the driver
Packit 577717
  may be active even if no open file refers to it. Using can_unload
Packit 577717
  in the module struct instead is possible but not as tidy.
Packit 577717
Packit 577717
Version 1.3, 2000-06-29
Packit 577717
- Implemented inheritance for virtual perfctrs: fork() copies the
Packit 577717
  evntsel data to the child, exit() stops the child's counters but
Packit 577717
  does not detach the vperfctr object, and wait() adds the child's
Packit 577717
  counters to the parent's `children' counters.
Packit 577717
  Added a CLONE_KTHREAD flag to prevent inheritance to threads
Packit 577717
  created implicitly by request_module() and kernel_thread().
Packit 577717
- Fixed a half-broken printk() in x86_tests.c.
Packit 577717
- Added checks to virtual.c to prevent the remote-control interface
Packit 577717
  from trying to activate dead vperfctrs.
Packit 577717
- Updated vperfctr_attach() for changes in 2.3.99-pre7 and 2.4.0-test2.
Packit 577717
- Fixed a problem introduced in 1.2 which caused linker errors if
Packit 577717
  CONFIG_PERFCTR=m and CONFIG_PERFCTR_INIT_TESTS=y.
Packit 577717
- Export CPU kHz via a new field in PERFCTR_INFO ioctl, to enable
Packit 577717
  user-space to map accumulated TSC counts to actual time.
Packit 577717
Packit 577717
Version 1.2, 2000-05-24
Packit 577717
- Added support for generic x86 processors with a time-stamp counter
Packit 577717
  but no performance-monitoring counters. By using the driver to
Packit 577717
  virtualise the TSC, accurate cycle-count measurements are now
Packit 577717
  possible on PMC-less processors like the AMD K6.
Packit 577717
- Removed some of the special-casing of the x86 time-stamp counter.
Packit 577717
  It's now "just another counter", except that no evntsel is
Packit 577717
  needed to enable it.
Packit 577717
- WinChip bug fix: the "fake TSC" code would increment an
Packit 577717
  uninitialised counter.
Packit 577717
- Reorganised the x86 driver. Moved the optional init-time testing
Packit 577717
  code to a separate source file.
Packit 577717
- Miscellaneous code cleanups and naming convention changes.
Packit 577717
Packit 577717
Version 1.1, 2000-05-13
Packit 577717
- vperfctr_attach() now accepts pid 0 as an alias for the current
Packit 577717
  process. This reduces the number of getpid() calls needed in
Packit 577717
  the user-space library. (Suggested by Ulrich Drepper.)
Packit 577717
- Added support for the VIA Cyrix III processor.
Packit 577717
- Tuned the x86 driver interface. Replaced function pointers
Packit 577717
  with stubs which rewrite callers to invoke the correct callees.
Packit 577717
- Added ARRAY_SIZE definition to compat.h for 2.2.x builds.
Packit 577717
- Updated for 2.3.48 inode changes.
Packit 577717
- Moved code closer to 2.3.x coding standards. Removed init_module
Packit 577717
  and cleanup_module, added __exit, module_init, and module_exit,
Packit 577717
  and extended "compat.h" accordingly. Cleaned up <linux/perfctr.h>
Packit 577717
  and <asm-i386/perfctr.h> a little.
Packit 577717
Packit 577717
Version 1.0, 2000-01-31
Packit 577717
- Prepared the driver to cope with non-x86 architectures:
Packit 577717
  - Moved generic parts of <asm-i386/perfctr.h> to <linux/perfctr.h>.
Packit 577717
  - Merged driver's private "x86.h" into <asm-i386/perfctr.h>.
Packit 577717
  - Config.in now defines CONFIG_PERFCTR_${ARCH}, and Makefile uses
Packit 577717
    it to select appropriate arch-dependent object files
Packit 577717
- The driver now reads the low 32 bits of the counters,
Packit 577717
  instead of 40 or 48 bits zero-extended to 64 bits.
Packit 577717
  Sums are still 64 bits. This was done to reduce the number
Packit 577717
  of cache lines needed for certain data structures, to
Packit 577717
  simplify and improve the performance of the sampling
Packit 577717
  procedures, and to change 64+(64-64) arithmetic to 64+(32-32)
Packit 577717
  for the benefit of gcc on x86. This change doesn't reduce
Packit 577717
  precision, as long as no event occurs more than 2^32 times
Packit 577717
  between two sampling points.
Packit 577717
- PERFCTR_GLOBAL_READ now forces all CPUs to be sampled, if the
Packit 577717
  sampling timer isn't running.
Packit 577717
Packit 577717
Version 0.11, 2000-01-30
Packit 577717
- Added a missing EXPORT_SYMBOL which prevented the driver
Packit 577717
  from being built as a module in SMP kernels.
Packit 577717
- Support for the CPU sampling instructions (i.e. RDPMC and
Packit 577717
  RDTSC on x86) is now announced explicitly by PERFCTR_INFO.
Packit 577717
- The x86 hardware driver now keeps CR4.PCE globally enabled.
Packit 577717
  There are two reasons for this. First, the cost of toggling
Packit 577717
  this flag at process suspend/resume is high. Second, changes
Packit 577717
  in kernel 2.3.40 imply that any processor's %cr4 may be updated
Packit 577717
  asynchronously from the global variable mmu_cr4_features.
Packit 577717
Packit 577717
Version 0.10, 2000-01-23
Packit 577717
- Added support for global-mode perfctrs (global.c).
Packit 577717
- There is now a config option controlling whether to
Packit 577717
  perform init-time hardware tests or not.
Packit 577717
- Added a hardware reserve/release mechanism so that multiple
Packit 577717
  high-level services don't simultaneously use the hardware.
Packit 577717
- The driver is now officially device <char,major 10,minor 182>.
Packit 577717
- Tuned the 64-bit tsc/msr/pmc read operations in x86.c.
Packit 577717
- Support for virtual perfctrs can now be enabled or disabled
Packit 577717
  via CONFIG_PERFCTR_VIRTUAL.
Packit 577717
- Added support for the WinChip 3 processor.
Packit 577717
- Split the code into several files: x86.c (x86 drivers),
Packit 577717
  virtual.c (virtualised perfctrs), setup.c (boot-time actions),
Packit 577717
  init.c (driver top-level and init code).
Packit 577717
Packit 577717
Version 0.9, 2000-01-02
Packit 577717
- The driver can now be built as a module.
Packit 577717
- Dropped sys_perfctr() system call and went back to using a
Packit 577717
  /dev/perfctr character device. Generic operations are now
Packit 577717
  ioctl commands on /dev/perfctr, and control operations on
Packit 577717
  virtual perfctrs are ioctl commands on their file descriptors.
Packit 577717
  Initially this change was done because new system calls in 2.3.x
Packit 577717
  made maintenance and binary compatibility with 2.2.x hard, but
Packit 577717
  the new API is actually cleaner than the previous system call.
Packit 577717
- Moved this code from arch/i386/kernel/ to drivers/perfctr/.
Packit 577717
Packit 577717
Version 0.8, 1999-11-14
Packit 577717
- Made the process management callback functions inline to
Packit 577717
  reduce scheduling overhead for processes not using perfctrs.
Packit 577717
- Changed the 'status' field to contain the number of active
Packit 577717
  counters. Changed read_counters, write_control, and accumulate
Packit 577717
  to use this information to avoid unnecessary work.
Packit 577717
- Fixed a bug in k7_check_control() which caused it to
Packit 577717
  require all four counters to be enabled.
Packit 577717
- Fixed sys_perfctr() to return -ENODEV instead of -ENOSYS
Packit 577717
  if the processor doesn't support perfctrs.
Packit 577717
- Some code cleanups.
Packit 577717
- Evntsel MSRs are updated lazily, and counters are not written to.
Packit 577717
Packit 577717
  The following table lists the costs (in cycles) of various
Packit 577717
  instructions which access the counter or evntsel registers.
Packit 577717
  The table was derived from data collected by init-time tests
Packit 577717
  run by previous versions of this driver.
Packit 577717
Packit 577717
  Processor		P5	P5MMX	PII	PIII	K7
Packit 577717
  Clock freq. (MHz)	133	233	266	450	500
Packit 577717
Packit 577717
  RDPMC			n/a	14	31	36	13
Packit 577717
  RDMSR (counter)	29	28	81	80	52
Packit 577717
  WRMSR (counter)	35	37	97	115	80
Packit 577717
  WRMSR (evntsel)	33	37	88	105	232
Packit 577717
Packit 577717
  Several things are apparent from this table:
Packit 577717
Packit 577717
  1. It's much cheaper to use RDPMC than RDMSR to read the counters.
Packit 577717
  2. It's much more expensive to reset a counter than to read it.
Packit 577717
  3. It's expensive to write to an evntsel register.
Packit 577717
Packit 577717
  As of version 0.8, this driver uses the following strategies:
Packit 577717
  * The evntsel registers are updated lazily. A per_cpu_control[]
Packit 577717
    array caches the contents of each CPU's evntsel registers,
Packit 577717
    and only when a process requires a different setup are the
Packit 577717
    evntsel registers written to. In most cases, this eliminates the
Packit 577717
    need to reprogram the evntsel registers when switching processes.
Packit 577717
    The older drivers would write to the evntsel registers both at
Packit 577717
    process suspend and resume.
Packit 577717
  * The counter registers are read both at process resume and suspend,
Packit 577717
    and the difference is added to the process' accumulated counters.
Packit 577717
    The older drivers would reset the counters at resume, read them
Packit 577717
    at suspend, and add the values read to the accumulated counters.
Packit 577717
  * Only those registers enabled by the user's control information
Packit 577717
    are manipulated, instead of blindly manipulating all of them.
Packit 577717
Packit 577717
Version 0.7 1999-10-25
Packit 577717
- The init-time checks in version 0.6 of this driver showed that
Packit 577717
  RDMSR is a lot slower than RDPMC for reading the PMCs. The driver
Packit 577717
  now uses RDPMC instead of RDMSR whenever possible.
Packit 577717
- Added an mmap() operation to perfctr files. This allows any client
Packit 577717
  to read the accumulated counter state without making a system call.
Packit 577717
  The old "sync to user-provided buffer" method has been removed,
Packit 577717
  as it entailed additional copy operations and only worked for the
Packit 577717
  "active" process. The PERFCTR_READ operation has been replaced
Packit 577717
  by a simpler PERFCTR_SAMPLE operation, for the benefit of pre-MMX
Packit 577717
  Intel P5 processors which cannot sample counters in user-mode.
Packit 577717
  This rewrite actually simplified the code.
Packit 577717
- The AMD K7 should now be supported correctly. The init-time checks
Packit 577717
  in version 0.6 of this driver revealed that each K7 counter has
Packit 577717
  its own ENable bit. (Thanks to Nathan Slingerland for running the
Packit 577717
  test and reporting the results to me.)
Packit 577717
- Plugged a potential memory leak in perfctr_attach_task().
Packit 577717
- No longer piggyback on prctl(); sys_perfctr() is a real system call.
Packit 577717
- Some code cleanups.
Packit 577717
Packit 577717
Version 0.6 1999-09-08
Packit 577717
- Temporarily added some init-time code that checks the
Packit 577717
  costs of RDPMC/RDMSR/WRMSR operations applied to perfctr MSRs,
Packit 577717
  the semantics of the ENable bit on the Athlon, and gets
Packit 577717
  the boot-time value of the WinChip CESR register.
Packit 577717
  This code can be turned off by #defining INIT_DEBUG to 0.
Packit 577717
- Preliminary support for the AMD K7 Athlon processor.
Packit 577717
- The code will now build in both 2.3.x and 2.2.x kernels.
Packit 577717
Packit 577717
Version 0.5 1999-08-29
Packit 577717
- The user-space buffer is updated whenever state.status changes,
Packit 577717
  even when a remote command triggers the change.
Packit 577717
- Reworked and simplified the high-level code. All accesses
Packit 577717
  now require an attached file in order to implement proper
Packit 577717
  accounting and syncronisation. The only exception is UNLINK:
Packit 577717
  a process may always UNLINK its own PMCs.
Packit 577717
- Fixed counting bug in sys_perfctr_read().
Packit 577717
- Improved support for the Intel Pentium III.
Packit 577717
- Another WinChip fix: fake TSC update at process resume.
Packit 577717
- The code should now be safe for 'gcc -fstrict-aliasing'.
Packit 577717
Packit 577717
Version 0.4 1999-07-31
Packit 577717
- Implemented PERFCTR_ATTACH and PERFCTR_{READ,CONTROL,STOP,UNLINK}
Packit 577717
  on attached perfctrs. An attached perfctr is represented as a file.
Packit 577717
- Fixed an error in the WinChip-specific code.
Packit 577717
- Perfctrs now survive exec().
Packit 577717
Packit 577717
Version 0.3 1999-07-22
Packit 577717
- Interface now via sys_prctl() instead of /dev/perfctr.
Packit 577717
- Added NYI stubs for accessing other processes' perfctrs.
Packit 577717
- Moved to dynamic allocation of a task's perfctr state.
Packit 577717
- Minor code cleanups.
Packit 577717
Packit 577717
Version 0.2 1999-06-07
Packit 577717
- Added support for WinChip CPUs.
Packit 577717
- Restart counters from zero, not their previous values. This
Packit 577717
  corrected a problem for Intel P6 (WRMSR writes 32 bits to a PERFCTR
Packit 577717
  MSR and then sign-extends to 40 bits), and also simplified the code.
Packit 577717
- Added support for syncing the kernel's counter values to a user-
Packit 577717
  provided buffer each time a process is resumed. This feature, and
Packit 577717
  the fact that the driver enables RDPMC in processes using PMCs,
Packit 577717
  allows user-level computation of a process' accumulated counter
Packit 577717
  values without incurring the overhead of making a system call.
Packit 577717
Packit 577717
Version 0.1 1999-05-30
Packit 577717
- First public release.