1. 30 Jan, 2023 1 commit
    • Timothy E Baldwin's avatar
      Fix aborttrap for ARMv3 · 91415538
      Timothy E Baldwin authored
      Was trying to use SYS mode to access user registers, which was introduced
      in ARMv4. Fix by using STM and LDM instead.
      
      Also support reading and writing registers for 26-bit modes.
      
      Tested on RPCEmu.
      
      Version 6.63. Not tagged
      91415538
  2. 14 Jan, 2023 2 commits
  3. 07 Aug, 2021 1 commit
    • Jeffrey Lee's avatar
      Fix AbortTrap's handling of LDA instruction for emulated AP1 · 322fd3a6
      Jeffrey Lee authored
      When AP1 memory is being emulated (long descriptor page tables are in
      use), the AbortTrap machinery is used to emulate usermode read access.
      This provides coverage for all read instructions except those that
      AbortTrap handles via MemMap requests - LDREX, LDA, LDAEX, LDF & LFM.
      
      LDREX & LDAEX request both read & write access, so are fine (the MemMap
      request will get passed through to the registered AbortTrap handlers).
      
      LDF & LFM are irrelevant, since they only exist on ARM7500FE (on other
      machines FPEmulator will translate them to regular LDR/LDM, which are
      handled correctly)
      
      LDA however, will generate a plain "memmap with usermode read" request.
      When AbortTrap looks at the permissions of emulated AP1 it doesn't take
      into account the fact that the usermode read permission is being
      emulated, so it thinks that everything is fine and claims the memmap
      was successful, causing the abort handler to retry the instruction
      without making any changes, resulting in an infinite abort loop.
      
      Deal with this by detecting the above situation and also requesting
      usermode execute access. This will avoid the kernel (and hopefully the
      registered AbortTrap handlers) from thinking that the emulated AP1 is
      acceptable, without adversely affecting the behaviour of other
      instructions or access privileges. If no handler is present or the
      memmap request is denied, the abort will get passed on to the next stage
      of the abort handler (i.e. you'll get a standard data abort from trying
      to LDA from arbitrary emulated AP1 memory)
      
      The new test program (Dev/AbortTrap/attest_ap1) will check that this
      edge case is dealt with correctly.
      
      Tested on Pi 4, for both long & short page tables
      
      Version 6.59. Tagged as 'Kernel-6_59'
      322fd3a6
  4. 28 Jul, 2021 2 commits
    • Jeffrey Lee's avatar
      Use decgen cache files · 5b6c1710
      Jeffrey Lee authored
      Sadly we need one file per combination of action files, but by adding
      these pre-generated cache files to git we can speed up building the
      kernel from clean by a significant amount.
      5b6c1710
    • Jeffrey Lee's avatar
      Add OS_AbortTrap implementation · c199c178
      Jeffrey Lee authored
      This supports all the load/store instructions, including FPA & VFP/NEON.
      Most instructions are handled directly via the base version of the
      AbortTrap API that was first implemented in RISC OS Select. However, to
      properly cope with LDREX/STREX, and future support for prefetch aborts,
      the API has been extended to allow the kernel to request that a block of
      memory is mapped in with certain permissions. For LDREX/STREX the kernel
      will then rewind the PC so that the instruction can be retried directly.
      
      Test code in Dev/AbortTrap exists in order to allow checking of all
      major functionality, along with code for building the code in a
      softloadable module for easier/quicker testing.
      c199c178