Re: [PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-25 Thread Peter Maydell
On Sat, 20 Jul 2024 at 16:19, Peter Maydell wrote: > > On Thu, 18 Jul 2024 at 03:15, Alistair Francis wrote: > > > > From: Atish Patra > > > > The timer is setup function is invoked in both hpmcounter > > write and mcountinhibit write path. If the OF bit set, the > > LCOFI interrupt is disabled.

Re: [PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-24 Thread Richard Henderson
On 7/25/24 05:00, Daniel Henrique Barboza wrote: I'm not sure about which generic functions we're supposed to use in replace of get_field/set_field, at least as far as bitops.h goes. extract64/deposit64 has a different API (it uses start bit + length, not a mask) and it would require a lot of RIS

Re: [PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-24 Thread Daniel Henrique Barboza
On 7/22/24 8:33 PM, Atish Kumar Patra wrote: On Sat, Jul 20, 2024 at 8:19 AM Peter Maydell wrote: On Thu, 18 Jul 2024 at 03:15, Alistair Francis wrote: From: Atish Patra The timer is setup function is invoked in both hpmcounter write and mcountinhibit write path. If the OF bit set, the

Re: [PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-22 Thread Richard Henderson
On 7/23/24 10:43, Alistair Francis wrote: #define get_field(reg, mask) (((reg) & \ (uint64_t)(mask)) / ((mask) & ~((mask) << 1))) Notice that part of this expression is "(mask) << 1". So Coverity complains that we took a constant value and shifted it right off the top. I think

Re: [PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-22 Thread Alistair Francis
On Tue, Jul 23, 2024 at 9:33 AM Atish Kumar Patra wrote: > > On Sat, Jul 20, 2024 at 8:19 AM Peter Maydell > wrote: > > > > On Thu, 18 Jul 2024 at 03:15, Alistair Francis wrote: > > > > > > From: Atish Patra > > > > > > The timer is setup function is invoked in both hpmcounter > > > write and

Re: [PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-22 Thread Atish Kumar Patra
On Sat, Jul 20, 2024 at 8:19 AM Peter Maydell wrote: > > On Thu, 18 Jul 2024 at 03:15, Alistair Francis wrote: > > > > From: Atish Patra > > > > The timer is setup function is invoked in both hpmcounter > > write and mcountinhibit write path. If the OF bit set, the > > LCOFI interrupt is disable

Re: [PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-20 Thread Peter Maydell
On Thu, 18 Jul 2024 at 03:15, Alistair Francis wrote: > > From: Atish Patra > > The timer is setup function is invoked in both hpmcounter > write and mcountinhibit write path. If the OF bit set, the > LCOFI interrupt is disabled. There is no benefitting in > setting up the qemu timer until LCOFI

[PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-17 Thread Alistair Francis
From: Atish Patra The timer is setup function is invoked in both hpmcounter write and mcountinhibit write path. If the OF bit set, the LCOFI interrupt is disabled. There is no benefitting in setting up the qemu timer until LCOFI is cleared to indicate that interrupts can be fired again. Reviewed