Commit fb5f22f8 authored by Stephane Eranian's avatar Stephane Eranian Committed by Xie Haocheng
Browse files

perf/x86/amd: Add idle hooks for branch sampling

mainline inclusion
from mainline-v5.19
commit d5616bac
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5S3WV


CVE: NA

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

On AMD Fam19h Zen3, the branch sampling (BRS) feature must be disabled before
entering low power and re-enabled (if was active) when returning from low
power. Otherwise, the NMI interrupt may be held up for too long and cause
problems. Stopping BRS will cause the NMI to be delivered if it was held up.

Define a perf_amd_brs_lopwr_cb() callback to stop/restart BRS.  The callback
is protected by a jump label which is enabled only when AMD BRS is detected.
In all other cases, the callback is never called.

Signed-off-by: default avatarStephane Eranian <eranian@google.com>
[peterz: static_call() and build fixes]
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220322221517.2510440-10-eranian@google.com


Signed-off-by: default avatarXie Haocheng <haocheng.xie@amd.com>
parent 3b78990f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment