提交 0fdcd3a3 编写于 作者: J Julien Thierry 提交者: Xie XiuQi

armv8 remove pmu locking

hulk inclusion
category: feature
bugzilla: 12804
CVE: NA

-------------------------------------------------
Signed-off-by: NJulien Thierry <julien.thierry@arm.com>
Signed-off-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 d55eae51
...@@ -778,15 +778,10 @@ static inline u32 armv8pmu_getreset_flags(void) ...@@ -778,15 +778,10 @@ static inline u32 armv8pmu_getreset_flags(void)
static void armv8pmu_enable_event(struct perf_event *event) static void armv8pmu_enable_event(struct perf_event *event)
{ {
unsigned long flags;
struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu);
struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events);
/* /*
* Enable counter and interrupt, and set the counter to count * Enable counter and interrupt, and set the counter to count
* the event that we're interested in. * the event that we're interested in.
*/ */
raw_spin_lock_irqsave(&events->pmu_lock, flags);
/* /*
* Disable counter * Disable counter
...@@ -807,21 +802,10 @@ static void armv8pmu_enable_event(struct perf_event *event) ...@@ -807,21 +802,10 @@ static void armv8pmu_enable_event(struct perf_event *event)
* Enable counter * Enable counter
*/ */
armv8pmu_enable_event_counter(event); armv8pmu_enable_event_counter(event);
raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
} }
static void armv8pmu_disable_event(struct perf_event *event) static void armv8pmu_disable_event(struct perf_event *event)
{ {
unsigned long flags;
struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu);
struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events);
/*
* Disable counter and interrupt
*/
raw_spin_lock_irqsave(&events->pmu_lock, flags);
/* /*
* Disable counter * Disable counter
*/ */
...@@ -831,30 +815,22 @@ static void armv8pmu_disable_event(struct perf_event *event) ...@@ -831,30 +815,22 @@ static void armv8pmu_disable_event(struct perf_event *event)
* Disable interrupt for this counter * Disable interrupt for this counter
*/ */
armv8pmu_disable_event_irq(event); armv8pmu_disable_event_irq(event);
raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
} }
static void armv8pmu_start(struct arm_pmu *cpu_pmu) static void armv8pmu_start(struct arm_pmu *cpu_pmu)
{ {
unsigned long flags; preempt_disable();
struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events);
raw_spin_lock_irqsave(&events->pmu_lock, flags);
/* Enable all counters */ /* Enable all counters */
armv8pmu_pmcr_write(armv8pmu_pmcr_read() | ARMV8_PMU_PMCR_E); armv8pmu_pmcr_write(armv8pmu_pmcr_read() | ARMV8_PMU_PMCR_E);
raw_spin_unlock_irqrestore(&events->pmu_lock, flags); preempt_enable();
} }
static void armv8pmu_stop(struct arm_pmu *cpu_pmu) static void armv8pmu_stop(struct arm_pmu *cpu_pmu)
{ {
unsigned long flags; preempt_disable();
struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events);
raw_spin_lock_irqsave(&events->pmu_lock, flags);
/* Disable all counters */ /* Disable all counters */
armv8pmu_pmcr_write(armv8pmu_pmcr_read() & ~ARMV8_PMU_PMCR_E); armv8pmu_pmcr_write(armv8pmu_pmcr_read() & ~ARMV8_PMU_PMCR_E);
raw_spin_unlock_irqrestore(&events->pmu_lock, flags); preempt_enable();
} }
static irqreturn_t armv8pmu_handle_irq(struct arm_pmu *cpu_pmu) static irqreturn_t armv8pmu_handle_irq(struct arm_pmu *cpu_pmu)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册