From: silviazhaooc <silviazhao-oc@zhaoxin.com>
To: Borislav Petkov <bp@alien8.de>
Cc: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>,
<mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>,
<jolsa@kernel.org>, <namhyung@kernel.org>, <tglx@linutronix.de>,
<dave.hansen@linux.intel.com>, <x86@kernel.org>, <hpa@zytor.com>,
<linux-perf-users@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
"Cobe Chen(BJ-RD)" <CobeChen@zhaoxin.com>,
"Louis Qi(BJ-RD)" <LouisQi@zhaoxin.com>,
"Silvia Zhao(BJ-RD)" <SilviaZhao@zhaoxin.com>,
<8vvbbqzo567a@nospam.xutrox.com>
Subject: Fwd: [PATCH] x86/perf: Fixed kernel panic during boot on Nano processor.
Date: Tue, 8 Nov 2022 16:18:02 +0800 [thread overview]
Message-ID: <3c7da7fd-402f-c74f-c96c-0e88828eab58@zhaoxin.com> (raw)
In-Reply-To: <3a7a5935-05ed-3054-b3fc-292202eef845@zhaoxin.com>
On 2022/11/3 18:07, Borislav Petkov wrote:
>
> On Thu, Nov 03, 2022 at 11:23:04AM +0800, silviazhao-oc wrote:
>> Nano processor may not fully support rdpmc instruction,
>
> What does that even mean? Not fully support?
rdpmc instruction on Nano processor has a limitation that it cannot
access fixed performance counter, while it can read general pmc counter
successfully.
>
>> it works well for reading general pmc counter, but will lead
>> GP(general protection) when accessing fixed pmc counter.
>
> RDPMC will #GP when the perf counter specified cannot be read.
>
> AFAICT, that is RCX: 0000000040000001 which looks like perf counter index 1 with INTEL_PMC_FIXED_RDPMC_BASE ORed in.
Yes, RCX: 0000000040000001 indicates we are accessing fixed performance
counters with index 1.
>
>> Furthermore, family/mode information is same between Nano processor
>> and ZX-C processor, it leads to zhaoxin pmu driver is wrongly loaded
>> for Nano processor, which resulting boot kernal fail.
>
> So *that* is the real problem - it tries to access perf counters thinking it is running on architectural perf counters implementation but nano doesn't have that.
Actually Nano do support architectural perf counters. But due to rdpmc
instruction issue, accessing fixed counters via rdpmc will cause GP.
>
>> To solve this problem, stepping information will be checked to
>> distinguish between Nano processor and ZX-C processor.
>
> Why doesn't that ZXC thing doesn't have a CPUID flag to check instead of looking at models and steppings and thus confusing it with a nano CPU?
Nano and ZXC both support architectural perf counters, and they both
have a CPUID flag to check that. The difference is Nano has rdpmc issue
while ZXC does not, which cannot be checked through CPUID.
>
>> [https://bugzilla.kernel.org/show_bug.cgi?id=212389]
>>
>> Reported-by: Arjan <8vvbbqzo567a@nospam.xutrox.com>
>
> Does Arjan have a last name?
Sorry, I don't know Arjan either.
>
>> Signed-off-by: silviazhao-oc <silviazhao-oc@zhaoxin.com>
>
> I'm assuming your name is properly spelled "Silvia Zhao" and not in a single word with a "-oc" string appended at the end, yes?
Yes, Silvia Zhao is my name.
Thx for your kindly reply.
>
> Thx.
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
parent reply other threads:[~2022-11-08 8:36 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <3a7a5935-05ed-3054-b3fc-292202eef845@zhaoxin.com>]
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=3c7da7fd-402f-c74f-c96c-0e88828eab58@zhaoxin.com \
--to=silviazhao-oc@zhaoxin.com \
--cc=8vvbbqzo567a@nospam.xutrox.com \
--cc=CobeChen@zhaoxin.com \
--cc=LouisQi@zhaoxin.com \
--cc=SilviaZhao@zhaoxin.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.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;
as well as URLs for NNTP newsgroup(s).