1. 23 9月, 2014 2 次提交
    • W
      arm64: debug: don't re-enable debug exceptions on return from el1_dbg · 1059c6bf
      Will Deacon 提交于
      When returning from a debug exception taken from EL1, we unmask debug
      exceptions after handling the exception. This is crucial for debug
      exceptions taken from EL0, so that any kernel work on the ret_to_user
      path can be debugged by kgdb.
      
      However, when returning back to EL1 the only thing left to do is to
      restore the original register state before the exception return. If
      single-step has been enabled by the debug exception handler, we will
      get stuck in an infinite debug exception loop, since we will take the
      step exception as soon as we unmask debug exceptions.
      
      This patch avoids unmasking debug exceptions on the debug exception
      return path when the exception was taken from EL1.
      
      Fixes: 2a283070 (arm64: debug: avoid accessing mdscr_el1 on fault paths where possible)
      Cc: <stable@vger.kernel.org> #3.16+
      Reported-by: NDavid Long <dave.long@linaro.org>
      Reported-by: NAKASHI Takahiro <takahiro.akashi@linaro.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      1059c6bf
    • C
      Revert "arm64: dmi: Add SMBIOS/DMI support" · 6f325eaa
      Catalin Marinas 提交于
      This reverts commit 668ebd10.
      
      ... because of lots of warnings during boot if Linux isn't started as an EFI
      application:
      
      WARNING: CPU: 4 PID: 1 at
      /work/Linux/linux-2.6-aarch64/drivers/firmware/dmi_scan.c:591 dmi_matches+0x10c/0x110()
      dmi check: not initialized yet.
      Modules linked in:
      CPU: 4 PID: 1 Comm: swapper/0 Not tainted 3.17.0-rc4+ #606
      Call trace:
      [<ffffffc000087fb0>] dump_backtrace+0x0/0x124
      [<ffffffc0000880e4>] show_stack+0x10/0x1c
      [<ffffffc0004d58f8>] dump_stack+0x74/0xb8
      [<ffffffc0000ab640>] warn_slowpath_common+0x8c/0xb4
      [<ffffffc0000ab6b4>] warn_slowpath_fmt+0x4c/0x58
      [<ffffffc0003f2d7c>] dmi_matches+0x108/0x110
      [<ffffffc0003f2da8>] dmi_check_system+0x24/0x68
      [<ffffffc0006974c4>] atkbd_init+0x10/0x34
      [<ffffffc0000814ac>] do_one_initcall+0x88/0x1a0
      [<ffffffc00067aab4>] kernel_init_freeable+0x148/0x1e8
      [<ffffffc0004d2c64>] kernel_init+0x10/0xd4
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      6f325eaa
  2. 22 9月, 2014 3 次提交
  3. 19 9月, 2014 1 次提交
  4. 18 9月, 2014 1 次提交
  5. 16 9月, 2014 2 次提交
  6. 12 9月, 2014 7 次提交
    • L
      arm64: pageattr: Correctly adjust unaligned start addresses · b4da1840
      Laura Abbott 提交于
      The start address needs to be actually updated after it
      is detected to be unaligned. Adjust it and the end address
      properly.
      Reported-by: NZi Shen Lim <zlim.lnx@gmail.com>
      Reviewed-by: NZi Shen Lim <zlim.lnx@gmail.com>
      Signed-off-by: NLaura Abbott <lauraa@codeaurora.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      b4da1840
    • D
      net: bpf: arm64: fix module memory leak when JIT image build fails · 60ef0494
      Daniel Borkmann 提交于
      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: NDaniel Borkmann <dborkman@redhat.com>
      Acked-by: NZi Shen Lim <zlim.lnx@gmail.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      60ef0494
    • C
      Merge arm64 CPU suspend branch · c2eb6b61
      Catalin Marinas 提交于
      * 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
    • L
      arm64: add PSCI CPU_SUSPEND based cpu_suspend support · 18910ab0
      Lorenzo Pieralisi 提交于
      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: NAshwin Chaugule <ashwin.chaugule@linaro.org>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      18910ab0
    • L
      arm64: kernel: introduce cpu_init_idle CPU operation · d64f84f6
      Lorenzo Pieralisi 提交于
      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: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      d64f84f6
    • L
      arm64: kernel: refactor the CPU suspend API for retention states · 714f5992
      Lorenzo Pieralisi 提交于
      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: NCatalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      714f5992
    • L
      Documentation: arm: define DT idle states bindings · 3f8161b2
      Lorenzo Pieralisi 提交于
      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: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Reviewed-by: NRob Herring <robh@kernel.org>
      Reviewed-by: NSebastian Capella <sebcape@gmail.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      3f8161b2
  7. 08 9月, 2014 24 次提交