1. 04 9月, 2013 5 次提交
    • C
      tile PCI RC: add comment about "PCI hole" problem · 5e7705df
      Chris Metcalf 提交于
      Explain the rationale of not overlapping the 64-bit DMA window
      with the PA range.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      5e7705df
    • C
      tile: add virt_to_kpte() API and clean up and document behavior · 640710a3
      Chris Metcalf 提交于
      We use virt_to_pte(NULL, va) a lot, which isn't very obvious.
      I added virt_to_kpte(va) as a more obvious wrapper function,
      that also validates the va as being a kernel adddress.
      
      And, I fixed the semantics of virt_to_pte() so that we handle
      the pud and pmd the same way, and we now document the fact that
      we handle the final pte level differently.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      640710a3
    • C
      tilegx: support KGDB · 8157107b
      Chris Metcalf 提交于
      Enter kernel debugger at boot with:
        --hvd UART_1=1 --hvx kgdbwait --hvx kgdboc=ttyS1,115200
      or at runtime with:
        echo ttyS1,115200 > /sys/module/kgdboc/parameters/kgdboc
        echo g > /proc/sysrq-trigger
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      8157107b
    • 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
    • C
      tile: don't assume user privilege is zero · 051168df
      Chris Metcalf 提交于
      Technically, user privilege is anything less than kernel
      privilege.  We modify the existing user_mode() macro to have
      this semantic (and use it in a couple of places it wasn't being
      used before), and add an IS_KERNEL_EX1() macro to the assembly
      code as well.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      051168df
  2. 30 8月, 2013 8 次提交
  3. 14 8月, 2013 5 次提交
    • C
      tile: implement gettimeofday() via vDSO · 4a556f4f
      Chris Metcalf 提交于
      This change creates the framework for vDSO calls, makes the existing
      rt_sigreturn() mechanism use it, and adds a fast gettimeofday().
      Now that we need to expose the vDSO address to userspace, we add
      AT_SYSINFO_EHDR to the set of aux entries provided to userspace.
      (You can disable any extra vDSO support by booting with vdso=0,
      but the rt_sigreturn vDSO page will still be provided.)
      
      Note that glibc has supported the tile vDSO since release 2.17.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      4a556f4f
    • C
      tile: improve big-endian support · ba02f0eb
      Chris Metcalf 提交于
      First, fix a bug in asm/unaligned.h; we need to just use the asm-generic
      unaligned.h so we properly choose endian-correct flavors.
      
      Second, keep the hv/hypervisor.h ABI fully "native" in the sense that
      we don't have __BIG_ENDIAN__ ifdefs there.  Instead, we use macros in
      the head_NN.S assembly code to properly extract two 32-bit structure
      members from a 64-bit register holding the structure.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      ba02f0eb
    • C
      tile: support CONFIG_PREEMPT · bc1a298f
      Chris Metcalf 提交于
      This change adds support for CONFIG_PREEMPT (full kernel preemption).
      In addition to the core support, this change includes a number
      of places where we fix up uses of smp_processor_id() and per-cpu
      variables.  I also eliminate the PAGE_HOME_HERE and PAGE_HOME_UNKNOWN
      values for page homing, as it turns out they weren't being used.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      bc1a298f
    • C
      tile: avoid recursive backtrace faults · 3ef23111
      Chris Metcalf 提交于
      This change adds support for avoiding recursive backtracer crashes;
      we haven't seen this in practice other than when things are seriously
      corrupt, but it may help avoid losing the root cause of a crash.
      
      Also, don't abort kernel backtracers for invalid userspace PC's.
      If we do, we lose the ability to backtrace through a userspace
      call to a bad address above PAGE_OFFSET, even though that it can
      be perfectly reasonable to continue the backtrace in such a case.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      3ef23111
    • C
      tile: fast-path unaligned memory access for tilegx · 2f9ac29e
      Chris Metcalf 提交于
      This change enables unaligned userspace memory access via a kernel
      fast path on tilegx.  The kernel tracks user PC/instruction pairs
      per-thread using a direct-mapped cache in userspace.  The cache
      maps those PC/instruction pairs to JIT'ed instruction sequences that
      load or store using byte-wide load store intructions and then
      synthesize 2-, 4- or 8-byte load or store results.  Once an
      instruction has been seen to generate an unaligned access once,
      subsequent hits on that instruction typically require overhead
      of only around 50 cycles if cache and TLB is hot.
      
      We support the prctl() PR_GET_UNALIGN / PR_SET_UNALIGN sys call to
      enable or disable unaligned fixups on a per-process basis.
      
      To do this we pull some of the tilepro unaligned support out of the
      single_step.c file; tilepro uses instruction disassembly for both
      single-step and unaligned access support.  Since tilegx actually has
      hardware singlestep support, though, it's cleaner to keep the tilegx
      unaligned access code in a separate file.  While we're at it,
      properly rename the tilepro-specific types, etc., to have tilepro
      suffixes instead of generic tile suffixes.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      2f9ac29e
  4. 13 8月, 2013 1 次提交
    • C
      tile: various console improvements · bda0f5ba
      Chris Metcalf 提交于
      This change improves and cleans up the tile console.
      
      - We enable HVC_IRQ support on tilegx, with the addition of a new
        Tilera hypervisor API for tilegx to allow a console IPI.  If IPI
        support is not available we fall back to the previous polling mode.
      
      - We simplify the earlyprintk code to use CON_BOOT and eliminate some
        of the other supporting earlyprintk code.
      
      - A new tile_console_write() primitive is used to send output to
        the console and is factored out of the hvc_tile driver.
        This lets us support a "sim_console" boot argument to allow using
        simulator hooks to send output to the "console" as a slightly
        faster alternative to emulating the hardware more directly.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bda0f5ba
  5. 07 8月, 2013 6 次提交
    • C
      7c29b78a
    • C
      tile PCI RC: add dma_get_required_mask() · dc7d5cf2
      Chris Metcalf 提交于
      The standard kernel function dma_get_required_mask() uses the
      highest DRAM address to determine if 32-bit or 64-bit DMA addressing
      is needed.  This only works on architectures that have direct mapping
      between the PA and the PCI address space, i.e. those that don't have
      I/O TLBs or have I/O TLB but choose to use direct mapping.  Neither
      of these are true for tilegx.  Whether to use 64-bit DMA should depend
      on the PCI device's capability only, not on the amount of DRAM
      installeds, so we now advertise a 64-bit DMA mask unconditionally.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      dc7d5cf2
    • C
      tile PCI RC: eliminate pci_controller.mem_resources field · 11981687
      Chris Metcalf 提交于
      The .mem_resources[] field in the pci_controller struct
      is now obsoleted by the .mem_space and .io_space fields.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      11981687
    • C
      tile PCI RC: restructure TRIO initialization · 1c43649a
      Chris Metcalf 提交于
      The TRIO shim initialization is shared with other kernel drivers
      such as the endpoint and StreamIO drivers, so reorganize the
      initialization flow to ensure that the root complex driver properly
      initializes TRIO state regardless of what kind of TRIO driver will
      end up using the shim.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      1c43649a
    • C
      tile PCI RC: support I/O space access · cf89c426
      Chris Metcalf 提交于
      To enable this functionality, configure CONFIG_TILE_PCI_IO.  Without
      this flag, the kernel still assigns I/O address ranges to the
      devices, but no TRIO resource and mapping support is provided.
      
      We assign disjoint I/O address ranges to separate PCIe domains.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      cf89c426
    • C
      tile: support LSI MEGARAID SAS HBA hybrid dma_ops · 803c874a
      Chris Metcalf 提交于
      The LSI MEGARAID SAS HBA suffers from the problem where it can do
      64-bit DMA to streaming buffers but not to consistent buffers.
      In other words, 64-bit DMA is used for disk data transfers and 32-bit
      DMA must be used for control message transfers. According to LSI,
      the firmware is not fully functional yet. This change implements a
      kind of hybrid dma_ops to support this.
      
      Note that on most other platforms, the 64-bit DMA addressing space is the
      same as the 32-bit DMA space and they overlap the physical memory space.
      No special arrangement is needed to support this kind of mixed DMA
      capability.  On TILE-Gx, the 64-bit DMA space is completely separate
      from the 32-bit DMA space.  Due to the use of the IOMMU, the 64-bit DMA
      space doesn't overlap the physical memory space.  On the other hand,
      the 32-bit DMA space overlaps the physical memory space under 4GB.
      The separate address spaces make it necessary to have separate dma_ops.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      803c874a
  6. 06 8月, 2013 1 次提交
  7. 02 8月, 2013 1 次提交
  8. 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
  9. 18 7月, 2013 1 次提交
  10. 04 7月, 2013 1 次提交
  11. 29 6月, 2013 1 次提交
  12. 19 6月, 2013 1 次提交
  13. 28 5月, 2013 1 次提交
  14. 01 5月, 2013 1 次提交
    • S
      Kconfig: consolidate CONFIG_DEBUG_STRICT_USER_COPY_CHECKS · 446f24d1
      Stephen Boyd 提交于
      The help text for this config is duplicated across the x86, parisc, and
      s390 Kconfig.debug files.  Arnd Bergman noted that the help text was
      slightly misleading and should be fixed to state that enabling this
      option isn't a problem when using pre 4.4 gcc.
      
      To simplify the rewording, consolidate the text into lib/Kconfig.debug
      and modify it there to be more explicit about when you should say N to
      this config.
      
      Also, make the text a bit more generic by stating that this option
      enables compile time checks so we can cover architectures which emit
      warnings vs.  ones which emit errors.  The details of how an
      architecture decided to implement the checks isn't as important as the
      concept of compile time checking of copy_from_user() calls.
      
      While we're doing this, remove all the copy_from_user_overflow() code
      that's duplicated many times and place it into lib/ so that any
      architecture supporting this option can get the function for free.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Acked-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Acked-by: NHelge Deller <deller@gmx.de>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      446f24d1
  15. 30 4月, 2013 1 次提交
    • G
      mm/hugetlb: add more arch-defined huge_pte functions · 106c992a
      Gerald Schaefer 提交于
      Commit abf09bed ("s390/mm: implement software dirty bits")
      introduced another difference in the pte layout vs.  the pmd layout on
      s390, thoroughly breaking the s390 support for hugetlbfs.  This requires
      replacing some more pte_xxx functions in mm/hugetlbfs.c with a
      huge_pte_xxx version.
      
      This patch introduces those huge_pte_xxx functions and their generic
      implementation in asm-generic/hugetlb.h, which will now be included on
      all architectures supporting hugetlbfs apart from s390.  This change
      will be a no-op for those architectures.
      
      [akpm@linux-foundation.org: fix warning]
      Signed-off-by: NGerald Schaefer <gerald.schaefer@de.ibm.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Hillf Danton <dhillf@gmail.com>
      Acked-by: Michal Hocko <mhocko@suse.cz>	[for !s390 parts]
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      106c992a
  16. 10 4月, 2013 2 次提交
  17. 08 4月, 2013 1 次提交
  18. 23 3月, 2013 2 次提交