Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-29 Thread Colton Lewis
Marc Zyngier writes: On Tue, 28 Jan 2025 22:08:27 +, Colton Lewis wrote: >> + bitmap_set(cpu_pmu->cntr_mask, 0, pmcr_n); >> + >> + if (reserved_guest_counters > 0 && reserved_guest_counters < pmcr_n) { >> + cpu_pmu->hpmn = reserved_guest_counters; >> +

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-29 Thread Marc Zyngier
On Tue, 28 Jan 2025 22:08:27 +, Colton Lewis wrote: > > >> + bitmap_set(cpu_pmu->cntr_mask, 0, pmcr_n); > >> + > >> + if (reserved_guest_counters > 0 && reserved_guest_counters < pmcr_n) { > >> + cpu_pmu->hpmn = reserved_guest_counters; > >> + cpu_pmu->partitioned = true;

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-28 Thread Colton Lewis
Colton Lewis writes: Hey Marc, thanks for looking. *for the review Marc Zyngier writes: On Mon, 27 Jan 2025 22:20:27 +, Colton Lewis wrote: /* Read the nb of CNTx counters supported from PMNC */ - bitmap_set(cpu_pmu->cntr_mask, - 0, FIELD_GET(ARM

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-28 Thread Colton Lewis
Hey Rob, thanks for the review. Rob Herring writes: On Mon, Jan 27, 2025 at 4:26 PM Colton Lewis wrote: @@ -1215,10 +1243,19 @@ static void __armv8pmu_probe_pmu(void *info) cpu_pmu->pmuver = pmuver; probe->present = true; + pmcr_n = FIELD_GET(ARMV8_PMU_PMCR_N, arm

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-28 Thread Colton Lewis
Hey Marc, thanks for looking. Marc Zyngier writes: On Mon, 27 Jan 2025 22:20:27 +, Colton Lewis wrote: For PMUv3, the register MDCR_EL2.HPMN partitiones the PMU counters into two ranges where counters 0..HPMN-1 are accessible by EL1 and, if allowed, EL0 while counters HPMN..N are only

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-28 Thread Rob Herring
On Mon, Jan 27, 2025 at 4:26 PM Colton Lewis wrote: > > For PMUv3, the register MDCR_EL2.HPMN partitiones the PMU counters > into two ranges where counters 0..HPMN-1 are accessible by EL1 and, if > allowed, EL0 while counters HPMN..N are only accessible by EL2. > > Introduce a module parameter in

Re: [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-28 Thread Marc Zyngier
On Mon, 27 Jan 2025 22:20:27 +, Colton Lewis wrote: > > For PMUv3, the register MDCR_EL2.HPMN partitiones the PMU counters > into two ranges where counters 0..HPMN-1 are accessible by EL1 and, if > allowed, EL0 while counters HPMN..N are only accessible by EL2. > > Introduce a module paramet

[RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU

2025-01-27 Thread Colton Lewis
For PMUv3, the register MDCR_EL2.HPMN partitiones the PMU counters into two ranges where counters 0..HPMN-1 are accessible by EL1 and, if allowed, EL0 while counters HPMN..N are only accessible by EL2. Introduce a module parameter in the PMUv3 driver to set this register. The name reserved_guest_c