diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2016-04-09 01:02:17 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2016-04-09 01:02:17 +0000 |
commit | 60a000630bf328e79060f1996315227510e9c27e (patch) | |
tree | 4d40f0b1f01f7b7c30e776bf251c0c0d2811b39f /sys/dev/hwpmc | |
parent | aebce00b4b69c5728fa19631858fd85ad7bbd05a (diff) | |
download | FreeBSD-src-60a000630bf328e79060f1996315227510e9c27e.zip FreeBSD-src-60a000630bf328e79060f1996315227510e9c27e.tar.gz |
Fix a masking bug for e500 PMC.
No idea how this slipped through my regression testing. pe_code is the event to
count, pe_cpu is the CPU family mask.
Diffstat (limited to 'sys/dev/hwpmc')
-rw-r--r-- | sys/dev/hwpmc/hwpmc_e500.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/hwpmc/hwpmc_e500.c b/sys/dev/hwpmc/hwpmc_e500.c index f8ae119..dbec7ae 100644 --- a/sys/dev/hwpmc/hwpmc_e500.c +++ b/sys/dev/hwpmc/hwpmc_e500.c @@ -507,6 +507,7 @@ e500_allocate_pmc(int cpu, int ri, struct pmc *pm, pe = a->pm_ev; config = PMLCax_FCS | PMLCax_FCU | PMLCax_FCM1 | PMLCax_FCM1; + if (pe < PMC_EV_E500_FIRST || pe > PMC_EV_E500_LAST) return (EINVAL); @@ -517,14 +518,14 @@ e500_allocate_pmc(int cpu, int ri, struct pmc *pm, vers = mfpvr() >> 16; switch (vers) { case FSL_E500v1: - pe_cpu_mask = ev->pe_code & PMC_PPC_E500V1; + pe_cpu_mask = ev->pe_cpu & PMC_PPC_E500V1; break; case FSL_E500v2: - pe_cpu_mask = ev->pe_code & PMC_PPC_E500V2; + pe_cpu_mask = ev->pe_cpu & PMC_PPC_E500V2; break; case FSL_E500mc: case FSL_E5500: - pe_cpu_mask = ev->pe_code & PMC_PPC_E500MC; + pe_cpu_mask = ev->pe_cpu & PMC_PPC_E500MC; break; } if (pe_cpu_mask == 0) |