1. 22 Sep, 2014 3 commits
  2. 19 Sep, 2014 1 commit
  3. 17 Sep, 2014 1 commit
  4. 15 Sep, 2014 2 commits
  5. 12 Sep, 2014 7 commits
    • Laura Abbott's avatar
      arm64: pageattr: Correctly adjust unaligned start addresses · b4da1840
      Laura Abbott authored
      
      
      The start address needs to be actually updated after it
      is detected to be unaligned. Adjust it and the end address
      properly.
      Reported-by: default avatarZi Shen Lim <zlim.lnx@gmail.com>
      Reviewed-by: default avatarZi Shen Lim <zlim.lnx@gmail.com>
      Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      b4da1840
    • Daniel Borkmann's avatar
      net: bpf: arm64: fix module memory leak when JIT image build fails · 60ef0494
      Daniel Borkmann authored
      
      
      On ARM64, when the BPF JIT compiler fills the JIT image body with
      opcodes during translation of eBPF into ARM64 opcodes, we may fail
      for several reasons during that phase: one being that we jump to
      the notyet label for not yet supported eBPF instructions such as
      BPF_ST. In that case we only free offsets, but not the actual
      allocated target image where opcodes are being stored. Fix it by
      calling module_free() on dismantle time in case of errors.
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Acked-by: default avatarZi Shen Lim <zlim.lnx@gmail.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      60ef0494
    • Catalin Marinas's avatar
      Merge arm64 CPU suspend branch · c2eb6b61
      Catalin Marinas authored
      * cpuidle:
        arm64: add PSCI CPU_SUSPEND based cpu_suspend support
        arm64: kernel: introduce cpu_init_idle CPU operation
        arm64: kernel: refactor the CPU suspend API for retention states
        Documentation: arm: define DT idle states bindings
      c2eb6b61
    • Lorenzo Pieralisi's avatar
      arm64: add PSCI CPU_SUSPEND based cpu_suspend support · 18910ab0
      Lorenzo Pieralisi authored
      
      
      This patch implements the cpu_suspend cpu operations method through
      the PSCI CPU SUSPEND API. The PSCI implementation translates the idle state
      index passed by the cpu_suspend core call into a valid PSCI state according to
      the PSCI states initialized at boot through the cpu_init_idle() CPU
      operations hook.
      
      The PSCI CPU suspend operation hook checks if the PSCI state is a
      standby state. If it is, it calls the PSCI suspend implementation
      straight away, without saving any context. If the state is a power
      down state the kernel calls the __cpu_suspend API (that saves the CPU
      context) and passed the PSCI suspend finisher as a parameter so that PSCI
      can be called by the __cpu_suspend implementation after saving and flushing
      the context as last function before power down.
      
      For power down states, entry point is set to cpu_resume physical address,
      that represents the default kernel execution address following a CPU reset.
      Reviewed-by: default avatarAshwin Chaugule <ashwin.chaugule@linaro.org>
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      18910ab0
    • Lorenzo Pieralisi's avatar
      arm64: kernel: introduce cpu_init_idle CPU operation · d64f84f6
      Lorenzo Pieralisi authored
      
      
      The CPUidle subsystem on ARM64 machines requires the idle states
      implementation back-end to initialize idle states parameter upon
      boot. This patch adds a hook in the CPU operations structure that
      should be initialized by the CPU operations back-end in order to
      provide a function that initializes cpu idle states.
      
      This patch also adds the infrastructure to arm64 kernel required
      to export the CPU operations based initialization interface, so
      that drivers (ie CPUidle) can use it when they are initialized
      at probe time.
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      d64f84f6
    • Lorenzo Pieralisi's avatar
      arm64: kernel: refactor the CPU suspend API for retention states · 714f5992
      Lorenzo Pieralisi authored
      
      
      CPU suspend is the standard kernel interface to be used to enter
      low-power states on ARM64 systems. Current cpu_suspend implementation
      by default assumes that all low power states are losing the CPU context,
      so the CPU registers must be saved and cleaned to DRAM upon state
      entry. Furthermore, the current cpu_suspend() implementation assumes
      that if the CPU suspend back-end method returns when called, this has
      to be considered an error regardless of the return code (which can be
      successful) since the CPU was not expected to return from a code path that
      is different from cpu_resume code path - eg returning from the reset vector.
      
      All in all this means that the current API does not cope well with low-power
      states that preserve the CPU context when entered (ie retention states),
      since first of all the context is saved for nothing on state entry for
      those states and a successful state entry can return as a normal function
      return, which is considered an error by the current CPU suspend
      implementation.
      
      This patch refactors the cpu_suspend() API so that it can be split in
      two separate functionalities. The arm64 cpu_suspend API just provides
      a wrapper around CPU suspend operation hook. A new function is
      introduced (for architecture code use only) for states that require
      context saving upon entry:
      
      __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
      
      __cpu_suspend() saves the context on function entry and calls the
      so called suspend finisher (ie fn) to complete the suspend operation.
      The finisher is not expected to return, unless it fails in which case
      the error is propagated back to the __cpu_suspend caller.
      
      The API refactoring results in the following pseudo code call sequence for a
      suspending CPU, when triggered from a kernel subsystem:
      
      /*
       * int cpu_suspend(unsigned long idx)
       * @idx: idle state index
       */
      {
      -> cpu_suspend(idx)
      	|---> CPU operations suspend hook called, if present
      		|--> if (retention_state)
      			|--> direct suspend back-end call (eg PSCI suspend)
      		     else
      			|--> __cpu_suspend(idx, &back_end_finisher);
      }
      
      By refactoring the cpu_suspend API this way, the CPU operations back-end
      has a chance to detect whether idle states require state saving or not
      and can call the required suspend operations accordingly either through
      simple function call or indirectly through __cpu_suspend() which carries out
      state saving and suspend finisher dispatching to complete idle state entry.
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      714f5992
    • Lorenzo Pieralisi's avatar
      Documentation: arm: define DT idle states bindings · 3f8161b2
      Lorenzo Pieralisi authored
      
      
      ARM based platforms implement a variety of power management schemes that
      allow processors to enter idle states at run-time.
      The parameters defining these idle states vary on a per-platform basis forcing
      the OS to hardcode the state parameters in platform specific static tables
      whose size grows as the number of platforms supported in the kernel increases
      and hampers device drivers standardization.
      
      Therefore, this patch aims at standardizing idle state device tree bindings
      for ARM platforms. Bindings define idle state parameters inclusive of entry
      methods and state latencies, to allow operating systems to retrieve the
      configuration entries from the device tree and initialize the related power
      management drivers, paving the way for common code in the kernel to deal with
      idle states and removing the need for static data in current and previous
      kernel versions.
      
      ARM64 platforms require the DT to define an entry-method property
      for idle states.
      
      On system implementing PSCI as an enable-method to enter low-power
      states the PSCI CPU suspend method requires the power_state parameter to
      be passed to the PSCI CPU suspend function.
      
      This parameter is specific to a power state and platform specific,
      therefore must be provided by firmware to the OS in order to enable
      proper call sequence.
      
      Thus, this patch also adds a property in the PSCI bindings that
      describes how the PSCI CPU suspend power_state parameter should be
      defined in DT in all device nodes that rely on PSCI CPU suspend method usage.
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Reviewed-by: default avatarSebastian Capella <sebcape@gmail.com>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      3f8161b2
  6. 08 Sep, 2014 26 commits