All of lore.kernel.org
 help / color / mirror / Atom feed
* Fwd: [PATCH] x86/perf: Fixed kernel panic during boot on Nano processor.
       [not found] <3a7a5935-05ed-3054-b3fc-292202eef845@zhaoxin.com>
@ 2022-11-08  8:18 ` silviazhaooc
  0 siblings, 0 replies; only message in thread
From: silviazhaooc @ 2022-11-08  8:18 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, tglx, dave.hansen, x86, hpa, linux-perf-users,
	linux-kernel, Cobe Chen(BJ-RD), Louis Qi(BJ-RD),
	Silvia Zhao(BJ-RD),
	8vvbbqzo567a


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-08  8:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3a7a5935-05ed-3054-b3fc-292202eef845@zhaoxin.com>
2022-11-08  8:18 ` Fwd: [PATCH] x86/perf: Fixed kernel panic during boot on Nano processor silviazhaooc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.