From: "Liang, Kan" <kan.liang@linux.intel.com>
To: Vince Weaver <vincent.weaver@maine.edu>,
Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
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>
Subject: Re: [perf] unchecked MSR access error: WRMSR to 0x689 in intel_pmu_lbr_restore
Date: Tue, 12 Jul 2022 19:08:24 -0400 [thread overview]
Message-ID: <0e3b3e6e-53b9-b426-71cd-911d3ecbfc24@linux.intel.com> (raw)
In-Reply-To: <487465e6-b034-f08-907-de37a0a173b5@maine.edu>
On 2022-07-12 5:26 p.m., Vince Weaver wrote:
> On Tue, 12 Jul 2022, Pawan Gupta wrote:
>
>> On Tue, Jul 12, 2022 at 03:39:56PM -0400, Vince Weaver wrote:
>> It appears this CPU does not support TSX feature (or disabling TSX). If
>> the bug is easy to reproduce, bisecting can help.
>
> I thought TSX was disabled via firmware update for all Haswell machines?
>
> In any case, the fuzzer is triggering the
> unchecked MSR access error: WRMSR to 0x689
> in intel_pmu_lbr_restore. So either this is a false error and should be
> disabled, or else it's a real issue and should be fixed.
>
Could you please double check if the quirk can fix the issue on your
machine?
#Try write the exact same value from the error log to 0x689. The write
should fail.
wrmsr -p 0 0x689 0x1fffffff8101349e
#The quirk copy bits 59:60 to bits 61:62. The below write should succeed.
wrmsr -p 0 0x689 0x7fffffff8101349e
> Unfortunately the fuzzer can take up to a few days to trigger the message
> (it's not easily repeatable) so doing a kernel bisect would take a very
> long time.
>
The lbr_from_signext_quirk_needed() is only invoked at boot time. Maybe
we can dump some logs to understand which variable is not expected.
Could you please apply the below patch, reboot to the patched kernel and
share the dmesg log?
diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
index 13179f31fe10..50435ab627ad 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -300,6 +300,9 @@ static inline bool lbr_from_signext_quirk_needed(void)
bool tsx_support = boot_cpu_has(X86_FEATURE_HLE) ||
boot_cpu_has(X86_FEATURE_RTM);
+ pr_info("%s %s. LBR has tsx %d\n", boot_cpu_has(X86_FEATURE_HLE) ?
"HLE" : "NO HLE",
+ boot_cpu_has(X86_FEATURE_RTM) ? "RTM" : "NO RTM",
+ x86_pmu.lbr_has_tsx);
return !tsx_support && x86_pmu.lbr_has_tsx;
}
Thanks,
Kan
next prev parent reply other threads:[~2022-07-12 23:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 21:14 [perf] odd fuzzer generated trace " Vince Weaver
2022-07-08 16:13 ` [perf] unchecked MSR access error: WRMSR to 0x689 " Vince Weaver
2022-07-11 15:25 ` Liang, Kan
2022-07-11 21:13 ` Vince Weaver
2022-07-12 0:11 ` Liang, Kan
2022-07-11 22:16 ` Pawan Gupta
2022-07-12 19:39 ` Vince Weaver
2022-07-12 20:48 ` Pawan Gupta
2022-07-12 21:26 ` Vince Weaver
2022-07-12 23:08 ` Liang, Kan [this message]
2022-07-14 16:12 ` Vince Weaver
2022-07-14 17:50 ` Liang, Kan
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=0e3b3e6e-53b9-b426-71cd-911d3ecbfc24@linux.intel.com \
--to=kan.liang@linux.intel.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=peterz@infradead.org \
--cc=vincent.weaver@maine.edu \
/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
all inboxes | Powered by JetHome®