1. 01 May, 2015 1 commit
  2. 29 Mar, 2015 1 commit
  3. 26 Mar, 2015 1 commit
    • ian's avatar
      New pmap code for armv6. Disabled by default, option ARM_NEW_PMAP enables it. · 6fb7bdd3
      ian authored
      This is pretty much a complete rewrite based on the existing i386 code.  The
      patches have been circulating for a couple years and have been looked at by
      plenty of people, but I'm not putting anybody on the hook as having reviewed
      this in any formal sense except myself.
      After this has gotten wider testing from the user community, ARM_NEW_PMAP
      will become the default and various dregs of the old pmap code will be
      Submitted by:	Svatopluk Kraus <onwahe@gmail.com>,
      	  	Michal Meloun <meloun@miracle.cz>
  4. 31 Jan, 2015 2 commits
    • dim's avatar
      Merge ^/head r277999 through r278002. · 129cf809
      dim authored
    • kib's avatar
      Do not qualify the mcontext_t *mcp argument for set_mcontext(9) as · 3bbc91d1
      kib authored
      const.  On x86, even after the machine context is supposedly read into
      the struct ucontext, lazy FPU state save code might only mark the FPU
      data as hardware-owned.  Later, set_fpcontext() needs to fetch the
      state from hardware, modifying the *mcp.
      The set_mcontext(9) is called from sigreturn(2) and setcontext(2)
      implementations and old create_thread(2) interface, which throw the
      *mcp out after the set_mcontext() call.
      Reported by:	dim
      Discussed with:	jhb
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
  5. 28 Dec, 2014 1 commit
    • ian's avatar
      Add new code to read and parse cpu identification data using the new CPUID · e78ae282
      ian authored
      mechanism defined for armv7 (and also present on some armv6 chips including
      the arm1176 used on rpi).  The information is parsed into a global cpuinfo
      structure, which will be used by (upcoming) new cache and tlb maintenance
      code to handle cpu-specific variations of the maintence sequences.
      Submitted by: Svatopluk Kraus <onwahe@gmail.com>,
                    Michal Meloun <meloun@miracle.cz
  6. 24 Dec, 2014 1 commit
    • ian's avatar
      Cleanup up ARM *frame structures... · bd1ca6b3
      ian authored
       - Eliminate unused irqframe
       - Eliminate unused saframe
       - Instead of splitting r4-sp storage between the stack and switchframe,
         just put all the registers in switchframe and eliminate the un_32 struct.
      Submitted by:	Svatopluk Kraus <onwahe@gmail.com>,
      		Michal Meloun <meloun@miracle.cz>
  7. 06 Nov, 2014 1 commit
  8. 31 Oct, 2014 1 commit
  9. 16 Oct, 2014 1 commit
  10. 09 Oct, 2014 1 commit
  11. 29 Sep, 2014 1 commit
  12. 25 Sep, 2014 1 commit
    • royger's avatar
      ddb: allow specifying the exact address of the symtab and strtab · 494dc32b
      royger authored
      When the FreeBSD kernel is loaded from Xen the symtab and strtab are
      not loaded the same way as the native boot loader. This patch adds
      three new global variables to ddb that can be used to specify the
      exact position and size of those tables, so they can be directly used
      as parameters to db_add_symbol_table. A new helper is introduced, so callers
      that used to set ksym_start and ksym_end can use this helper to set the new
      It also adds support for loading them from the Xen PVH port, that was
      previously missing those tables.
      Sponsored by: Citrix Systems R&D
      Reviewed by:	kib
       - Add three new global variables: ksymtab, kstrtab, ksymtab_size that
         can be used to specify the position and size of the symtab and
       - Use those new variables in db_init in order to call db_add_symbol_table.
       - Move the logic in db_init to db_fetch_symtab in order to set ksymtab,
         kstrtab, ksymtab_size from ksym_start and ksym_end.
       - Add prototype for db_fetch_ksymtab.
       - Declate the extern variables ksymtab, kstrtab and ksymtab_size.
       - Add support for finding the symtab and strtab when booted as a Xen
         PVH guest. Since Xen loads the symtab and strtab as NetBSD expects
         to find them we have to adapt and use the same method.
       - Use the newly introduced db_fetch_ksymtab in order to set ksymtab,
         kstrtab and ksymtab_size.
  13. 10 Sep, 2014 1 commit
  14. 06 Aug, 2014 1 commit
  15. 17 May, 2014 1 commit
  16. 12 May, 2014 2 commits
    • ian's avatar
      Cleanup some style nits. · e174978f
      ian authored
    • ian's avatar
      Interrupts need to be disabled on entry to cpu_sleep() for ARM. Given · 7c174746
      ian authored
      that and the need to be in a critical section when switching to idleclock
      mode for event timers, use spinlock_enter()/exit() to achieve both needs.
      The ARM WFI (wait for interrupt) instruction blocks until an interrupt is
      asserted, and it will unblock even if interrupts are masked, and it will
      unblock immediately if an interrupt is already pending.  It is necessary
      to execute it with interrupts disabled, otherwise the interrupt that
      should unblock it may occur and be serviced just prior to executing the
      instruction.  At that point the system is inappropriately asleep until
      the next timer tick or some other random interrupt happens.
      In general, interrupts need to be disabled continuously from the time the
      decision is made that there is no work to be done and sleeping is needed
      until actually going to sleep, to avoid a race where handling a new
      interrupt changes the basis for deciding there is no work to be done.
      Submitted by:	hps@ (in slightly different form)
  17. 29 Mar, 2014 1 commit
  18. 22 Mar, 2014 1 commit
    • bdrewery's avatar
      Rename global cnt to vm_cnt to avoid shadowing. · 6fcf6199
      bdrewery authored
      To reduce the diff struct pcu.cnt field was not renamed, so
      PCPU_OP(cnt.field) is still used. pc_cnt and pcpu are also used in
      kvm(3) and vmstat(8). The goal was to not affect externally used KPI.
      Bump __FreeBSD_version_ in case some out-of-tree module/code relies on the
      the global cnt variable.
      Exp-run revealed no ports using it directly.
      No objection from:	arch@
      Sponsored by:	EMC / Isilon Storage Division
  19. 09 Mar, 2014 3 commits
    • ian's avatar
      The arm exception entry points currently vector through a function pointer · 3b592f94
      ian authored
      to the actual handler routine.  All the pointers are static-intialized to
      the only handlers available, and yet various platform-specific inits still
      set those pointers (to the values they're already initialized to).  Begin
      to drain the swamp by removing all the redundant external declarations and
      runtime setting of the pointers that's scattered around various places.
    • ian's avatar
    • ian's avatar
      Remove all dregs of a per-thread undefined-exception-mode stack. This is · 4313fc83
      ian authored
      a leftover from the days when a low-level debugger had hooks in the
      undefined exception vector and needed stack space to function.  These days
      it effectively isn't used because we switch immediately to the svc32 mode
      stack on exception entry.  For that, the single undef mode stack per core
      that gets set up at init time works fine.
      The stack wasn't necessary but it was harmful, because the space for it
      was carved out of the normal per-thread svc32 stack, in effect cutting
      that 8K stack in half.  If svc32 mode used more than 4k of stack space it
      wandered down into the undef mode stack, and then an undef exception would
      overwrite a couple words on the stack while switching to svc32 mode,
      corrupting the scv32 stack.  Having another stack abut the bottom of the
      svc32 stack also effectively mooted the guard page below the stack.
      This work is based on analysis and patches submitted by Juergen Weiss.
  20. 07 Mar, 2014 1 commit
    • ian's avatar
      Fix the arm sys_sigreturn(): its argument is a struct ucontext, not a · 11fd7cf2
      ian authored
      struct sigframe containing the struct ucontext.
      The signal trampoline return code on the other hand DOES have just a
      struct sigframe on the stack to work with, so have it get a pointer to
      the ucontext out of there to pass along to sys_sigreturn.
      In other words, make everything work right whether sys_sigreturn is
      invoked from the trampoline or from userland code calling sigreturn(2).
      Submitted by:	Takashi Komatsu <komatsu.taka@jp.panasonic.com>
      Reviewed by:	cognet
  21. 26 Feb, 2014 1 commit
    • ian's avatar
      Replace many pasted identical definitions of cpu_initclocks() with a common · 6765240e
      ian authored
      implementation in arm/machdep.c.  Most arm platforms either don't need to
      do anything, or just need to call the standard eventtimer init routines.
      A generic implementation that does that is now provided via weak linkage.
      Any platform that needs to do something different can provide a its own
      implementation to override the generic one.
  22. 23 Feb, 2014 1 commit
    • ian's avatar
      If the L2 cache type is PIPT, pass a physical address for a flush. · d45f81d3
      ian authored
      While this is technically more correct, I don't think it much matters,
      because the only thing in the tree that calls cpu_flush_dcache() is md(4)
      and I'm > 99% sure it's bogus that it does so; md has no ability to do
      anything that can perturb data cache coherency.
  23. 21 Feb, 2014 2 commits
  24. 10 Jan, 2014 1 commit
  25. 27 Dec, 2013 1 commit
  26. 20 Nov, 2013 1 commit
    • ian's avatar
      Call cpu_setup() immediately after the page tables are installed. This · f0c93cb7
      ian authored
      enables data cache and other chip-specific features.  It was previously
      done via an early SYSINIT, but it was being done after pmap and vm setup,
      and those setups need to use mutexes.  On some modern ARM platforms,
      the ldrex/strex instructions that implement mutexes require the data cache
      to be enabled.
      A nice side effect of enabling caching earlier is that it eliminates the
      multi-second pause that used to happen early in boot while physical memory
      and pmap and vm were being set up.  On boards with 1 GB or more of ram
      this pause was very noticible, sometimes 5-6 seconds.
      PR:		arm/183740
  27. 05 Nov, 2013 1 commit
    • ian's avatar
      Call initarm_lastaddr() later in the init sequence, after establishing · b41cdbed
      ian authored
      static device mappings, rather than as the first of the initializations
      that a platform can hook into.  This allows a platform to allocate KVA
      from the top of the address space downwards for things like static device
      mapping, and return the final "last usable address" result after that and
      other early init work is done.
      Because some platforms were doing work in initarm_lastaddr() that needs to
      be done early, add a new initarm_early_init() routine and move the early
      init code to that routine on those platforms.
      Rename platform_devmap_init() to initarm_devmap_init() to match all the
      other init routines called from initarm() that are designed to be
      implemented by platform code.
      Add a comment block that explains when these routines are called and the
      type of work expected to be done in each of them.
  28. 04 Nov, 2013 2 commits
    • ian's avatar
      Move remaining code and data related to static device mapping into the · fefbe5ab
      ian authored
      new devmap.[ch] files.  Emphasize the MD nature of these things by using
      the prefix arm_devmap_ on the function and type names (already a few of
      these things found their way into MI code, hopefully it will be harder to
      do by accident in the future).
    • ian's avatar
      Begin reducing code duplication in arm pmap.c and pmap-v6.c by factoring · 64750d8e
      ian authored
      out common code related to mapping device memory into a new devmap.c file.
      Remove the growing duplication of code that used pmap_devmap_find_pa() and
      then did some math with the returned results to generate a virtual address,
      and likewise in reverse to get a physical address.  Now there are a pair
      of functions, arm_devmap_vtop() and arm_devmap_ptov(), to do that.  The
      bus_space_map() implementations are rewritten in terms of these.
  29. 27 Oct, 2013 2 commits
  30. 17 Oct, 2013 1 commit
  31. 31 Aug, 2013 1 commit
  32. 17 Aug, 2013 1 commit
  33. 05 Apr, 2013 1 commit