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

« 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, Ubuntu: 3.2.0-19.31, Ubuntu: 3.2.0-19.30
  • Date: 2012-03-21 15:23:51 UTC
  • Revision ID: package-import@ubuntu.com-20120321152351-ya52awpl9cmqlwrs
Tags: 3.2.0-1410.13
[ Paolo Pisati ]

* rebased on Ubuntu-3.2.0-19.31

[ Ubuntu: 3.2.0-19.31 ]

* d-i: Add dm-multipath and scsi device handlers
  - LP: #959749
* d-i: Move multipath modules into their own udeb
  - LP: #598251, #959749
* [Config] Auto-detect do_tools setting
* [Config] correctly specify CROSS_COMPILE for tools build
* [Config] CONFIG_DRM_PSB_CDV=n
* Rebase to v3.2.12
* powerpc/pmac: Fix SMP kernels on pre-core99 UP machines
  - LP: #959959
* rebase to v3.2.12

[ Ubuntu: 3.2.0-19.30 ]

* [Config] Fix typeo in the Hyper-V module names
* [Config] Move kernels to "Section: kernel"
  - LP: #499557
* SAUCE: AppArmor: Add ability to load extended policy
* SAUCE: AppArmor: Add the ability to mediate mount
* SAUCE: AppArmor: Add profile introspection file to interface
* SAUCE: AppArmor: basic networking rules
* [Config] Disable CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER
  - LP: #952035
* Rebase to v3.2.10
* [Config] Update configs after rebase to v3.2.10
* Rebase to v3.2.11
* [Config] Disable CONFIG_STUB_POULSBO
  - LP: #899244
* [Config] Add CONFIG_DRM_PSB check to enforcer
  - LP: #899244
* [Config] Drop non-SMP powerpc
* net/hyperv: Use the built-in macro KBUILD_MODNAME for this driver
* x86: Derandom delay_tsc for 64 bit
* Bluetooth: Fix l2cap conn failures for ssp devices
  - LP: #872044
* KVM: x86: extend "struct x86_emulate_ops" with "get_cpuid"
  - LP: #917842
  - CVE-2012-0045
* KVM: x86: fix missing checks in syscall emulation
  - LP: #917842
  - CVE-2012-0045
* rebase to v3.2.11
* rebase to v3.2.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <linux/perf_event.h>
 
2
#include <linux/export.h>
2
3
#include <linux/types.h>
3
4
#include <linux/init.h>
4
5
#include <linux/slab.h>
357
358
        struct amd_nb *nb;
358
359
        int i, nb_id;
359
360
 
360
 
        if (boot_cpu_data.x86_max_cores < 2)
 
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)
361
364
                return;
362
365
 
363
366
        nb_id = amd_get_nb_id(cpu);
587
590
        .put_event_constraints  = amd_put_event_constraints,
588
591
 
589
592
        .cpu_prepare            = amd_pmu_cpu_prepare,
590
 
        .cpu_starting           = amd_pmu_cpu_starting,
591
593
        .cpu_dead               = amd_pmu_cpu_dead,
592
594
#endif
 
595
        .cpu_starting           = amd_pmu_cpu_starting,
593
596
};
594
597
 
595
598
__init int amd_pmu_init(void)
621
624
 
622
625
        return 0;
623
626
}
 
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);