1. 23 Sep, 2014 1 commit
    • Will Deacon's avatar
      arm64: debug: don't re-enable debug exceptions on return from el1_dbg · 1059c6bf
      Will Deacon authored
      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: default avatarDavid Long <dave.long@linaro.org>
      Reported-by: default avatarAKASHI Takahiro <takahiro.akashi@linaro.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      1059c6bf
  2. 22 Sep, 2014 4 commits
    • Catalin Marinas's avatar
      Revert "arm64: dmi: Add SMBIOS/DMI support" · 6f325eaa
      Catalin Marinas authored
      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: default avatarCatalin Marinas <catalin.marinas@arm.com>
      6f325eaa
    • Catalin Marinas's avatar
      arm64: Implement set_arch_dma_coherent_ops() to replace bus notifiers · 21890647
      Catalin Marinas authored
      Commit 6ecba8eb (arm64: Use bus notifiers to set per-device coherent
      DMA ops) introduced bus notifiers to set the coherent dma ops based on
      the 'dma-coherent' DT property. Since the generic of_dma_configure()
      handles this property for platform and AMBA devices, replace the
      notifiers with set_arch_dma_coherent_ops().
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      21890647
    • Robin Murphy's avatar
      of: amba: use of_dma_configure for AMBA devices · c9d571be
      Robin Murphy authored
      Commit 591c1e ("of: configure the platform device dma parameters)
      introduced a common mechanism to configure DMA from DT properties.
      AMBA devices created from DT can take advantage of this, too.
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      c9d571be
    • Yi Li's avatar
      arm64: dmi: Add SMBIOS/DMI support · 668ebd10
      Yi Li authored
      SMBIOS is important for server hardware vendors. It implements a spec for
      providing descriptive information about the platform. Things like serial
      numbers, physical layout of the ports, build configuration data, and the like.
      
      This has been tested by dmidecode and lshw tools.
      
      This patch adds the call to dmi_scan_machine() to arm64_enter_virtual_mode(),
      as that is the point where the EFI Configuration Tables are registered as
      being available. It needs to be in an early_initcall anyway as dmi_id_init(),
      which is an arch_initcall itself, depends on dmi_scan_machine() having been
      called already.
      Signed-off-by: default avatarYi Li <yi.li@linaro.org>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      668ebd10
  3. 19 Sep, 2014 1 commit
  4. 17 Sep, 2014 1 commit
  5. 15 Sep, 2014 2 commits
  6. 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
  7. 08 Sep, 2014 24 commits