From: Sandipan Das <sandipan.das@amd.com>
To: Peter Zijlstra <peterz@infradead.org>, Breno Leitao <leitao@debian.org>
Cc: Jirka Hladky <jhladky@redhat.com>, Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
leit@fb.com, dcostantino@meta.com,
"open list:PERFORMANCE EVENTS SUBSYSTEM"
<linux-perf-users@vger.kernel.org>,
"open list:PERFORMANCE EVENTS SUBSYSTEM"
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf/x86/amd: Do not WARN on every IRQ
Date: Thu, 14 Sep 2023 16:52:13 +0530 [thread overview]
Message-ID: <b1cf5990-1019-49ea-a1e8-e22410922801@amd.com> (raw)
In-Reply-To: <20230914111845.GF16631@noisy.programming.kicks-ass.net>
On 9/14/2023 4:48 PM, Peter Zijlstra wrote:
> On Thu, Sep 14, 2023 at 02:30:43AM -0700, Breno Leitao wrote:
>> On Thu, Sep 14, 2023 at 11:12:34AM +0200, Peter Zijlstra wrote:
>>> On Thu, Sep 14, 2023 at 02:25:40PM +0530, Sandipan Das wrote:
>>
>>>> I agree with using WARN_ON_ONCE() to make this less intrusive.
>>>
>>> Could you send a patch that AMD is happy with?
>>
>> Why the current patch is not good enough?
>
> Sandipan, can you answer this? I don't tihnk I'm qualified to speak for
> the AMD pmu and certainly I don't have insight into their design future.
Hi Breno,
Functionally, the patch looks good to me and I will be reusing it
without any change to the authorship. However, as Peter suggested, I
wanted to add a message to prompt users to update the microcode and
also call out the required patch levels in the commit message since
different Zen 4 variants and steppings use different microcode.
Here's what I plan to send.
diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c
index abadd5f23425..186a124bb3c0 100644
--- a/arch/x86/events/amd/core.c
+++ b/arch/x86/events/amd/core.c
@@ -909,6 +909,13 @@ static int amd_pmu_v2_handle_irq(struct pt_regs *regs)
status &= ~GLOBAL_STATUS_LBRS_FROZEN;
}
+ if (status & ~amd_pmu_global_cntr_mask)
+ pr_warn_once("Unknown status bits are set (0x%llx), please consider updating microcode\n",
+ status);
+
+ /* Clear any reserved bits set by buggy microcode */
+ status &= amd_pmu_global_cntr_mask;
+
for (idx = 0; idx < x86_pmu.num_counters; idx++) {
if (!test_bit(idx, cpuc->active_mask))
continue;
--
Hi Peter,
There is another case where users will see warnings but the patch
to fix it (link below) is yet to be reviewed. May I rebase and
resend it along with the above?
https://lore.kernel.org/all/20230613105809.524535-1-sandipan.das@amd.com/
next prev parent reply other threads:[~2023-09-14 11:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 11:53 Breno Leitao
2023-06-16 13:29 ` Peter Zijlstra
2023-06-16 14:03 ` Breno Leitao
2023-06-16 14:43 ` Sandipan Das (AMD)
2023-06-16 15:32 ` Peter Zijlstra
2023-09-13 14:30 ` Jirka Hladky
2023-09-13 15:03 ` Breno Leitao
2023-09-13 15:23 ` Jirka Hladky
2023-09-13 16:18 ` Sandipan Das
2023-09-14 8:44 ` Jirka Hladky
[not found] ` <CAE4VaGAcWk0PYygNGcguRA2V2qK03entkv6BUsnxhS-ftdfywg@mail.gmail.com>
2023-09-14 8:49 ` Sandipan Das
2023-09-13 16:24 ` Breno Leitao
2023-09-14 8:45 ` Jirka Hladky
2023-09-14 8:55 ` Sandipan Das
2023-09-14 9:12 ` Peter Zijlstra
2023-09-14 9:14 ` Sandipan Das
2023-09-14 9:30 ` Breno Leitao
2023-09-14 11:18 ` Peter Zijlstra
2023-09-14 11:22 ` Sandipan Das [this message]
2023-09-14 11:27 ` Peter Zijlstra
2023-09-14 12:21 ` Breno Leitao
2023-09-14 13:50 ` Jirka Hladky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b1cf5990-1019-49ea-a1e8-e22410922801@amd.com \
--to=sandipan.das@amd.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=dcostantino@meta.com \
--cc=hpa@zytor.com \
--cc=irogers@google.com \
--cc=jhladky@redhat.com \
--cc=jolsa@kernel.org \
--cc=leit@fb.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome