~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/x86/kernel/cpu/perf_event_amd.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Upstream Kernel Changes
  • Date: 2012-03-27 17:01:30 UTC
  • Revision ID: package-import@ubuntu.com-20120327170130-qrvi60snnxty6ibi
Tags: 3.2.0-1411.14
[ Paolo Pisati ]

* Revert to Ubuntu-3.2.0-1409.12 until we figure out what's wrong with hdmi
  - LP: #963512

[ Upstream Kernel Changes ]

* Revert "Reapply upleveled PMU interrupt patch"
* KBuild: Allow scripts/* to be cross compiled
* LINARO: Use KBUILD_SCRIPTROOT to cross build scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <linux/perf_event.h>
2
 
#include <linux/export.h>
3
2
#include <linux/types.h>
4
3
#include <linux/init.h>
5
4
#include <linux/slab.h>
358
357
        struct amd_nb *nb;
359
358
        int i, nb_id;
360
359
 
361
 
        cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY;
362
 
 
363
 
        if (boot_cpu_data.x86_max_cores < 2 || boot_cpu_data.x86 == 0x15)
 
360
        if (boot_cpu_data.x86_max_cores < 2)
364
361
                return;
365
362
 
366
363
        nb_id = amd_get_nb_id(cpu);
590
587
        .put_event_constraints  = amd_put_event_constraints,
591
588
 
592
589
        .cpu_prepare            = amd_pmu_cpu_prepare,
 
590
        .cpu_starting           = amd_pmu_cpu_starting,
593
591
        .cpu_dead               = amd_pmu_cpu_dead,
594
592
#endif
595
 
        .cpu_starting           = amd_pmu_cpu_starting,
596
593
};
597
594
 
598
595
__init int amd_pmu_init(void)
624
621
 
625
622
        return 0;
626
623
}
627
 
 
628
 
void amd_pmu_enable_virt(void)
629
 
{
630
 
        struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
631
 
 
632
 
        cpuc->perf_ctr_virt_mask = 0;
633
 
 
634
 
        /* Reload all events */
635
 
        x86_pmu_disable_all();
636
 
        x86_pmu_enable_all(0);
637
 
}
638
 
EXPORT_SYMBOL_GPL(amd_pmu_enable_virt);
639
 
 
640
 
void amd_pmu_disable_virt(void)
641
 
{
642
 
        struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
643
 
 
644
 
        /*
645
 
         * We only mask out the Host-only bit so that host-only counting works
646
 
         * when SVM is disabled. If someone sets up a guest-only counter when
647
 
         * SVM is disabled the Guest-only bits still gets set and the counter
648
 
         * will not count anything.
649
 
         */
650
 
        cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY;
651
 
 
652
 
        /* Reload all events */
653
 
        x86_pmu_disable_all();
654
 
        x86_pmu_enable_all(0);
655
 
}
656
 
EXPORT_SYMBOL_GPL(amd_pmu_disable_virt);