Commit e5bd59a6 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Ensure IO memory is marked as non-executable

Detail:
  s/HAL - The VMSAv6/v7 memory model allows speculative instruction fetches from any memory (including device/strongly-ordered), unless the memory is marked as non-executable. So to prevent interference with read-sensitive devices we must make sure all appropriate IO memory is marked as non-executable.
Admin:
  Tested on IGEPv5
  Fixes data corruption seen when reading from SD card


Version 5.35, 4.79.2.265. Tagged as 'Kernel-5_35-4_79_2_265'
parent 9febf171
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.264"
Module_Date SETS "19 Apr 2015"
Module_ApplicationDate SETS "19-Apr-15"
Module_MinorVersion SETS "4.79.2.265"
Module_Date SETS "14 Jun 2015"
Module_ApplicationDate SETS "14-Jun-15"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.264)"
Module_HelpVersion SETS "5.35 (19 Apr 2015) 4.79.2.264"
Module_FullVersion SETS "5.35 (4.79.2.265)"
Module_HelpVersion SETS "5.35 (14 Jun 2015) 4.79.2.265"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.264
#define Module_Date_CMHG 19 Apr 2015
#define Module_MinorVersion_CMHG 4.79.2.265
#define Module_Date_CMHG 14 Jun 2015
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.264"
#define Module_Date "19 Apr 2015"
#define Module_MinorVersion "4.79.2.265"
#define Module_Date "14 Jun 2015"
#define Module_ApplicationDate "19-Apr-15"
#define Module_ApplicationDate "14-Jun-15"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.264)"
#define Module_HelpVersion "5.35 (19 Apr 2015) 4.79.2.264"
#define Module_FullVersion "5.35 (4.79.2.265)"
#define Module_HelpVersion "5.35 (14 Jun 2015) 4.79.2.265"
#define Module_LibraryVersionInfo "5:35"
......@@ -2058,11 +2058,11 @@ RISCOS_AccessPhysicalAddressUnchecked ; well OK then, I trust
]
LDR ip, =L1PT + (PhysicalAccess:SHR:18) ; ip -> L1PT entry
[ MEMM_Type = "VMSAv6"
LDR a4, =(AP_None * L1_APMult) + L1_Section
LDR a4, =(AP_None * L1_APMult) + L1_Section + L1_XN
|
LDR a4, =(AP_None * L1_APMult) + L1_U + L1_Section
]
ORR a1, a4, a1 ; a1 = flags for 2nd level descriptor
ORR a1, a4, a1 ; a1 = flags for 1st level descriptor
MOV a4, a2, LSR #20 ; rounded to section
ORR a1, a1, a4, LSL #20 ; a1 = complete descriptor
TEQ a3, #0
......@@ -2371,6 +2371,9 @@ RISCOS_MapInIO ROUT
LDR ip, =ZeroPage
LDR a4, =L1PT
AND a1, a1, v7 ; only allow bufferable as flags option
[ MEMM_Type = "VMSAv6"
ORR a1, a1, #L1_XN ; force non-executable to prevent speculative instruction fetches
]
LDR v2, =IO ; logical end (exclusive) of currently mapped IO
LDR v1, [ip, #IOAllocPtr] ; logical start (inclusive)
......
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