1. 12 Sep, 2016 3 commits
    • Mark Rutland's avatar
      arm64/kvm: use alternative auto-nop · e506236a
      Mark Rutland authored
      Make use of the new alternative_if and alternative_else_nop_endif and
      get rid of our open-coded NOP sleds, making the code simpler to read.
      
      Note that for __kvm_call_hyp the branch to __vhe_hyp_call has been moved
      out of the alternative sequence, and in the default case there will be
      four additional NOPs executed.
      
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: kvmarm@lists.cs.columbia.edu
      Acked-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      e506236a
    • Mark Rutland's avatar
      arm64: use alternative auto-nop · 6ba3b554
      Mark Rutland authored
      Make use of the new alternative_if and alternative_else_nop_endif and
      get rid of our homebew NOP sleds, making the code simpler to read.
      
      Note that for cpu_do_switch_mm the ret has been moved out of the
      alternative sequence, and in the default case there will be three
      additional NOPs executed.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      6ba3b554
    • Mark Rutland's avatar
      arm64: alternative: add auto-nop infrastructure · 792d4737
      Mark Rutland authored
      In some cases, one side of an alternative sequence is simply a number of
      NOPs used to balance the other side. Keeping track of this manually is
      tedious, and the presence of large chains of NOPs makes the code more
      painful to read than necessary.
      
      To ameliorate matters, this patch adds a new alternative_else_nop_endif,
      which automatically balances an alternative sequence with a trivial NOP
      sled.
      
      In many cases, we would like a NOP-sled in the default case, and
      instructions patched in in the presence of a feature. To enable the NOPs
      to be generated automatically for this case, this patch also adds a new
      alternative_if, and updates alternative_else and alternative_endif to
      work with either alternative_if or alternative_endif.
      
      Cc: Andre Przywara <andre.przywara@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Dave Martin <dave.martin@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      [will: use new nops macro to generate nop sequences]
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      792d4737
  2. 09 Sep, 2016 35 commits
  3. 08 Sep, 2016 1 commit
    • Robin Murphy's avatar
      arm64/io: Allow I/O writes to use {W,X}ZR · ee5e41b5
      Robin Murphy authored
      When zeroing an I/O location, the current accessors are forced to
      allocate a temporary register to store the zero for the write. By
      tweaking the assembly constraints, we can allow the compiler to use
      the zero register directly in such cases, and save some juggling.
      Compiling a representative kernel configuration with GCC 6 shows
      that 2.3KB worth of code can be wasted just on that!
      
        text     data    bss      dec      hex     filename
       13316776 3248256 18176769 34741801 2121e29 vmlinux.o.new
       13319140 3248256 18176769 34744165 2122765 vmlinux.o.old
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      ee5e41b5
  4. 07 Sep, 2016 1 commit
    • Catalin Marinas's avatar
      arm64: Use static keys for CPU features · efd9e03f
      Catalin Marinas authored
      This patch adds static keys transparently for all the cpu_hwcaps
      features by implementing an array of default-false static keys and
      enabling them when detected. The cpus_have_cap() check uses the static
      keys if the feature being checked is a constant, otherwise the compiler
      generates the bitmap test.
      
      Because of the early call to static_branch_enable() via
      check_local_cpu_errata() -> update_cpu_capabilities(), the jump labels
      are initialised in cpuinfo_store_boot_cpu().
      
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Suzuki K. Poulose <Suzuki.Poulose@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      efd9e03f