Page MenuHomeFreeBSD

D30602.id90277.diff
No OneTemporary

D30602.id90277.diff

Index: sys/dev/hwpmc/hwpmc_arm64.c
===================================================================
--- sys/dev/hwpmc/hwpmc_arm64.c
+++ sys/dev/hwpmc/hwpmc_arm64.c
@@ -181,9 +181,15 @@
}
pe = a->pm_ev;
- config = (uint32_t)pe - PMC_EV_ARMV8_FIRST;
- if (config > (PMC_EV_ARMV8_LAST - PMC_EV_ARMV8_FIRST))
+ /*
+ * pm_ev may contain the raw event code, or an ARMV8-class event code in the
+ * range [PMC_EV_ARMV8_FIRST, PMC_EV_ARMV8_LAST].
+ */
+ config = (uint32_t)pe;
+ if (config > PMC_EV_ARMV8_LAST)
return (EINVAL);
+ else if (config >= PMC_EV_ARMV8_FIRST)
+ config -= PMC_EV_ARMV8_FIRST;
pm->pm_md.pm_arm64.pm_arm64_evsel = config;
PMCDBG2(MDP, ALL, 2, "arm64-allocate ri=%d -> config=0x%x", ri, config);

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 29, 6:22 AM (14 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32328722
Default Alt Text
D30602.id90277.diff (732 B)

Event Timeline