Re: [PATCH v1] LoongArch: Refine init_hw_perf_events()
From: Tiezhu Yang
Date: Sun Nov 09 2025 - 09:10:50 EST
On 11/3/25 17:09, Huacai Chen wrote:
Applied without rename loongson to loongson64, because loongson32 and
loongson64 have different event numbers, they need to be
distinguished.
Huacai
On Tue, Oct 14, 2025 at 3:02 PM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:
(1) Use the existing CPUCFG6_PMNUM_SHIFT macro definition instead of
the magic value 4 to get the PMU number.
(2) Detect the value of PMU bits via CPUCFG instruction according to
the ISA manual instead of hard-coded as 64, because the value may be
different for various microarchitectures.
(3) Rename the PMU name without the postfix 64 due to it is redundant
and may be inaccurate.
Link: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_cpucfg
Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
I just saw the following reply about the patch title "Refine":
"I'm not really sure what "Refine ... about HIGHMEM" is supposed
to mean. Might it be clearer to title this something like "Remove
necessary highmem in ..."?"
https://lore.kernel.org/linux-mm/aQ4lU02gPNCO9eXB@fedora/
This patch title is not clear too, should it split into two patches?
The patch title can be:
(1) LoongArch: Use CPUCFG6_PMNUM_SHIFT to get PMU number
(2) LoongArch: Detect PMU bits via CPUCFG instruction
Thanks,
Tiezhu