1. 10 7月, 2014 1 次提交
    • M
      arm64: head.S: remove unnecessary function alignment · 909a4069
      Mark Rutland 提交于
      Currently __turn_mmu_on is aligned to 64 bytes to ensure that it doesn't
      span any page boundary, which simplifies the idmap and spares us
      requiring an additional page table to map half of the function. In
      keeping with other important requirements in architecture code, this
      fact is undocumented.
      
      Additionally, as the function consists of three instructions totalling
      12 bytes with no literal pool data, a smaller alignment of 16 bytes
      would be sufficient.
      
      This patch reduces the alignment to 16 bytes and documents the
      underlying reason for the alignment. This reduces the required alignment
      of the entire .head.text section from 64 bytes to 16 bytes, though it
      may still be aligned to a larger value depending on TEXT_OFFSET.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Tested-by: NLaura Abbott <lauraa@codeaurora.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      909a4069
  2. 04 7月, 2014 1 次提交
  3. 10 5月, 2014 1 次提交
    • W
      arm64: head: fix cache flushing and barriers in set_cpu_boot_mode_flag · d0488597
      Will Deacon 提交于
      set_cpu_boot_mode_flag is used to identify which exception levels are
      encountered across the system by CPUs trying to enter the kernel. The
      basic algorithm is: if a CPU is booting at EL2, it will set a flag at
      an offset of #4 from __boot_cpu_mode, a cacheline-aligned variable.
      Otherwise, a flag is set at an offset of zero into the same cacheline.
      This enables us to check that all CPUs booted at the same exception
      level.
      
      This cacheline is written with the stage-1 MMU off (that is, via a
      strongly-ordered mapping) and will bypass any clean lines in the cache,
      leading to potential coherence problems when the variable is later
      checked via the normal, cacheable mapping of the kernel image.
      
      This patch reworks the broken flushing code so that we:
      
        (1) Use a DMB to order the strongly-ordered write of the cacheline
            against the subsequent cache-maintenance operation (by-VA
            operations only hazard against normal, cacheable accesses).
      
        (2) Use a single dc ivac instruction to invalidate any clean lines
            containing a stale copy of the line after it has been updated.
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      d0488597
  4. 01 5月, 2014 1 次提交
  5. 08 4月, 2014 1 次提交
  6. 05 4月, 2014 1 次提交
  7. 26 2月, 2014 1 次提交
    • C
      arm64: Extend the idmap to the whole kernel image · ea8c2e11
      Catalin Marinas 提交于
      This patch changes the idmap page table creation during boot to cover
      the whole kernel image, allowing functions like cpu_reset() to be safely
      called with the physical address.
      
      This patch also simplifies the create_block_map asm macro to no longer
      take an idmap argument and always use the phys/virt/end parameters. For
      the idmap case, phys == virt.
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      ea8c2e11
  8. 20 12月, 2013 1 次提交
  9. 07 12月, 2013 1 次提交
  10. 25 10月, 2013 3 次提交
    • M
      arm64: big-endian: set correct endianess on kernel entry · 9cf71728
      Matthew Leach 提交于
      The endianness of memory accesses at EL2 and EL1 are configured by
      SCTLR_EL2.EE and SCTLR_EL1.EE respectively. When the kernel is booted,
      the state of SCTLR_EL{2,1}.EE is unknown, and thus the kernel must
      ensure that they are set before performing any memory accesses.
      
      This patch ensures that SCTLR_EL{2,1} are configured appropriately at
      boot for kernels of either endianness.
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NMatthew Leach <matthew.leach@arm.com>
      [catalin.marinas@arm.com: fix SCTLR_EL1.E0E bit setting in head.S]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      9cf71728
    • M
      arm64: head: create a new function for setting the boot_cpu_mode flag · 828e9834
      Matthew Leach 提交于
      Currently, the code for setting the __cpu_boot_mode flag is munged in
      with el2_setup. This makes things difficult on a BE bringup as a
      memory access has to have occurred before el2_setup which is the place
      that we'd like to set the endianess on the current EL.
      
      Create a new function for setting __cpu_boot_mode and have el2_setup
      return the mode the CPU. Also define a new constant in virt.h,
      BOOT_CPU_MODE_EL1, for readability.
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NMatthew Leach <matthew.leach@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      828e9834
    • M
      arm64: factor out spin-table boot method · 652af899
      Mark Rutland 提交于
      The arm64 kernel has an internal holding pen, which is necessary for
      some systems where we can't bring CPUs online individually and must hold
      multiple CPUs in a safe area until the kernel is able to handle them.
      The current SMP infrastructure for arm64 is closely coupled to this
      holding pen, and alternative boot methods must launch CPUs into the pen,
      where they sit before they are launched into the kernel proper.
      
      With PSCI (and possibly other future boot methods), we can bring CPUs
      online individually, and need not perform the secondary_holding_pen
      dance. Instead, this patch factors the holding pen management code out
      to the spin-table boot method code, as it is the only boot method
      requiring the pen.
      
      A new entry point for secondaries, secondary_entry is added for other
      boot methods to use, which bypasses the holding pen and its associated
      overhead when bringing CPUs online. The smp.pen.text section is also
      removed, as the pen can live in head.text without problem.
      
      The cpu_operations structure is extended with two new functions,
      cpu_boot and cpu_postboot, for bringing a cpu into the kernel and
      performing any post-boot cleanup required by a bootmethod (e.g.
      resetting the secondary_holding_pen_release to INVALID_HWID).
      Documentation is added for cpu_operations.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      652af899
  11. 22 8月, 2013 1 次提交
    • R
      arm64: Expand arm64 image header · 4370eec0
      Roy Franz 提交于
      Expand the arm64 image header to allow for co-existance with
      PE/COFF header required by the EFI stub.  The PE/COFF format
      requires the "MZ" header to be at offset 0, and the offset
      to the PE/COFF header to be at offset 0x3c.  The image
      header is expanded to allow 2 instructions at the beginning
      to accommodate a benign intruction at offset 0 that includes
      the "MZ" header, a magic number, and the offset to the PE/COFF
      header.
      Signed-off-by: NRoy Franz <roy.franz@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      4370eec0
  12. 21 3月, 2013 1 次提交
  13. 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
  14. 05 12月, 2012 4 次提交
  15. 17 9月, 2012 1 次提交