Commit b3c64d93 authored by Jeffrey Lee's avatar Jeffrey Lee

Fix dodgy ranged ICache cleans when using ARMv7MP ARMops

Detail:
  s/ARMops - If the ICacheInvalidate macro was told to pull a2, it would pull it before invoking ICache_InvalidateRange, causing the end address of the range to be lost. Avoid this by only pulling the registers after the ranged call.
  Also optimise MMU_ChangingEntry to go straight to ICache_InvalidateRange instead of doing a redundant range size check.
Admin:
  Tested on OMAP5
  Potentially fixes lockup/long stall seen when using PhotoDesk, reported by Willi Theiss


Version 6.15. Tagged as 'Kernel-6_15'
parent d87c22a4
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "6.14"
Module_Version SETA 614
Module_MajorVersion SETS "6.15"
Module_Version SETA 615
Module_MinorVersion SETS ""
Module_Date SETS "07 Nov 2018"
Module_ApplicationDate SETS "07-Nov-18"
Module_Date SETS "14 Nov 2018"
Module_ApplicationDate SETS "14-Nov-18"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "apache/RiscOS/Sources/Kernel"
Module_FullVersion SETS "6.14"
Module_HelpVersion SETS "6.14 (07 Nov 2018)"
Module_FullVersion SETS "6.15"
Module_HelpVersion SETS "6.15 (14 Nov 2018)"
END
/* (6.14)
/* (6.15)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 6.14
#define Module_MajorVersion_CMHG 6.15
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Nov 2018
#define Module_Date_CMHG 14 Nov 2018
#define Module_MajorVersion "6.14"
#define Module_Version 614
#define Module_MajorVersion "6.15"
#define Module_Version 615
#define Module_MinorVersion ""
#define Module_Date "07 Nov 2018"
#define Module_Date "14 Nov 2018"
#define Module_ApplicationDate "07-Nov-18"
#define Module_ApplicationDate "14-Nov-18"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "apache/RiscOS/Sources/Kernel"
#define Module_FullVersion "6.14"
#define Module_HelpVersion "6.14 (07 Nov 2018)"
#define Module_LibraryVersionInfo "6:14"
#define Module_FullVersion "6.15"
#define Module_HelpVersion "6.15 (14 Nov 2018)"
#define Module_LibraryVersionInfo "6:15"
......@@ -3352,6 +3352,7 @@ Cache_Examine_ARMv7MP * Cache_Examine_WB_CR7_Lx
; Call appropriate ranged/full ICache invalidate code
; $type = ARMop type suffix
; $start = reg containing start addr
; a2 = end addr
; $pull = stacked registers (except lr, which must be stacked)
MACRO
ICacheInvalidate $type, $start, $pull
......@@ -3364,12 +3365,18 @@ Cache_Examine_ARMv7MP * Cache_Examine_WB_CR7_Lx
[ "$start" <> "lr" :LAND: "$start" <> "a1"
MOVLO a1, $start
]
[ "$pull" <> ""
Pull "$pull"
]
[ "$pull" <> ""
; If $pull contains a1 or a2 then we'll have to postpone pulling them until after the ranged call. But there's no straightforward way of checking for that, so we'll take the easy way out and always postpone pulling for ranged calls.
Pull "$pull,lr",HS
BHS ICache_InvalidateAll_$type
Push "pc"
B ICache_InvalidateRange_$type._alt
Pull "$pull,pc"
|
BLO ICache_InvalidateRange_$type._alt
Pull "lr"
B ICache_InvalidateAll_$type
]
MEND
Cache_RangeThreshold_ARMv7MP ROUT
......@@ -3492,7 +3499,9 @@ MMU_ChangingEntry_ARMv7MP ROUT
BNE %BT10
DSB ; Wait for clean to complete
SUB a1, a2, #PageSize ; Get start address back
ICacheInvalidate ARMv7MP, a1, a2
Push "pc"
B ICache_InvalidateRange_ARMv7MP_alt ; Skip the range check, we know 4K is small enough to want a ranged clean
Pull "a2, pc"
; a1 = first page affected (page aligned address)
; a2 = number of pages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment