1. 16 9月, 2012 4 次提交
    • D
      ARM: 7511/1: opcodes: Opcode definitions for the Virtualization Extensions · 508514ed
      Dave Martin 提交于
      For now, this patch just adds a definition for the HVC instruction.
      More can be added here later, as needed.
      
      Now that we have a real example of how to use the opcode injection
      macros properly, this patch also adds a cross-reference from the
      explanation in opcodes.h (since without an example, figuring out
      how to use the macros is not that easy).
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      508514ed
    • D
      ARM: 7510/1: opcodes: Add helpers for emitting custom opcodes · a61a41a0
      Dave Martin 提交于
      This patch adds some __inst_() macros for injecting custom opcodes
      in assembler (both inline and in .S files).  They should make it
      easier and cleaner to get things right in little-/big-
      endian/ARM/Thumb-2 kernels without a lot of #ifdefs.
      
      This pure-preprocessor approach is preferred over the alternative
      method of wedging extra assembler directives into the assembler
      input using top-level asm() blocks, since there is no way to
      guarantee that the compiler won't reorder those with respect to
      each other or with respect to non-toplevel asm() blocks, unless
      -fno-toplevel-reorder is passed (which is in itself somewhat
      undesirable because it defeats some potential optimisations).
      
      Currently <asm/unified.h> _does_ silently rely on the compiler not
      reordering at the top level, but it seems better to avoid adding
      extra code which depends on this if the same result can be achieved
      in another way.
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      a61a41a0
    • D
      ARM: 7509/1: opcodes: Make opcode byteswapping macros assembly-compatible · 0ce3de23
      Dave Martin 提交于
      Most of the existing macros don't work with assembler, due to the
      use of type casts and C functions from <linux/swab.h>.
      
      This patch abstracts out those operations and provides simple
      explicit versions for use in assembly code.
      
      __opcode_is_thumb32() and __opcode_is_thumb16() are also converted
      to do bitmask-based testing to avoid confusion if these are used in
      assembly code (the assembler typically treats all arithmetic values
      as signed).
      
      These changes avoid the need for the compiler to pre-evaluate
      constant expressions used to generate opcodes.  By ensuring that
      the forms of these expressions can be evaluated directly by the
      assembler, we can just stringify the expressions directly into the
      asm during the preprocessing pass.  The alternative approach
      (passing the evaluated expression via an inline asm "i" constraint)
      gets painful because the contents of the asm and the constraints
      must be kept in sync.  This makes the resulting macros awkward to
      use.
      
      Retaining the C forms of the macros allows more efficient code to
      be generated when opcodes are generated programmatically at run-
      time, but there is no way to embed run-time-generated opcodes in
      asm() blocks.
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      0ce3de23
    • D
      ARM: 7508/1: opcodes: Don't define the thumb32 byteswapping macros for BE32 · 57b9da32
      Dave Martin 提交于
      The existing __mem_to_opcode_thumb32() is incorrect for BE32
      platforms.  However, these don't support Thumb-2 kernels, so this
      option is not so relevant for those platforms anyway.
      
      This operation is complicated by the lack of unaligned memory
      access support prior to ARMv6.
      
      Rather than provide a "working" macro which will probably won't get
      used (or worse, will get misused), this patch removes the macro for
      BE32 kernels.  People manipulating Thumb opcodes prior to ARMv6
      should almost certainly be splitting these operations into
      halfwords anyway, using __opcode_thumb32_{first,second,compose}()
      and the 16-bit opcode transformations.
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      57b9da32
  2. 29 8月, 2012 1 次提交
  3. 11 8月, 2012 3 次提交
    • W
      ARM: 7488/1: mm: use 5 bits for swapfile type encoding · f5f2025e
      Will Deacon 提交于
      Page migration encodes the pfn in the offset field of a swp_entry_t.
      For LPAE, we support physical addresses of up to 36 bits (due to
      sparsemem limitations with the size of page flags), requiring 24 bits
      to represent a pfn. A further 3 bits are used to encode a swp_entry into
      a pte, leaving 5 bits for the type field. Furthermore, the core code
      defines MAX_SWAPFILES_SHIFT as 5, so the additional type bit does not
      get used.
      
      This patch reduces the width of the type field to 5 bits, allowing us
      to create up to 31 swapfiles of 64GB each.
      
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      f5f2025e
    • W
      ARM: 7487/1: mm: avoid setting nG bit for user mappings that aren't present · 47f12043
      Will Deacon 提交于
      Swap entries are encoding in ptes such that !pte_present(pte) and
      pte_file(pte). The remaining bits of the descriptor are used to identify
      the swapfile and offset within it to the swap entry.
      
      When writing such a pte for a user virtual address, set_pte_at
      unconditionally sets the nG bit, which (in the case of LPAE) will
      corrupt the swapfile offset and lead to a BUG:
      
      [  140.494067] swap_free: Unused swap offset entry 000763b4
      [  140.509989] BUG: Bad page map in process rs:main Q:Reg  pte:0ec76800 pmd:8f92e003
      
      This patch fixes the problem by only setting the nG bit for user
      mappings that are actually present.
      
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      47f12043
    • C
      ARM: 7486/1: sched_clock: update epoch_cyc on resume · 237ec6f2
      Colin Cross 提交于
      Many clocks that are used to provide sched_clock will reset during
      suspend.  If read_sched_clock returns 0 after suspend, sched_clock will
      appear to jump forward.  This patch resets cd.epoch_cyc to the current
      value of read_sched_clock during resume, which causes sched_clock() just
      after suspend to return the same value as sched_clock() just before
      suspend.
      
      In addition, during the window where epoch_ns has been updated before
      suspend, but epoch_cyc has not been updated after suspend, it is unknown
      whether the clock has reset or not, and sched_clock() could return a
      bogus value.  Add a suspended flag, and return the pre-suspend epoch_ns
      value during this period.
      
      The new behavior is triggered by calling setup_sched_clock_needs_suspend
      instead of setup_sched_clock.
      Signed-off-by: NColin Cross <ccross@android.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      237ec6f2
  4. 31 7月, 2012 3 次提交
  5. 30 7月, 2012 4 次提交
  6. 28 7月, 2012 2 次提交
  7. 24 7月, 2012 1 次提交
  8. 10 7月, 2012 8 次提交
  9. 05 7月, 2012 3 次提交
    • R
      ARM: fix warnings about atomic64_read · b89d607b
      Russell King 提交于
      Fix:
      net/netfilter/xt_connbytes.c: In function 'connbytes_mt':
      net/netfilter/xt_connbytes.c:43: warning: passing argument 1 of 'atomic64_read' discards qualifiers from pointer target type
      ...
      
      by adding the missing const.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      b89d607b
    • W
      ARM: 7443/1: Revert "new way of handling ERESTART_RESTARTBLOCK" · 433e2f30
      Will Deacon 提交于
      This reverts commit 6b5c8045.
      
      Conflicts:
      
      	arch/arm/kernel/ptrace.c
      
      The new syscall restarting code can lead to problems if we take an
      interrupt in userspace just before restarting the svc instruction. If
      a signal is delivered when returning from the interrupt, the
      TIF_SYSCALL_RESTARTSYS will remain set and cause any syscalls executed
      from the signal handler to be treated as a restart of the previously
      interrupted system call. This includes the final sigreturn call, meaning
      that we may fail to exit from the signal context. Furthermore, if a
      system call made from the signal handler requires a restart via the
      restart_block, it is possible to clear the thread flag and fail to
      restart the originally interrupted system call.
      
      The right solution to this problem is to perform the restarting in the
      kernel, avoiding the possibility of handling a further signal before the
      restart is complete. Since we're almost at -rc6, let's revert the new
      method for now and aim for in-kernel restarting at a later date.
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      433e2f30
    • R
      ARM: fix set_domain() macro · 82401bf1
      Russell King 提交于
      Avoid polluting drivers with a set_domain() macro, which interferes with
      structure member names:
      
      drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c:294:33: error: macro "set_domain" passed 2 arguments, but takes just 1
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      82401bf1
  10. 01 7月, 2012 1 次提交
    • S
      ARM: fiq: change FIQ_START to a variable · bc89663a
      Shawn Guo 提交于
      The commit a2be01b1 (ARM: only include mach/irqs.h for !SPARSE_IRQ)
      makes mach/irqs.h only be included for !SPARSE_IRQ build.  There are
      a nubmer of platforms have FIQ_START defined in mach/irqs.h for FIQ
      support.
      
        arch/arm/mach-rpc/include/mach/irqs.h:#define FIQ_START         64
        arch/arm/mach-s3c24xx/include/mach/irqs.h:#define FIQ_START             IRQ_EINT0
        arch/arm/plat-mxc/include/mach/irqs.h:#define FIQ_START 0
      
      If SPARSE_IRQ is enabled for any of these platforms, the following
      compile error will be seen.
      
        arch/arm/kernel/fiq.c: In function ‘enable_fiq’:
        arch/arm/kernel/fiq.c:127:19: error: ‘FIQ_START’ undeclared (first use in this function)
        arch/arm/kernel/fiq.c:127:19: note: each undeclared identifier is reported only once for each function it appears in
        arch/arm/kernel/fiq.c: In function ‘disable_fiq’:
        arch/arm/kernel/fiq.c:132:20: error: ‘FIQ_START’ undeclared (first use in this function)
      
      The patch changes fiq code to have init_FIQ take FIQ_START from
      platforms as a parameter and assign it to variable fiq_start which
      is to replace FIQ_START uses in enable_fiq/disable_fiq.
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      bc89663a
  11. 29 6月, 2012 1 次提交
  12. 21 6月, 2012 1 次提交
  13. 16 6月, 2012 1 次提交
  14. 31 5月, 2012 1 次提交
  15. 25 5月, 2012 1 次提交
  16. 22 5月, 2012 3 次提交
  17. 21 5月, 2012 2 次提交
    • M
      ARM: integrate CMA with DMA-mapping subsystem · c7909509
      Marek Szyprowski 提交于
      This patch adds support for CMA to dma-mapping subsystem for ARM
      architecture. By default a global CMA area is used, but specific devices
      are allowed to have their private memory areas if required (they can be
      created with dma_declare_contiguous() function during board
      initialisation).
      
      Contiguous memory areas reserved for DMA are remapped with 2-level page
      tables on boot. Once a buffer is requested, a low memory kernel mapping
      is updated to to match requested memory access type.
      
      GFP_ATOMIC allocations are performed from special pool which is created
      early during boot. This way remapping page attributes is not needed on
      allocation time.
      
      CMA has been enabled unconditionally for ARMv6+ systems.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      CC: Michal Nazarewicz <mina86@mina86.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Tested-by: NRob Clark <rob.clark@linaro.org>
      Tested-by: NOhad Ben-Cohen <ohad@wizery.com>
      Tested-by: NBenjamin Gaignard <benjamin.gaignard@linaro.org>
      Tested-by: NRobert Nelson <robertcnelson@gmail.com>
      Tested-by: NBarry Song <Baohua.Song@csr.com>
      c7909509
    • M
      ARM: dma-mapping: add support for IOMMU mapper · 4ce63fcd
      Marek Szyprowski 提交于
      This patch add a complete implementation of DMA-mapping API for
      devices which have IOMMU support.
      
      This implementation tries to optimize dma address space usage by remapping
      all possible physical memory chunks into a single dma address space chunk.
      
      DMA address space is managed on top of the bitmap stored in the
      dma_iommu_mapping structure stored in device->archdata. Platform setup
      code has to initialize parameters of the dma address space (base address,
      size, allocation precision order) with arm_iommu_create_mapping() function.
      To reduce the size of the bitmap, all allocations are aligned to the
      specified order of base 4 KiB pages.
      
      dma_alloc_* functions allocate physical memory in chunks, each with
      alloc_pages() function to avoid failing if the physical memory gets
      fragmented. In worst case the allocated buffer is composed of 4 KiB page
      chunks.
      
      dma_map_sg() function minimizes the total number of dma address space
      chunks by merging of physical memory chunks into one larger dma address
      space chunk. If requested chunk (scatter list entry) boundaries
      match physical page boundaries, most calls to dma_map_sg() requests will
      result in creating only one chunk in dma address space.
      
      dma_map_page() simply creates a mapping for the given page(s) in the dma
      address space.
      
      All dma functions also perform required cache operation like their
      counterparts from the arm linear physical memory mapping version.
      
      This patch contains code and fixes kindly provided by:
      - Krishna Reddy <vdumpa@nvidia.com>,
      - Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
      - Hiroshi DOYU <hdoyu@nvidia.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Acked-by: NKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Tested-By: NSubash Patel <subash.ramaswamy@linaro.org>
      4ce63fcd