Unverified Commit 3a4c6550 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!6846 perf/x86/amd: Fix crash due to race between amd_pmu_enable_all, perf NMI and throttling

parents 654ad5c7 a692f943
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -900,8 +900,7 @@ static int amd_pmu_handle_irq(struct pt_regs *regs)
	pmu_enabled = cpuc->enabled;
	cpuc->enabled = 0;

	/* stop everything (includes BRS) */
	amd_pmu_disable_all();
	amd_brs_disable_all();

	/* Drain BRS is in use (could be inactive) */
	if (cpuc->lbr_users)
@@ -912,7 +911,7 @@ static int amd_pmu_handle_irq(struct pt_regs *regs)

	cpuc->enabled = pmu_enabled;
	if (pmu_enabled)
		amd_pmu_enable_all(0);
		amd_brs_enable_all();

	return amd_pmu_adjust_nmi_window(handled);
}