hw: fix panda instability on kernel exits

Invalidating all branch predictors before switching the PD
fixes instability problems on Panda and has not much effect
on the performance of other boards. However, we neither know why
this is a fix nor wether it fixes the real cause of the problem.

fix #1294
This commit is contained in:
Martin Stein 2014-11-18 13:25:00 +01:00 committed by Christian Helmuth
parent 0ffc89ee30
commit 635de1791f
1 changed files with 17 additions and 0 deletions

View File

@ -104,6 +104,14 @@
.endm
/*
* Invalidate all branch predictors
*/
.macro _bpiall
mcr p15, 0, r0, c7, c5, 6
.endm
/**
* Switch to a given protection domain
*
@ -112,6 +120,15 @@
* \param new_ttbr0 new TTBR0 value, read/write reg
*/
.macro _switch_protection_domain transit_ttbr0, new_cidr, new_ttbr0
/*
* FIXME: Fixes instability problems that were observed on the
* PandaBoard only. We neither know why invalidating predictions
* at PD switches is a fix nor wether not doing so is the real
* cause of this instability.
*/
_bpiall
_write_ttbr0 \transit_ttbr0
isb
_write_cidr \new_cidr