Re: [PATCH V1] arm64: perf: Change PMCR write to read-modify-write

From: Srinivasarao Pathipati (Consultant)
Date: Wed Apr 27 2022 - 07:09:47 EST


>
>On 2022-04-27 10:51, Srinivasarao Pathipati wrote:
>> Preserve the bitfields of PMCR_EL0 during PMU reset.
>> Reset routine should set only PMCR.C, PMCR.P and PMCR.LC fields only
>> to reset the counters. Other fields should not be changed
>> as they could be set before PMU initialization and their value must
>> be preserved even after reset.
>
>No. We also want to ensure PMCR.E and PMCR.D are set to 0, for example.
>Given that nearly all the writeable fields in PMCR reset to an
>architecturally UNKNOWN value, preserving that is clearly nonsense.
>What's your *real* motivation here?

Thanks Robin for reviewing this patch.
The X bit is set by firmware on Qualcomm chipsets
same is getting cleared by kernel from armv8pmu_reset().
We are trying to retain this bit with this patch.

If it is wrong to retaining all bits? can we just retain X bit?