Performance counters (for branch misprediction)

Hi,

I’m using a U74 based SoC (StarFive Visionfive v1) and I’d like to count branch mispredictions.
I have MCOUNTEREN and SCOUNTEREN set to all 1’s, and I have MHPMEVENT3 setup to count mispredictions (0x6001), and I have MHPMEVENT4 setup to count branch instructions (0x1C000).

I can read (in user mode) HPMCOUNTER4 and get a sensible value, but when I read HPMCOUNTER3, I get an illegal instruction fault.
If I switch HPMEVENT3 & 4 configuration around, I get the fault on whichever counter is trying to count mispredictions.

Any clue?