1. 17 10月, 2014 2 次提交
    • K
      arm: fixmap: implement __set_fixmap() · 99b4ac9a
      Kees Cook 提交于
      This is used from set_fixmap() and clear_fixmap() via asm-generic/fixmap.h.
      Also makes sure that the fixmap allocation fits into the expected range.
      
      Based on patch by Rabin Vincent.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: Rabin Vincent <rabin@rab.in>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      99b4ac9a
    • R
      ARM: expand fixmap region to 3MB · 836a2418
      Rob Herring 提交于
      With commit a05e54c1 ("ARM: 8031/2: change fixmap mapping region to
      support 32 CPUs"), the fixmap region was expanded to 2MB, but it
      precluded any other uses of the fixmap region. In order to support other
      uses the fixmap region needs to be expanded beyond 2MB. Fortunately, the
      adjacent 1MB range 0xffe00000-0xfff00000 is availabe.
      
      Remove fixmap_page_table ptr and lookup the page table via the virtual
      address so that the fixmap region can span more that one pmd. The 2nd
      pmd is already created since it is shared with the vector page.
      Signed-off-by: NRob Herring <robh@kernel.org>
      [kees: fixed CONFIG_DEBUG_HIGHMEM get_fixmap() calls]
      [kees: moved pte allocation outside of CONFIG_HIGHMEM]
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      836a2418
  2. 02 8月, 2014 1 次提交
  3. 29 7月, 2014 1 次提交
  4. 02 6月, 2014 5 次提交
  5. 01 6月, 2014 1 次提交
  6. 26 5月, 2014 1 次提交
  7. 23 4月, 2014 1 次提交
  8. 10 2月, 2014 2 次提交
    • W
      ARM: 7954/1: mm: remove remaining domain support from ARMv6 · b6ccb980
      Will Deacon 提交于
      CPU_32v6 currently selects CPU_USE_DOMAINS if CPU_V6 and MMU. This is
      because ARM 1136 r0pX CPUs lack the v6k extensions, and therefore do
      not have hardware thread registers. The lack of these registers requires
      the kernel to update the vectors page at each context switch in order to
      write a new TLS pointer. This write must be done via the userspace
      mapping, since aliasing caches can lead to expensive flushing when using
      kmap. Finally, this requires the vectors page to be mapped r/w for
      kernel and r/o for user, which has implications for things like put_user
      which must trigger CoW appropriately when targetting user pages.
      
      The upshot of all this is that a v6/v7 kernel makes use of domains to
      segregate kernel and user memory accesses. This has the nasty
      side-effect of making device mappings executable, which has been
      observed to cause subtle bugs on recent cores (e.g. Cortex-A15
      performing a speculative instruction fetch from the GIC and acking an
      interrupt in the process).
      
      This patch solves this problem by removing the remaining domain support
      from ARMv6. A new memory type is added specifically for the vectors page
      which allows that page (and only that page) to be mapped as user r/o,
      kernel r/w. All other user r/o pages are mapped also as kernel r/o.
      Patch co-developed with Russell King.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      b6ccb980
    • C
      ARM: 7950/1: mm: Fix stage-2 device memory attributes · 4d9c5b89
      Christoffer Dall 提交于
      The stage-2 memory attributes are distinct from the Hyp memory
      attributes and the Stage-1 memory attributes.  We were using the stage-1
      memory attributes for stage-2 mappings causing device mappings to be
      mapped as normal memory.  Add the S2 equivalent defines for memory
      attributes and fix the comments explaining the defines while at it.
      
      Add a prot_pte_s2 field to the mem_type struct and fill out the field
      for device mappings accordingly.
      
      Cc: <stable@vger.kernel.org>	[3.9+]
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      4d9c5b89
  9. 11 12月, 2013 4 次提交
  10. 14 11月, 2013 1 次提交
  11. 11 10月, 2013 1 次提交
  12. 01 8月, 2013 2 次提交
  13. 26 7月, 2013 1 次提交
    • R
      ARM: constify machine_desc structure uses · ff69a4c8
      Russell King 提交于
      struct machine_desc records are defined everywhere as a 'const'
      structure, but unfortuantely it loses its const-ness through the use of
      linker magic - the symbols which surround the section are not declared
      const so it becomes possible not to use 'const' for pointers to these
      const structures.
      
      Let's fix this oversight - all pointers to these structures should be
      marked const too.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      ff69a4c8
  14. 22 7月, 2013 1 次提交
    • R
      ARM: 7785/1: mm: restrict early_alloc to section-aligned memory · c65b7e98
      Russell King 提交于
      When map_lowmem() runs, and processes a memory bank whose start or end
      is not section-aligned, memory must be allocated to store the 2nd-level
      page tables. Those allocations are made by calling memblock_alloc().
      
      At this point, the only memory that is free *and* mapped is memory which
      has already been mapped by map_lowmem() itself. For this reason, we must
      calculate the first point at which map_lowmem() will need to allocate
      memory, and set the memblock allocation limit to a lower address, so that
      memblock_alloc() is guaranteed to return memory that is already mapped.
      
      This patch enhances sanity_check_meminfo() to calculate that memory
      address, and pass it to memblock_set_current_limit(), rather than just
      assuming the limit is arm_lowmem_limit.
      
      The algorithm applied is:
      
      * Default memblock_limit to arm_lowmem_limit in the absence of any other
        limit; arm_lowmem_limit is the highest memory that is mapped by
        map_lowmem().
      
      * While walking the list of memblocks, if the start of a block is not
        aligned, 2nd-level page tables will need to be allocated to map the
        first few pages of the block. Hence, the memblock_limit must be before
        the start of the block.
      
      * Similarly, if the end of any block is not aligned, 2nd-level page
        tables will need to be allocated to map the last few pages of the
        block. Hence, the memblock_limit must point at the end of the block,
        rounded down to section-alignment.
      
      * The memory blocks are assumed to be sorted in address order, so the
        first unaligned block start or end is used to set the limit.
      
      With this algorithm, the start or end of almost any bank can be non-
      section-aligned. The only exception is that the start of bank 0 must
      be section-aligned, since otherwise memory would need to be allocated
      when mapping the start of bank 0, which occurs before any free memory
      is mapped.
      
      [swarren, wrote commit description, rewrote calculation of memblock_limit]
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      c65b7e98
  15. 09 7月, 2013 1 次提交
    • S
      ARM: 7781/1: mmu: Add debug_ll_io_init() mappings to early mappings · ee4de5d9
      Stephen Boyd 提交于
      Failure to add the mapping created in debug_ll_io_init() can lead
      to the BUG_ON() triggering in lib/ioremap.c:27 if the static
      virtual address decided for the debug_ll mapping overlaps with
      another mapping that is created later. This happens because the
      generic ioremap code has no idea there is a mapping there and it
      tries to place a mapping in the same location and blows up when
      it sees that there is a pte already present.
      
      kernel BUG at lib/ioremap.c:27!
      Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-rc2-00042-g2af0c67-dirty #316
      task: ef088000 ti: ef082000 task.ti: ef082000
      PC is at ioremap_page_range+0x16c/0x198
      LR is at ioremap_page_range+0xf0/0x198
      pc : [<c04cb874>]    lr : [<c04cb7f8>]    psr: 20000113
      sp : ef083e78  ip : af140000  fp : ef083ebc
      r10: ef7fc100  r9 : ef7fc104  r8 : 000af174
      r7 : 00000647  r6 : beffffff  r5 : f004c000  r4 : f0040000
      r3 : af173417  r2 : 16440653  r1 : af173e07  r0 : ef7fc8fc
      Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5787d  Table: 8020406a  DAC: 00000015
      Process swapper/0 (pid: 1, stack limit = 0xef082238)
      Stack: (0xef083e78 to 0xef084000)
      3e60:                                                       00040000 ef083eec
      3e80: bf134000 f004bfff c0207c00 f004c000 c02fc120 f000c000 c15e7800 00040000
      3ea0: ef083eec 00000647 c098ba9c c0953544 ef083edc ef083ec0 c021b82c c04cb714
      3ec0: c09cdc50 00000040 ef0f1e00 ef1003c0 ef083f14 ef083ee0 c09535bc c021b7bc
      3ee0: c0953544 c04d0c6c c094e2cc c1600be4 c07440c4 c09a6888 00000002 c0a15f00
      3f00: ef082000 00000000 ef083f54 ef083f18 c0208728 c0953550 00000002 c1600bfc
      3f20: c08e3fac c0839918 ef083f54 c1600b80 c09a6888 c0a15f00 0000008b c094e2cc
      3f40: c098ba9c c098bab8 ef083f94 ef083f58 c094ea0c c020865c 00000002 00000002
      3f60: c094e2cc 00000000 c025b674 00000000 c06ff860 00000000 00000000 00000000
      3f80: 00000000 00000000 ef083fac ef083f98 c06ff878 c094e910 00000000 00000000
      3fa0: 00000000 ef083fb0 c020efe8 c06ff86c 00000000 00000000 00000000 00000000
      3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 c0595108
      [<c04cb874>] (ioremap_page_range+0x16c/0x198) from [<c021b82c>] (__alloc_remap_buffer.isra.18+0x7c/0xc4)
      [<c021b82c>] (__alloc_remap_buffer.isra.18+0x7c/0xc4) from [<c09535bc>] (atomic_pool_init+0x78/0x128)
      [<c09535bc>] (atomic_pool_init+0x78/0x128) from [<c0208728>] (do_one_initcall+0xd8/0x198)
      [<c0208728>] (do_one_initcall+0xd8/0x198) from [<c094ea0c>] (kernel_init_freeable+0x108/0x1d0)
      [<c094ea0c>] (kernel_init_freeable+0x108/0x1d0) from [<c06ff878>] (kernel_init+0x18/0xf4)
      [<c06ff878>] (kernel_init+0x18/0xf4) from [<c020efe8>] (ret_from_fork+0x14/0x20)
      Code: e50b0040 ebf54b2f e51b0040 eaffffee (e7f001f2)
      
      Fix it by telling generic layers about the static mapping via
      iotable_init().  This also has the nice side effect of letting
      you see the mapping in procfs' vmallocinfo file.
      
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Stephen Warren <swarren@nvidia.com>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      ee4de5d9
  16. 17 6月, 2013 1 次提交
  17. 30 5月, 2013 4 次提交
  18. 24 5月, 2013 1 次提交
  19. 17 4月, 2013 1 次提交
  20. 23 3月, 2013 1 次提交
  21. 17 2月, 2013 2 次提交
  22. 01 2月, 2013 1 次提交
  23. 24 1月, 2013 1 次提交
  24. 19 1月, 2013 1 次提交
  25. 09 11月, 2012 1 次提交
  26. 06 11月, 2012 1 次提交
    • R
      ARM: implement debug_ll_io_init() · e5c5f2ad
      Rob Herring 提交于
      When using DEBUG_LL, the UART's (or other HW's) registers are mapped
      into early page tables based on the results of assembly macro addruart.
      Later, when the page tables are replaced, the same virtual address must
      remain valid. Historically, this has been ensured by using defines from
      <mach/iomap.h> in both the implementation of addruart, and the machine's
      .map_io() function. However, with the move to single zImage, we wish to
      remove <mach/iomap.h>. To enable this, the macro addruart may be used
      when constructing the late page tables too; addruart is exposed as a
      C function debug_ll_addr(), and used to set up the required mapping in
      debug_ll_io_init(), which may called on an opt-in basis from a machine's
      .map_io() function.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      [swarren: Mask map.virtual with PAGE_MASK. Checked for NULL results from
       debug_ll_addr (e.g. when selected UART isn't valid). Fixed compile when
       either !CONFIG_DEBUG_LL or CONFIG_DEBUG_SEMIHOSTING.]
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      e5c5f2ad