1. 16 9月, 2014 1 次提交
  2. 04 4月, 2014 1 次提交
    • R
      ARM: Better virt_to_page() handling · e26a9e00
      Russell King 提交于
      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: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      e26a9e00
  3. 29 12月, 2013 1 次提交
  4. 11 10月, 2013 1 次提交
    • S
      ARM: mm: Correct virt_to_phys patching for 64 bit physical addresses · f52bb722
      Sricharan R 提交于
      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: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NSricharan R <r.sricharan@ti.com>
      Signed-off-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      f52bb722
  5. 10 7月, 2012 2 次提交
  6. 29 3月, 2012 1 次提交
  7. 01 11月, 2011 1 次提交
    • P
      arm: convert core files from module.h to export.h · ecea4ab6
      Paul Gortmaker 提交于
      Many of the core ARM kernel files are not modules, but just
      including module.h for exporting symbols.  Now these files can
      use the lighter footprint export.h for this role.
      
      There are probably lots more, but ARM files of mach-* and plat-*
      don't get coverage via a simple yesconfig build.  They will have
      to be cleaned up and tested via using their respective configs.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      ecea4ab6
  8. 17 10月, 2011 1 次提交
  9. 08 8月, 2011 1 次提交
  10. 18 2月, 2011 1 次提交
    • R
      ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching · dc21af99
      Russell King 提交于
      This idea came from Nicolas, Eric Miao produced an initial version,
      which was then rewritten into this.
      
      Patch the physical to virtual translations at runtime.  As we modify
      the code, this makes it incompatible with XIP kernels, but allows us
      to achieve this with minimal loss of performance.
      
      As many translations are of the form:
      
      	physical = virtual + (PHYS_OFFSET - PAGE_OFFSET)
      	virtual = physical - (PHYS_OFFSET - PAGE_OFFSET)
      
      we generate an 'add' instruction for __virt_to_phys(), and a 'sub'
      instruction for __phys_to_virt().  We calculate at run time (PHYS_OFFSET
      - PAGE_OFFSET) by comparing the address prior to MMU initialization with
      where it should be once the MMU has been initialized, and place this
      constant into the above add/sub instructions.
      
      Once we have (PHYS_OFFSET - PAGE_OFFSET), we can calculate the real
      PHYS_OFFSET as PAGE_OFFSET is a build-time constant, and save this for
      the C-mode PHYS_OFFSET variable definition to use.
      
      At present, we are unable to support Realview with Sparsemem enabled
      as this uses a complex mapping function, and MSM as this requires a
      constant which will not fit in our math instruction.
      
      Add a module version magic string for this feature to prevent
      incompatible modules being loaded.
      Tested-by: NTony Lindgren <tony@atomide.com>
      Reviewed-by: NNicolas Pitre <nicolas.pitre@linaro.org>
      Tested-by: NNicolas Pitre <nicolas.pitre@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      dc21af99
  11. 03 2月, 2011 1 次提交
  12. 02 9月, 2010 1 次提交
  13. 15 12月, 2009 1 次提交
    • A
      ARM: unexport symbols used to implement floating point emulation · 3e7b19ef
      Alan Jenkins 提交于
      The Kconfigs for in-tree floating point emulation do not allow building
      as modules. That leaves the Acorn FPEmulator module. I found two public
      releases of this as a binary module for 2.1 and 2.2 kernels, optimized
      for ARMV4.[1] If there is a resurgence of interest in this, the symbols
      can always be re-exported.
      
      This allows the EXPORT_SYMBOL_ALIAS() hack to be removed. The ulterior
      motive here is that EXPORT_SYMBOL_ALIAS() makes it harder to sort the
      resulting kernel symbol tables.  Sorted symbol tables will allow faster
      symbol resolution during module loading.
      
      Note that fp_send_sigs() and fp_printk() are simply aliases for existing
      exports and add no obvious value.  Similarly fp_enter could easily be
      renamed to kern_fp_enter at the point of definition. Therefore removing
      EXPORT_SYMBOL_ALIAS will not serve as a material obstacle to re-adding
      the exports should they be desired in future.
      
      Build tested only.
      
      [1] http://ftp.arm.linux.org.uk/pub/linux/arm/fpemulator/Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      CC: Russell King <linux@arm.linux.org.uk>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      3e7b19ef
  14. 14 8月, 2009 1 次提交
  15. 11 12月, 2008 1 次提交
  16. 30 11月, 2008 1 次提交
  17. 21 10月, 2008 1 次提交
  18. 06 9月, 2008 2 次提交
  19. 24 6月, 2008 1 次提交
  20. 02 6月, 2008 1 次提交
  21. 18 5月, 2008 1 次提交
  22. 30 5月, 2007 1 次提交
  23. 12 5月, 2007 1 次提交
  24. 12 10月, 2006 1 次提交
  25. 29 6月, 2006 2 次提交
  26. 11 4月, 2006 1 次提交
  27. 01 4月, 2006 1 次提交
  28. 15 1月, 2006 1 次提交
  29. 18 11月, 2005 1 次提交
  30. 09 11月, 2005 1 次提交
  31. 13 10月, 2005 1 次提交
  32. 07 7月, 2005 1 次提交
  33. 30 6月, 2005 1 次提交
  34. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4