LF-3161-1 arm: imx: Fix speculative instruction prefetch issue
authorYe Li <ye.li@nxp.com>
Wed, 13 Jan 2021 08:03:50 +0000 (00:03 -0800)
committerYe Li <ye.li@nxp.com>
Thu, 29 Apr 2021 10:26:23 +0000 (03:26 -0700)
commit6beb2dff7f5c895ea4f9f64c3f70e65aa61a2b5f
tree38c93e6de8185027144c7ea6253c3a0b3362fe63
parent29e4648220fd59b7ae495a126f53685f78459696
LF-3161-1 arm: imx: Fix speculative instruction prefetch issue

Default ARM32 MMU setting in u-boot sets XN bit to entire 4GB space no
matter which DCACHE option is used, and set domain permission to manager.
This causes MMU ignores the access check and XN bit, so speculative
instruction can fetch from entire space.

This patch sets the DDR, ROM, OCRAM without XN bit, and set domain to client
to enable the XN and access check. So speculative instruction fetch can only
happens on these 3 regions to avoid prefetch from peripherals and invalid
regions.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 25d70768c460bad91aa65f367203af41122399cd)
(cherry picked from commit 647edf3ae8bb7d48d20155e73a65522ae9e3ad36)
arch/arm/mach-imx/cache.c