1. 04 8月, 2017 1 次提交
  2. 18 1月, 2017 1 次提交
  3. 12 1月, 2017 4 次提交
  4. 21 12月, 2016 1 次提交
  5. 27 10月, 2016 1 次提交
  6. 22 9月, 2016 1 次提交
  7. 03 6月, 2016 1 次提交
    • M
      arm64: update stale PAGE_OFFSET comment · a13e3a5b
      Mark Rutland 提交于
      Commit ab893fb9 ("arm64: introduce KIMAGE_VADDR as the virtual
      base of the kernel region") logically split KIMAGE_VADDR from
      PAGE_OFFSET, and since commit f9040773 ("arm64: move kernel
      image to base of vmalloc area") the two have been distinct values.
      
      Unfortunately, neither commit updated the comment above these
      definitions, which now erroneously states that PAGE_OFFSET is the start
      of the kernel image rather than the start of the linear mapping.
      
      This patch fixes said comment, and introduces an explanation of
      KIMAGE_VADDR.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      a13e3a5b
  8. 28 4月, 2016 1 次提交
  9. 14 4月, 2016 2 次提交
  10. 01 3月, 2016 1 次提交
    • A
      arm64: mm: treat memstart_addr as a signed quantity · 020d044f
      Ard Biesheuvel 提交于
      Commit c031a421 ("arm64: kaslr: randomize the linear region")
      implements randomization of the linear region, by subtracting a random
      multiple of PUD_SIZE from memstart_addr. This causes the virtual mapping
      of system RAM to move upwards in the linear region, and at the same time
      causes memstart_addr to assume a value which may be negative if the offset
      of system RAM in the physical space is smaller than its offset relative to
      PAGE_OFFSET in the virtual space.
      
      Since memstart_addr is effectively an offset now, redefine its type as s64
      so that expressions involving shifting or division preserve its sign.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      020d044f
  11. 24 2月, 2016 3 次提交
    • A
      arm64: add support for kernel ASLR · f80fb3a3
      Ard Biesheuvel 提交于
      This adds support for KASLR is implemented, based on entropy provided by
      the bootloader in the /chosen/kaslr-seed DT property. Depending on the size
      of the address space (VA_BITS) and the page size, the entropy in the
      virtual displacement is up to 13 bits (16k/2 levels) and up to 25 bits (all
      4 levels), with the sidenote that displacements that result in the kernel
      image straddling a 1GB/32MB/512MB alignment boundary (for 4KB/16KB/64KB
      granule kernels, respectively) are not allowed, and will be rounded up to
      an acceptable value.
      
      If CONFIG_RANDOMIZE_MODULE_REGION_FULL is enabled, the module region is
      randomized independently from the core kernel. This makes it less likely
      that the location of core kernel data structures can be determined by an
      adversary, but causes all function calls from modules into the core kernel
      to be resolved via entries in the module PLTs.
      
      If CONFIG_RANDOMIZE_MODULE_REGION_FULL is not enabled, the module region is
      randomized by choosing a page aligned 128 MB region inside the interval
      [_etext - 128 MB, _stext + 128 MB). This gives between 10 and 14 bits of
      entropy (depending on page size), independently of the kernel randomization,
      but still guarantees that modules are within the range of relative branch
      and jump instructions (with the caveat that, since the module region is
      shared with other uses of the vmalloc area, modules may need to be loaded
      further away if the module region is exhausted)
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      f80fb3a3
    • A
      arm64: mm: use bit ops rather than arithmetic in pa/va translations · 8439e62a
      Ard Biesheuvel 提交于
      Since PAGE_OFFSET is chosen such that it cuts the kernel VA space right
      in half, and since the size of the kernel VA space itself is always a
      power of 2, we can treat PAGE_OFFSET as a bitmask and replace the
      additions/subtractions with 'or' and 'and-not' operations.
      
      For the comparison against PAGE_OFFSET, a mov/cmp/branch sequence ends
      up getting replaced with a single tbz instruction. For the additions and
      subtractions, we save a mov instruction since the mask is folded into the
      instruction's immediate field.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      8439e62a
    • A
      arm64: mm: only perform memstart_addr sanity check if DEBUG_VM · a92405f0
      Ard Biesheuvel 提交于
      Checking whether memstart_addr has been assigned every time it is
      referenced adds a branch instruction that may hurt performance if
      the reference in question occurs on a hot path. So only perform the
      check if CONFIG_DEBUG_VM=y.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      [catalin.marinas@arm.com: replaced #ifdef with VM_BUG_ON]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      a92405f0
  12. 19 2月, 2016 5 次提交
    • A
      arm64: allow kernel Image to be loaded anywhere in physical memory · a7f8de16
      Ard Biesheuvel 提交于
      This relaxes the kernel Image placement requirements, so that it
      may be placed at any 2 MB aligned offset in physical memory.
      
      This is accomplished by ignoring PHYS_OFFSET when installing
      memblocks, and accounting for the apparent virtual offset of
      the kernel Image. As a result, virtual address references
      below PAGE_OFFSET are correctly mapped onto physical references
      into the kernel Image regardless of where it sits in memory.
      
      Special care needs to be taken for dealing with memory limits passed
      via mem=, since the generic implementation clips memory top down, which
      may clip the kernel image itself if it is loaded high up in memory. To
      deal with this case, we simply add back the memory covering the kernel
      image, which may result in more memory to be retained than was passed
      as a mem= parameter.
      
      Since mem= should not be considered a production feature, a panic notifier
      handler is installed that dumps the memory limit at panic time if one was
      set.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      a7f8de16
    • A
      arm64: defer __va translation of initrd_start and initrd_end · a89dea58
      Ard Biesheuvel 提交于
      Before deferring the assignment of memstart_addr in a subsequent patch, to
      the moment where all memory has been discovered and possibly clipped based
      on the size of the linear region and the presence of a mem= command line
      parameter, we need to ensure that memstart_addr is not used to perform __va
      translations before it is assigned.
      
      One such use is in the generic early DT discovery of the initrd location,
      which is recorded as a virtual address in the globals initrd_start and
      initrd_end. So wire up the generic support to declare the initrd addresses,
      and implement it without __va() translations, and perform the translation
      after memstart_addr has been assigned.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      a89dea58
    • A
      arm64: move kernel image to base of vmalloc area · f9040773
      Ard Biesheuvel 提交于
      This moves the module area to right before the vmalloc area, and moves
      the kernel image to the base of the vmalloc area. This is an intermediate
      step towards implementing KASLR, which allows the kernel image to be
      located anywhere in the vmalloc area.
      
      Since other subsystems such as hibernate may still need to refer to the
      kernel text or data segments via their linears addresses, both are mapped
      in the linear region as well. The linear alias of the text region is
      mapped read-only/non-executable to prevent inadvertent modification or
      execution.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      f9040773
    • A
      arm64: introduce KIMAGE_VADDR as the virtual base of the kernel region · ab893fb9
      Ard Biesheuvel 提交于
      This introduces the preprocessor symbol KIMAGE_VADDR which will serve as
      the symbolic virtual base of the kernel region, i.e., the kernel's virtual
      offset will be KIMAGE_VADDR + TEXT_OFFSET. For now, we define it as being
      equal to PAGE_OFFSET, but in the future, it will be moved below it once
      we move the kernel virtual mapping out of the linear mapping.
      Reviewed-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      ab893fb9
    • A
      arm64: add support for ioremap() block mappings · 324420bf
      Ard Biesheuvel 提交于
      This wires up the existing generic huge-vmap feature, which allows
      ioremap() to use PMD or PUD sized block mappings. It also adds support
      to the unmap path for dealing with block mappings, which will allow us
      to unmap the __init region using unmap_kernel_range() in a subsequent
      patch.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      324420bf
  13. 29 10月, 2015 1 次提交
  14. 07 10月, 2015 1 次提交
  15. 28 8月, 2015 1 次提交
  16. 24 8月, 2015 1 次提交
  17. 08 8月, 2015 1 次提交
  18. 23 1月, 2015 1 次提交
    • M
      arm64: Fix overlapping VA allocations · aa03c428
      Mark Rutland 提交于
      PCI IO space was intended to be 16MiB, at 32MiB below MODULES_VADDR, but
      commit d1e6dc91 ("arm64: Add architectural support for PCI")
      extended this to cover the full 32MiB. The final 8KiB of this 32MiB is
      also allocated for the fixmap, allowing for potential clashes between
      the two.
      
      This change was masked by assumptions in mem_init and the page table
      dumping code, which assumed the I/O space to be 16MiB long through
      seaparte hard-coded definitions.
      
      This patch changes the definition of the PCI I/O space allocation to
      live in asm/memory.h, along with the other VA space allocations. As the
      fixmap allocation depends on the number of fixmap entries, this is moved
      below the PCI I/O space allocation. Both the fixmap and PCI I/O space
      are guarded with 2MB of padding. Sites assuming the I/O space was 16MiB
      are moved over use new PCI_IO_{START,END} definitions, which will keep
      in sync with the size of the IO space (now restored to 16MiB).
      
      As a useful side effect, the use of the new PCI_IO_{START,END}
      definitions prevents a build issue in the dumping code due to a (now
      redundant) missing include of io.h for PCI_IOBASE.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Laura Abbott <lauraa@codeaurora.org>
      Cc: Liviu Dudau <liviu.dudau@arm.com>
      Cc: Steve Capper <steve.capper@linaro.org>
      Cc: Will Deacon <will.deacon@arm.com>
      [catalin.marinas@arm.com: reorder FIXADDR and PCI_IO address_markers_idx enum]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      aa03c428
  19. 13 11月, 2014 1 次提交
  20. 10 11月, 2014 1 次提交
  21. 23 7月, 2014 1 次提交
  22. 09 7月, 2014 1 次提交
    • C
      arm64: implement TASK_SIZE_OF · fa2ec3ea
      Colin Cross 提交于
      include/linux/sched.h implements TASK_SIZE_OF as TASK_SIZE if it
      is not set by the architecture headers.  TASK_SIZE uses the
      current task to determine the size of the virtual address space.
      On a 64-bit kernel this will cause reading /proc/pid/pagemap of a
      64-bit process from a 32-bit process to return EOF when it reads
      past 0xffffffff.
      
      Implement TASK_SIZE_OF exactly the same as TASK_SIZE with
      test_tsk_thread_flag instead of test_thread_flag.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NColin Cross <ccross@android.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      fa2ec3ea
  23. 12 5月, 2014 1 次提交
  24. 08 5月, 2014 1 次提交
  25. 08 4月, 2014 1 次提交
  26. 20 12月, 2013 1 次提交
    • L
      arm64: Correct virt_addr_valid · e26db3f3
      Laura Abbott 提交于
      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.
      
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Nicolas Pitre <nico@linaro.org>
      Signed-off-by: NLaura Abbott <lauraa@codeaurora.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      e26db3f3
  27. 06 11月, 2013 1 次提交
  28. 07 6月, 2013 1 次提交
  29. 23 1月, 2013 1 次提交
    • C
      arm64: Add simple earlyprintk support · 2475ff9d
      Catalin Marinas 提交于
      This patch adds support for "earlyprintk=" parameter on the kernel
      command line. The format is:
      
        earlyprintk=<name>[,<addr>][,<options>]
      
      where <name> is the name of the (UART) device, e.g. "pl011", <addr> is
      the I/O address. The <options> aren't currently used.
      
      The mapping of the earlyprintk device is done very early during kernel
      boot and there are restrictions on which functions it can call. A
      special early_io_map() function is added which creates the mapping from
      the pre-defined EARLY_IOBASE to the device I/O address passed via the
      kernel parameter. The pgd entry corresponding to EARLY_IOBASE is
      pre-populated in head.S during kernel boot.
      
      Only PL011 is currently supported and it is assumed that the interface
      is already initialised by the boot loader before the kernel is started.
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      2475ff9d
  30. 17 9月, 2012 1 次提交