1. 28 Feb, 2017 4 commits
  2. 12 Aug, 2016 1 commit
  3. 03 May, 2016 2 commits
  4. 22 Feb, 2016 1 commit
    • Arnd Bergmann's avatar
      ARM: 8530/1: remove VIRT_TO_BUS · 9e0087e6
      Arnd Bergmann authored
      
      
      All drivers that are relevant for rpc or footbridge have stopped
      using virt_to_bus a while ago, so we can remove it and avoid some
      harmless randconfig warnings for drivers that we do not care about:
      
      drivers/atm/zatm.c: In function 'poll_rx':
      drivers/atm/zatm.c:401:18: warning: 'bus_to_virt' is deprecated [-Wdeprecated-declarations]
         skb = ((struct rx_buffer_head *) bus_to_virt(here[2]))->skb;
      
      FWIW, the remaining drivers using this are:
      
      ATM:  firestream, zatm, ambassador, horizon
      ISDN: hisax/netjet
      V4L:  STA2X11, zoran
      Net:  Appletalk LTPC, Tulip DE4x5, Toshiba IrDA
      WAN:  comtrol sv11, cosa, lanmedia, sealevel
      SCSI: DPT_I2O, buslogic
      VME:  CA91C142
      
      My best guess is that all of the above are so hopelessly obsolete that
      we are best off removing all of them form the kernel, but that can be
      done another time.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      9e0087e6
  5. 17 Feb, 2016 1 commit
    • Russell King's avatar
      ARM: make the physical-relative calculation more obvious · 8ff97fa3
      Russell King authored
      
      
      The physical-relative calculation between the XIP text and data sections
      introduced by the previous patch was far from obvious. Let's simplify it
      by turning it into a macro which takes the two (virtual) addresses.
      
      This allows us to arrange the calculation in a more obvious manner - we
      can make it two sub-expressions which calculate the physical address for
      each symbol, and then takes the difference of those physical addresses.
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      8ff97fa3
  6. 16 Feb, 2016 1 commit
  7. 08 Feb, 2016 1 commit
  8. 22 Sep, 2015 1 commit
  9. 27 Aug, 2015 1 commit
  10. 17 Jul, 2015 1 commit
  11. 29 Jun, 2015 1 commit
  12. 01 Jun, 2015 1 commit
    • Russell King's avatar
      ARM: redo TTBR setup code for LPAE · b2c3e38a
      Russell King authored
      
      
      Re-engineer the LPAE TTBR setup code.  Rather than passing some shifted
      address in order to fit in a CPU register, pass either a full physical
      address (in the case of r4, r5 for TTBR0) or a PFN (for TTBR1).
      
      This removes the ARCH_PGD_SHIFT hack, and the last dangerous user of
      cpu_set_ttbr() in the secondary CPU startup code path (which was there
      to re-set TTBR1 to the appropriate high physical address space on
      Keystone2.)
      Tested-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      b2c3e38a
  13. 10 Nov, 2014 1 commit
  14. 29 Jul, 2014 1 commit
    • Uwe Kleine-König's avatar
      ARM: 8113/1: remove remaining definitions of PLAT_PHYS_OFFSET from <mach/memory.h> · c6f54a9b
      Uwe Kleine-König authored
      
      
      The platforms selecting NEED_MACH_MEMORY_H defined the start address of
      their physical memory in the respective <mach/memory.h>. With
      ARM_PATCH_PHYS_VIRT=y (which is quite common today) this is useless
      though because the definition isn't used but determined dynamically.
      
      So remove the definitions from all <mach/memory.h> and provide the
      Kconfig symbol PHYS_OFFSET with the respective defaults in case
      ARM_PATCH_PHYS_VIRT isn't enabled.
      
      This allows to drop the dependency of PHYS_OFFSET on !NEED_MACH_MEMORY_H
      which prevents compiling an integrator nommu-kernel.
      (CONFIG_PAGE_OFFSET which has "default PHYS_OFFSET if !MMU" expanded to
      "0x" because CONFIG_PHYS_OFFSET doesn't exist as INTEGRATOR selects
      NEED_MACH_MEMORY_H.)
      Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      c6f54a9b
  15. 01 Jul, 2014 1 commit
    • Uwe Kleine-König's avatar
      ARM: nommu: don't limit TASK_SIZE · 03eca200
      Uwe Kleine-König authored
      With TASK_SIZE set to the maximal RAM address booting in some XIP
      configurations fails (e.g. on efm32 DK3750). The problem is that
      strncpy_from_user et al. check for the address not being above TASK_SIZE
      (since 8c56cc8b
      
       (ARM: 7449/1: use generic strnlen_user and
      strncpy_from_user functions)) and this makes booting fail if the XIP
      flash is above the RAM address space.
      
      This change is in line with blackfin, frv and m68k which also use
      0xffffffff for TASK_SIZE with !MMU.
      Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      03eca200
  16. 23 Apr, 2014 1 commit
  17. 03 Apr, 2014 1 commit
    • Russell King's avatar
      ARM: Better virt_to_page() handling · e26a9e00
      Russell King authored
      
      
      virt_to_page() is incredibly inefficient when virt-to-phys patching is
      enabled.  This is because we end up with this calculation:
      
        page = &mem_map[asm virt_to_phys(addr) >> 12 - __pv_phys_offset >> 12]
      
      in assembly.  The asm virt_to_phys() is equivalent this this operation:
      
        addr - PAGE_OFFSET + __pv_phys_offset
      
      and we can see that because this is assembly, the compiler has no chance
      to optimise some of that away.  This should reduce down to:
      
        page = &mem_map[(addr - PAGE_OFFSET) >> 12]
      
      for the common cases.  Permit the compiler to make this optimisation by
      giving it more of the information it needs - do this by providing a
      virt_to_pfn() macro.
      
      Another issue which makes this more complex is that __pv_phys_offset is
      a 64-bit type on all platforms.  This is needlessly wasteful - if we
      store the physical offset as a PFN, we can save a lot of work having
      to deal with 64-bit values, which sometimes ends up producing incredibly
      horrid code:
      
           a4c:       e3009000        movw    r9, #0
                              a4c: R_ARM_MOVW_ABS_NC  __pv_phys_offset
           a50:       e3409000        movt    r9, #0          ; r9 = &__pv_phys_offset
                              a50: R_ARM_MOVT_ABS     __pv_phys_offset
           a54:       e3002000        movw    r2, #0
                              a54: R_ARM_MOVW_ABS_NC  __pv_phys_offset
           a58:       e3402000        movt    r2, #0          ; r2 = &__pv_phys_offset
                              a58: R_ARM_MOVT_ABS     __pv_phys_offset
           a5c:       e5999004        ldr     r9, [r9, #4]    ; r9 = high word of __pv_phys_offset
           a60:       e3001000        movw    r1, #0
                              a60: R_ARM_MOVW_ABS_NC  mem_map
           a64:       e592c000        ldr     ip, [r2]        ; ip = low word of __pv_phys_offset
      Reviewed-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      e26a9e00
  18. 07 Mar, 2014 1 commit
    • Russell King's avatar
      ARM: fix noMMU kallsyms symbol filtering · 006fa259
      Russell King authored
      With noMMU, CONFIG_PAGE_OFFSET was not being set correctly.  As there's
      no MMU, PAGE_OFFSET should be equal to PHYS_OFFSET in all cases.  This
      commit makes that explicit.
      
      Since we do this, we don't need to mess around in asm/memory.h with
      ifdefs to sort this out, so let's get rid of that, and there's no point
      offering the "Memory split" option for noMMU as that's meaningless
      there.
      
      Fixes: b9b32bf7
      
       ("ARM: use linker magic for vectors and vector stubs")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      006fa259
  19. 29 Dec, 2013 1 commit
    • Laura Abbott's avatar
      ARM: 7931/1: Correct virt_addr_valid · efea3403
      Laura Abbott authored
      
      
      The definition of virt_addr_valid is that virt_addr_valid should
      return true if and only if virt_to_page returns a valid pointer.
      The current definition of virt_addr_valid only checks against the
      virtual address range. There's no guarantee that just because a
      virtual address falls bewteen PAGE_OFFSET and high_memory the
      associated physical memory has a valid backing struct page. Follow
      the example of other architectures and convert to pfn_valid to
      verify that the virtual address is actually valid. The check for
      an address between PAGE_OFFSET and high_memory is still necessary
      as vmalloc/highmem addresses are not valid with virt_to_page.
      
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Nicolas Pitre <nico@linaro.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      efea3403
  20. 13 Dec, 2013 1 commit
    • Russell King's avatar
      ARM: fix asm/memory.h build error · b713aa0b
      Russell King authored
      Jason Gunthorpe reports a build failure when ARM_PATCH_PHYS_VIRT is
      not defined:
      
      In file included from arch/arm/include/asm/page.h:163:0,
                       from include/linux/mm_types.h:16,
                       from include/linux/sched.h:24,
                       from arch/arm/kernel/asm-offsets.c:13:
      arch/arm/include/asm/memory.h: In function '__virt_to_phys':
      arch/arm/include/asm/memory.h:244:40: error: 'PHYS_OFFSET' undeclared (first use in this function)
      arch/arm/include/asm/memory.h:244:40: note: each undeclared identifier is reported only once for each function it appears in
      arch/arm/include/asm/memory.h: In function '__phys_to_virt':
      arch/arm/include/asm/memory.h:249:13: error: 'PHYS_OFFSET' undeclared (first use in this function)
      
      Fixes: ca5a45c0
      
       ("ARM: mm: use phys_addr_t appropriately in p2v and v2p conversions")
      Tested-By: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      b713aa0b
  21. 14 Nov, 2013 1 commit
    • Victor Kamensky's avatar
      ARM: 7882/1: mm: fix __phys_to_virt to work with 64 bit phys_addr_t in BE case · 139cc2ba
      Victor Kamensky authored
      
      
      Make sure that inline assembler that expects 'r' operand
      receives 32 bit value.
      
      Before this fix in case of CONFIG_ARCH_PHYS_ADDR_T_64BIT and
      CONFIG_ARM_PATCH_PHYS_VIRT __phys_to_virt function passed 64 bit
      value to __pv_stub inline assembler where 'r' operand is
      expected. Compiler behavior in such case is not well specified.
      It worked in little endian case, but in big endian case
      incorrect code was generated, where compiler confused which
      part of 64 bit value it needed to modify. For example BE
      snippet looked like this:
      
      N:0x80904E08 : MOV      r2,#0
      N:0x80904E0C : SUB      r2,r2,#0x81000000
      
      when LE similar code looked like this
      
      N:0x808FCE2C : MOV      r2,r0
      N:0x808FCE30 : SUB      r2,r2,#0xc0, 8 ; #0xc0000000
      
      Note 'r0' register is va that have to be translated into phys
      
      To avoid this situation use explicit cast to 'unsigned long',
      which explicitly discard upper part of phys address and convert
      value to 32 bit. Also add comment so such cast will not be
      removed in the future.
      Signed-off-by: default avatarVictor Kamensky <victor.kamensky@linaro.org>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      139cc2ba
  22. 29 Oct, 2013 1 commit
    • Russell King's avatar
      ARM: fix misplaced arch_virt_to_idmap() · 5e4432d3
      Russell King authored
      
      
      Olof Johansson reported:
      
      In file included from arch/arm/include/asm/page.h:163:0,
                       from include/linux/mm_types.h:16,
                       from include/linux/sched.h:24,
                       from arch/arm/kernel/asm-offsets.c:13:
      arch/arm/include/asm/memory.h: In function '__virt_to_idmap':
      arch/arm/include/asm/memory.h:300:6: error: 'arch_virt_to_idmap' undeclared (first use in this function)
      
      caused by arch_virt_to_idmap being placed inside a different
      preprocessor conditional to its user.  Move it along side its user.
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      5e4432d3
  23. 11 Oct, 2013 3 commits
    • Sricharan R's avatar
      ARM: mm: Correct virt_to_phys patching for 64 bit physical addresses · f52bb722
      Sricharan R authored
      
      
      The current phys_to_virt patching mechanism works only for 32 bit
      physical addresses and this patch extends the idea for 64bit physical
      addresses.
      
      The 64bit v2p patching mechanism patches the higher 8 bits of physical
      address with a constant using 'mov' instruction and lower 32bits are patched
      using 'add'. While this is correct, in those platforms where the lowmem addressable
      physical memory spawns across 4GB boundary, a carry bit can be produced as a
      result of addition of lower 32bits. This has to be taken in to account and added
      in to the upper. The patched __pv_offset and va are added in lower 32bits, where
      __pv_offset can be in two's complement form when PA_START < VA_START and that can
      result in a false carry bit.
      
      e.g
          1) PA = 0x80000000; VA = 0xC0000000
             __pv_offset = PA - VA = 0xC0000000 (2's complement)
      
          2) PA = 0x2 80000000; VA = 0xC000000
             __pv_offset = PA - VA = 0x1 C0000000
      
      So adding __pv_offset + VA should never result in a true overflow for (1).
      So in order to differentiate between a true carry, a __pv_offset is extended
      to 64bit and the upper 32bits will have 0xffffffff if __pv_offset is
      2's complement. So 'mvn #0' is inserted instead of 'mov' while patching
      for the same reason. Since mov, add, sub instruction are to patched
      with different constants inside the same stub, the rotation field
      of the opcode is using to differentiate between them.
      
      So the above examples for v2p translation becomes for VA=0xC0000000,
          1) PA[63:32] = 0xffffffff
             PA[31:0] = VA + 0xC0000000 --> results in a carry
             PA[63:32] = PA[63:32] + carry
      
             PA[63:0] = 0x0 80000000
      
          2) PA[63:32] = 0x1
             PA[31:0] = VA + 0xC0000000 --> results in a carry
             PA[63:32] = PA[63:32] + carry
      
             PA[63:0] = 0x2 80000000
      
      The above ideas were suggested by Nicolas Pitre <nico@linaro.org> as
      part of the review of first and second versions of the subject patch.
      
      There is no corresponding change on the phys_to_virt() side, because
      computations on the upper 32-bits would be discarded anyway.
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Reviewed-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarSricharan R <r.sricharan@ti.com>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      f52bb722
    • Santosh Shilimkar's avatar
      ARM: mm: Introduce virt_to_idmap() with an arch hook · 4dc9a817
      Santosh Shilimkar authored
      
      
      On some PAE systems (e.g. TI Keystone), memory is above the
      32-bit addressable limit, and the interconnect provides an
      aliased view of parts of physical memory in the 32-bit addressable
      space.  This alias is strictly for boot time usage, and is not
      otherwise usable because of coherency limitations. On such systems,
      the idmap mechanism needs to take this aliased mapping into account.
      
      This patch introduces virt_to_idmap() and a arch function pointer which
      can be populated by platform which needs it. Also populate necessary
      idmap spots with now available virt_to_idmap(). Avoided #ifdef approach
      to be compatible with multi-platform builds.
      
      Most architecture won't touch it and in that case virt_to_idmap()
      fall-back to existing virt_to_phys() macro.
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      4dc9a817
    • Santosh Shilimkar's avatar
      ARM: mm: use phys_addr_t appropriately in p2v and v2p conversions · ca5a45c0
      Santosh Shilimkar authored
      
      
      Fix remainder types used when converting back and forth between
      physical and virtual addresses.
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      ca5a45c0
  24. 03 Jul, 2013 1 commit
  25. 30 May, 2013 2 commits
  26. 16 Feb, 2013 1 commit
  27. 14 Feb, 2013 1 commit
    • Arnd Bergmann's avatar
      ARM: disable virt_to_bus/virt_to_bus almost everywhere · a5d533ee
      Arnd Bergmann authored
      
      
      We are getting a number of warnings about the use of the deprecated
      bus_to_virt function in drivers using the ARM ISA DMA API:
      
      drivers/parport/parport_pc.c: In function 'parport_pc_fifo_write_block_dma':
      drivers/parport/parport_pc.c:622:3: warning: 'bus_to_virt' is deprecated
      (declared at arch/arm/include/asm/memory.h:253) [-Wdeprecated-declarations]
      
      This is only because that function gets used by the inline
      set_dma_addr() helper. We know that any driver for the ISA DMA API
      is correctly using the DMA addresses, so we can change this
      to use the __bus_to_virt() function instead, which does not warn.
      
      After this, there are no remaining drivers that are used on
      any defconfigs on ARM using virt_to_bus or bus_to_virt, with
      the exception of the OSS sound driver. That driver is only used
      on RiscPC, NetWinder and Shark, so we can set ARCH_NO_VIRT_TO_BUS
      on all other platforms and hide the deprecated functions, which
      is far more effective than marking them as deprecated, in order
      to avoid any new users of that code.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      a5d533ee
  28. 08 Feb, 2013 1 commit
  29. 02 Oct, 2012 1 commit
  30. 07 Sep, 2012 1 commit
  31. 28 Jun, 2012 1 commit
  32. 24 Mar, 2012 1 commit
  33. 13 Oct, 2011 1 commit
    • Nicolas Pitre's avatar
      ARM: switch from NO_MACH_MEMORY_H to NEED_MACH_MEMORY_H · 0cdc8b92
      Nicolas Pitre authored
      
      
      Given that we want the default to not have any <mach/memory.h> and given
      that there are now fewer cases where it is still provided than the cases
      where it is not at this point, this makes sense to invert the logic and
      just identify the exception cases.
      
      The word "need" instead of "have" was chosen to construct the config
      symbol so not to suggest that having a mach/memory.h file is actually
      a feature that one should aim for.
      Signed-off-by: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
      0cdc8b92