cortex-a8: fix check_export_pmu

- read PMUSERENR_ENABLE first before updating. On the cortex-a8
(specifically omap3) not doing this would result in the kernel aborting.
- do not read DBGDSCR_ext on cortex-a8, read DBGDSCR_int. This is only
implemented in armv7.1, not armv7, and also causes the kernel to abort.
This commit is contained in:
Anna Lyons 2019-06-19 10:44:53 +10:00
parent 664ac2288c
commit 81316c5be3
2 changed files with 6 additions and 2 deletions

View file

@ -25,8 +25,11 @@
static inline word_t readDscrCp(void)
{
word_t v;
#ifdef CONFIG_ARM_CORTEX_A8
MRC(DBGDSCR_int, v);
#else
MRC(DBGDSCR_ext, v);
#endif
return v;
}

View file

@ -31,7 +31,8 @@ static void check_export_pmu(void)
#if defined CONFIG_EXPORT_PMU_USER || defined CONFIG_ENABLE_BENCHMARKS
/* Export performance counters */
uint32_t v;
v = PMUSERENR_ENABLE;
MRC(PMUSERENR, v);
v |= PMUSERENR_ENABLE;
MCR(PMUSERENR, v);
/* enable user-level pmu event counter if we're in secure mode */