1. 04 9月, 2013 1 次提交
    • C
      tile: parameterize VA and PA space more cleanly · acbde1db
      Chris Metcalf 提交于
      The existing code relied on the hardware definition (<arch/chip.h>)
      to specify how much VA and PA space was available.  It's convenient
      to allow customizing this for some configurations, so provide symbols
      MAX_PA_WIDTH and MAX_VA_WIDTH in <asm/page.h> that can be modified
      if desired.
      
      Additionally, move away from the MEM_XX_INTRPT nomenclature to
      define the start of various regions within the VA space.  In fact
      the cleaner symbol is, for example, MEM_SV_START, to indicate the
      start of the area used for supervisor code; the actual address of the
      interrupt vectors is not as important, and can be changed if desired.
      As part of this change, convert from "intrpt1" nomenclature (which
      built in the old privilege-level 1 model) to a simple "intrpt".
      
      Also strip out some tilepro-specific code supporting modifying the
      PL the kernel could run at, since we don't actually support using
      different PLs in tilepro, only tilegx.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      acbde1db
  2. 30 8月, 2013 1 次提交
    • C
      tilegx: change how we find the kernel stack · 35f05976
      Chris Metcalf 提交于
      Previously, we used a special-purpose register (SPR_SYSTEM_SAVE_K_0)
      to hold the CPU number and the top of the current kernel stack
      by using the low bits to hold the CPU number, and using the high
      bits to hold the address of the page just above where we'd want
      the kernel stack to be.  That way we could initialize a new SP
      when first entering the kernel by just masking the SPR value and
      subtracting a couple of words.
      
      However, it's actually more useful to be able to place an arbitrary
      kernel-top value in the SPR.  This allows us to create a new stack
      context (e.g. for virtualization) with an arbitrary top-of-stack VA.
      To make this work, we now store the CPU number in the high bits,
      above the highest legal VA bit (42 bits in the current tilegx
      microarchitecture).  The full 42 bits are thus available to store the
      top of stack value.  Getting the current cpu (a relatively common
      operation) is still fast; it's now a shift rather than a mask.
      
      We make this change only for tilegx, since tilepro has too few SPR
      bits to do this, and we don't need this support on tilepro anyway.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      35f05976
  3. 14 8月, 2013 1 次提交
    • C
      tile: provide traceability for hypervisor calls · 9ae09838
      Chris Metcalf 提交于
      This change adds infrastructure (CONFIG_TILE_HVGLUE_TRACE) that
      provides C code wrappers for the calls the kernel makes to the Tilera
      hypervisor.  This allows standard kernel infrastructure like FTRACE to
      be able to instrument hypervisor calls.
      
      To allow direct calls to the true API, we export their names with a
      leading underscore as well.  This is important for the few contexts
      where we need to make hypervisor calls without touching the stack.
      
      As part of this change, we also switch from creating the symbols
      with linker magic to creating them with assembler magic.  This lets
      us provide a symbol type and generally make them appear more as symbols
      and less as just random values in the Elf namespace.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      9ae09838
  4. 31 7月, 2013 1 次提交
    • C
      tile: convert uses of "inv" to "finv" · dd78bc11
      Chris Metcalf 提交于
      The "inv" (invalidate) instruction is generally less safe than "finv"
      (flush and invalidate), as it will drop dirty data from the cache.
      It turns out we have almost no need for "inv" (other than for the
      older 32-bit architecture in some limited cases), so convert to
      "finv" where possible and delete the extra "inv" infrastructure.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      dd78bc11
  5. 03 5月, 2013 1 次提交
    • C
      tile: support new Tilera hypervisor · c539914d
      Chris Metcalf 提交于
      The Tilera hypervisor shipped in releases up through MDE 4.1 launches
      the client operating system (i.e. Linux) at privilege level 1 (PL1).
      Starting with MDE 4.2, as part of the work to enable KVM, the
      Tilera hypervisor launches Linux at PL2 instead.
      
      This commit makes the KERNEL_PL option default to 2 for tilegx, while
      still saying at 1 for tilepro, which doesn't have an updated hypervisor.
      It also explains how and when you might want to choose another value.
      In addition, we change a small buglet in the on-chip Ethernet driver,
      where we were failing to use the KERNEL_PL constant in an API call.
      
      To make the transition cleaner, this change also provides the updated
      hv_init() API for the new hypervisor that supports announcing Linux's
      compiled-in PL, so the hypervisor can generate a suitable error in the
      case of a mismatched hypervisor and Linux binary.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      Cc: stable@vger.linux.org
      c539914d
  6. 26 5月, 2012 1 次提交
    • C
      arch/tile: Allow tilegx to build with either 16K or 64K page size · d5d14ed6
      Chris Metcalf 提交于
      This change introduces new flags for the hv_install_context()
      API that passes a page table pointer to the hypervisor.  Clients
      can explicitly request 4K, 16K, or 64K small pages when they
      install a new context.  In practice, the page size is fixed at
      kernel compile time and the same size is always requested every
      time a new page table is installed.
      
      The <hv/hypervisor.h> header changes so that it provides more abstract
      macros for managing "page" things like PFNs and page tables.  For
      example there is now a HV_DEFAULT_PAGE_SIZE_SMALL instead of the old
      HV_PAGE_SIZE_SMALL.  The various PFN routines have been eliminated and
      only PA- or PTFN-based ones remain (since PTFNs are always expressed
      in fixed 2KB "page" size).  The page-table management macros are
      renamed with a leading underscore and take page-size arguments with
      the presumption that clients will use those macros in some single
      place to provide the "real" macros they will use themselves.
      
      I happened to notice the old hv_set_caching() API was totally broken
      (it assumed 4KB pages) so I changed it so it would nominally work
      correctly with other page sizes.
      
      Tag modules with the page size so you can't load a module built with
      a conflicting page size.  (And add a test for SMP while we're at it.)
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      d5d14ed6
  7. 18 3月, 2011 1 次提交
  8. 02 3月, 2011 1 次提交
  9. 16 10月, 2010 1 次提交
  10. 05 6月, 2010 1 次提交