|
@@ -173,7 +173,7 @@ static int validate_ctr_auth(const struct hw_perf_event *hwc)
|
|
*/
|
|
*/
|
|
static void cpumf_pmu_enable(struct pmu *pmu)
|
|
static void cpumf_pmu_enable(struct pmu *pmu)
|
|
{
|
|
{
|
|
- struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
int err;
|
|
int err;
|
|
|
|
|
|
if (cpuhw->flags & PMU_F_ENABLED)
|
|
if (cpuhw->flags & PMU_F_ENABLED)
|
|
@@ -196,7 +196,7 @@ static void cpumf_pmu_enable(struct pmu *pmu)
|
|
*/
|
|
*/
|
|
static void cpumf_pmu_disable(struct pmu *pmu)
|
|
static void cpumf_pmu_disable(struct pmu *pmu)
|
|
{
|
|
{
|
|
- struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
int err;
|
|
int err;
|
|
u64 inactive;
|
|
u64 inactive;
|
|
|
|
|
|
@@ -230,7 +230,7 @@ static void cpumf_measurement_alert(struct ext_code ext_code,
|
|
return;
|
|
return;
|
|
|
|
|
|
inc_irq_stat(IRQEXT_CMC);
|
|
inc_irq_stat(IRQEXT_CMC);
|
|
- cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
|
|
|
|
/* Measurement alerts are shared and might happen when the PMU
|
|
/* Measurement alerts are shared and might happen when the PMU
|
|
* is not reserved. Ignore these alerts in this case. */
|
|
* is not reserved. Ignore these alerts in this case. */
|
|
@@ -250,7 +250,7 @@ static void cpumf_measurement_alert(struct ext_code ext_code,
|
|
#define PMC_RELEASE 1
|
|
#define PMC_RELEASE 1
|
|
static void setup_pmc_cpu(void *flags)
|
|
static void setup_pmc_cpu(void *flags)
|
|
{
|
|
{
|
|
- struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
|
|
|
|
switch (*((int *) flags)) {
|
|
switch (*((int *) flags)) {
|
|
case PMC_INIT:
|
|
case PMC_INIT:
|
|
@@ -475,7 +475,7 @@ static void cpumf_pmu_read(struct perf_event *event)
|
|
|
|
|
|
static void cpumf_pmu_start(struct perf_event *event, int flags)
|
|
static void cpumf_pmu_start(struct perf_event *event, int flags)
|
|
{
|
|
{
|
|
- struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
struct hw_perf_event *hwc = &event->hw;
|
|
struct hw_perf_event *hwc = &event->hw;
|
|
|
|
|
|
if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED)))
|
|
if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED)))
|
|
@@ -506,7 +506,7 @@ static void cpumf_pmu_start(struct perf_event *event, int flags)
|
|
|
|
|
|
static void cpumf_pmu_stop(struct perf_event *event, int flags)
|
|
static void cpumf_pmu_stop(struct perf_event *event, int flags)
|
|
{
|
|
{
|
|
- struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
struct hw_perf_event *hwc = &event->hw;
|
|
struct hw_perf_event *hwc = &event->hw;
|
|
|
|
|
|
if (!(hwc->state & PERF_HES_STOPPED)) {
|
|
if (!(hwc->state & PERF_HES_STOPPED)) {
|
|
@@ -527,7 +527,7 @@ static void cpumf_pmu_stop(struct perf_event *event, int flags)
|
|
|
|
|
|
static int cpumf_pmu_add(struct perf_event *event, int flags)
|
|
static int cpumf_pmu_add(struct perf_event *event, int flags)
|
|
{
|
|
{
|
|
- struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
|
|
|
|
/* Check authorization for the counter set to which this
|
|
/* Check authorization for the counter set to which this
|
|
* counter belongs.
|
|
* counter belongs.
|
|
@@ -551,7 +551,7 @@ static int cpumf_pmu_add(struct perf_event *event, int flags)
|
|
|
|
|
|
static void cpumf_pmu_del(struct perf_event *event, int flags)
|
|
static void cpumf_pmu_del(struct perf_event *event, int flags)
|
|
{
|
|
{
|
|
- struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
|
|
|
|
cpumf_pmu_stop(event, PERF_EF_UPDATE);
|
|
cpumf_pmu_stop(event, PERF_EF_UPDATE);
|
|
|
|
|
|
@@ -575,7 +575,7 @@ static void cpumf_pmu_del(struct perf_event *event, int flags)
|
|
*/
|
|
*/
|
|
static void cpumf_pmu_start_txn(struct pmu *pmu)
|
|
static void cpumf_pmu_start_txn(struct pmu *pmu)
|
|
{
|
|
{
|
|
- struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
|
|
|
|
perf_pmu_disable(pmu);
|
|
perf_pmu_disable(pmu);
|
|
cpuhw->flags |= PERF_EVENT_TXN;
|
|
cpuhw->flags |= PERF_EVENT_TXN;
|
|
@@ -589,7 +589,7 @@ static void cpumf_pmu_start_txn(struct pmu *pmu)
|
|
*/
|
|
*/
|
|
static void cpumf_pmu_cancel_txn(struct pmu *pmu)
|
|
static void cpumf_pmu_cancel_txn(struct pmu *pmu)
|
|
{
|
|
{
|
|
- struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
|
|
|
|
WARN_ON(cpuhw->tx_state != cpuhw->state);
|
|
WARN_ON(cpuhw->tx_state != cpuhw->state);
|
|
|
|
|
|
@@ -604,7 +604,7 @@ static void cpumf_pmu_cancel_txn(struct pmu *pmu)
|
|
*/
|
|
*/
|
|
static int cpumf_pmu_commit_txn(struct pmu *pmu)
|
|
static int cpumf_pmu_commit_txn(struct pmu *pmu)
|
|
{
|
|
{
|
|
- struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
|
|
|
|
|
+ struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
|
|
u64 state;
|
|
u64 state;
|
|
|
|
|
|
/* check if the updated state can be scheduled */
|
|
/* check if the updated state can be scheduled */
|