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

arm64: perf: Do not call irq_work_run in NMI context

hulk inclusion
category: feature
bugzilla: 12804
CVE: NA

-------------------------------------------------

Function irq_work_run is not NMI safe and should not be called from NMI
context.

When PMU interrupt is an NMI do not call irq_work_run. Instead rely on the
IRQ work IPI to run the irq_work queue once NMI/IRQ contexts have been
exited.
Signed-off-by: NJulien Thierry <julien.thierry@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 3ef18ed9
...@@ -895,6 +895,7 @@ static irqreturn_t armv8pmu_handle_irq(struct arm_pmu *cpu_pmu) ...@@ -895,6 +895,7 @@ static irqreturn_t armv8pmu_handle_irq(struct arm_pmu *cpu_pmu)
* platforms that can have the PMU interrupts raised as an NMI, this * platforms that can have the PMU interrupts raised as an NMI, this
* will not work. * will not work.
*/ */
if (!in_nmi())
irq_work_run(); irq_work_run();
return IRQ_HANDLED; return IRQ_HANDLED;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册