1. 26 1月, 2017 2 次提交
  2. 23 1月, 2017 1 次提交
  3. 18 1月, 2017 3 次提交
    • M
      arm64: entry-ftrace.S: avoid open-coded {adr,ldr}_l · 829d2bd1
      Mark Rutland 提交于
      Some places in the kernel open-code sequences using ADRP for a symbol
      another instruction using a :lo12: relocation for that same symbol.
      These sequences are easy to get wrong, and more painful to read than is
      necessary. For these reasons, it is preferable to use the
      {adr,ldr,str}_l macros for these cases.
      
      This patch makes use of these in entry-ftrace.S, removing open-coded
      sequences using adrp. This results in a minor code change, since a
      temporary register is not used when generating the address for some
      symbols, but this is fine, as the value of the temporary register is not
      used elsewhere.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      829d2bd1
    • M
      arm64: efi-entry.S: avoid open-coded adr_l · 526d10ae
      Mark Rutland 提交于
      Some places in the kernel open-code sequences using ADRP for a symbol
      another instruction using a :lo12: relocation for that same symbol.
      These sequences are easy to get wrong, and more painful to read than is
      necessary. For these reasons, it is preferable to use the
      {adr,ldr,str}_l macros for these cases.
      
      This patch makes use of these in efi-entry.S, removing open-coded
      sequences using adrp.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      526d10ae
    • M
      arm64: head.S: avoid open-coded adr_l · 9bb00360
      Mark Rutland 提交于
      Some places in the kernel open-code sequences using ADRP for a symbol
      another instruction using a :lo12: relocation for that same symbol.
      These sequences are easy to get wrong, and more painful to read than is
      necessary. For these reasons, it is preferable to use the
      {adr,ldr,str}_l macros for these cases.
      
      This patch makes use of adr_l these in head.S, removing an open-coded
      sequence using adrp.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      9bb00360
  4. 17 1月, 2017 1 次提交
    • S
      arm64: cacheinfo: add support to override cache levels via device tree · 9a802431
      Sudeep Holla 提交于
      The cache hierarchy can be identified through Cache Level ID(CLIDR)
      architected system register. However in some cases it will provide
      only the number of cache levels that are integrated into the processor
      itself. In other words, it can't provide any information about the
      caches that are external and/or transparent.
      
      Some platforms require to export the information about all such external
      caches to the userspace applications via the sysfs interface.
      
      This patch adds support to override the cache levels using device tree
      to take such external non-architected caches into account.
      
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Tested-by: NTan Xiaojun <tanxiaojun@huawei.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      9a802431
  5. 13 1月, 2017 3 次提交
  6. 12 1月, 2017 7 次提交
  7. 11 1月, 2017 8 次提交
  8. 10 1月, 2017 6 次提交
    • W
      arm64: cpufeature: Don't enforce system-wide SPE capability · f31deaad
      Will Deacon 提交于
      The statistical profiling extension (SPE) is an optional feature of
      ARMv8.1 and is unlikely to be supported by all of the CPUs in a
      heterogeneous system.
      
      This patch updates the cpufeature checks so that such systems are not
      tainted as unsupported.
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Reviewed-by: NSuzuki Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      f31deaad
    • W
      arm64: cpufeature: allow for version discrepancy in PMU implementations · b20d1ba3
      Will Deacon 提交于
      Perf already supports multiple PMU instances for heterogeneous systems,
      so there's no need to be strict in the cpufeature checking, particularly
      as the PMU extension is optional in the architecture.
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Reviewed-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      b20d1ba3
    • J
      arm64: Remove useless UAO IPI and describe how this gets enabled · c8b06e3f
      James Morse 提交于
      Since its introduction, the UAO enable call was broken, and useless.
      commit 2a6dcb2b ("arm64: cpufeature: Schedule enable() calls instead
      of calling them via IPI"), fixed the framework so that these calls
      are scheduled, so that they can modify PSTATE.
      
      Now it is just useless. Remove it. UAO is enabled by the code patching
      which causes get_user() and friends to use the 'ldtr' family of
      instructions. This relies on the PSTATE.UAO bit being set to match
      addr_limit, which we do in uao_thread_switch() called via __switch_to().
      
      All that is needed to enable UAO is patch the code, and call schedule().
      __apply_alternatives_multi_stop() calls stop_machine() when it modifies
      the kernel text to enable the alternatives, (including the UAO code in
      uao_thread_switch()). Once stop_machine() has finished __switch_to() is
      called to reschedule the original task, this causes PSTATE.UAO to be set
      appropriately. An explicit enable() call is not needed.
      Reported-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NJames Morse <james.morse@arm.com>
      c8b06e3f
    • M
      arm64: head.S: fix up stale comments · 510224c2
      Mark Rutland 提交于
      In commit 23c8a500 ("arm64: kernel: use ordinary return/argument
      register for el2_setup()"), we stopped using w20 as a global stash of
      the boot mode flag, and instead pass this around in w0 as a function
      parameter.
      
      Unfortunately, we missed a couple of comments, which still refer to the
      old convention of using w20/x20.
      
      This patch fixes up the comments to describe the code as it currently
      works.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      510224c2
    • M
      arm64: add missing printk newlines · 117f5727
      Mark Rutland 提交于
      A few printk calls in arm64 omit a trailing newline, even though there
      is no subsequent KERN_CONT printk associated with them, and we actually
      want a newline.
      
      This can result in unrelated lines being appended, rather than appearing
      on a new line. Additionally, timestamp prefixes may appear in-line. This
      makes the logs harder to read than necessary.
      
      Avoid this by adding a trailing newline.
      
      These were found with a shortlist generated by:
      
      $ git grep 'pr\(intk\|_.*\)(.*)' -- arch/arm64 | grep -v pr_fmt | grep -v '\\n"'
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      CC: James Morse <james.morse@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      117f5727
    • J
      arm64: Don't trace __switch_to if function graph tracer is enabled · 8f4b326d
      Joel Fernandes 提交于
      Function graph tracer shows negative time (wrap around) when tracing
      __switch_to if the nosleep-time trace option is enabled.
      
      Time compensation for nosleep-time is done by an ftrace probe on
      sched_switch. This doesn't work well for the following events (with
      letters representing timestamps):
      A - sched switch probe called for task T switch out
      B - __switch_to calltime is recorded
      C - sched_switch probe called for task T switch in
      D - __switch_to rettime is recorded
      
      If C - A > D - B, then we end up over compensating for the time spent in
      __switch_to giving rise to negative times in the trace output.
      
      On x86, __switch_to is not traced if function graph tracer is enabled.
      Do the same for arm64 as well.
      
      Cc: Todd Kjos <tkjos@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Signed-off-by: NJoel Fernandes <joelaf@google.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      8f4b326d
  9. 05 1月, 2017 5 次提交
    • J
      KVM: VMX: remove duplicated declaration · 69130ea1
      Jan Dakinevich 提交于
      Declaration of VMX_VPID_EXTENT_SUPPORTED_MASK occures twice in the code.
      Probably, it was happened after unsuccessful merge.
      Signed-off-by: NJan Dakinevich <jan.dakinevich@gmail.com>
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      69130ea1
    • J
      KVM: MIPS: Flush KVM entry code from icache globally · 32eb12a6
      James Hogan 提交于
      Flush the KVM entry code from the icache on all CPUs, not just the one
      that built the entry code.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      Cc: <stable@vger.kernel.org> # 3.16.x-
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      32eb12a6
    • J
      KVM: MIPS: Don't clobber CP0_Status.UX · 4c881451
      James Hogan 提交于
      On 64-bit kernels, MIPS KVM will clear CP0_Status.UX to prevent the
      guest (running in user mode) from accessing the 64-bit memory segments.
      However the previous value of CP0_Status.UX is never restored when
      exiting from the guest.
      
      If the user process uses 64-bit addressing (the n64 ABI) this can result
      in address error exceptions from the kernel if it needs to deliver a
      signal before returning to user mode, as the kernel will need to write a
      sigframe to high user addresses on the user stack which are disallowed
      by CP0_Status.UX=0.
      
      This is fixed by explicitly setting SX and UX again when exiting from
      the guest, and explicitly clearing those bits when returning to the
      guest. Having the SX and UX bits set when handling guest exits (rather
      than only when exiting to userland) will be helpful when we support VZ,
      since we shouldn't need to directly read or write guest memory, so it
      will be valid for cache management IPIs to access host user addresses.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      Cc: <stable@vger.kernel.org> # 4.8.x-
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      4c881451
    • M
      arm64: restore get_current() optimisation · 9d84fb27
      Mark Rutland 提交于
      Commit c02433dd ("arm64: split thread_info from task stack")
      inverted the relationship between get_current() and
      current_thread_info(), with sp_el0 now holding the current task_struct
      rather than the current thead_info. The new implementation of
      get_current() prevents the compiler from being able to optimize repeated
      calls to either, resulting in a noticeable penalty in some
      microbenchmarks.
      
      This patch restores the previous optimisation by implementing
      get_current() in the same way as our old current_thread_info(), using a
      non-volatile asm statement.
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Reported-by: NDavidlohr Bueso <dbueso@suse.de>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      9d84fb27
    • M
      arm64: mm: fix show_pte KERN_CONT fallout · 6ef4fb38
      Mark Rutland 提交于
      Recent changes made KERN_CONT mandatory for continued lines. In the
      absence of KERN_CONT, a newline may be implicit inserted by the core
      printk code.
      
      In show_pte, we (erroneously) use printk without KERN_CONT for continued
      prints, resulting in output being split across a number of lines, and
      not matching the intended output, e.g.
      
      [ff000000000000] *pgd=00000009f511b003
      , *pud=00000009f4a80003
      , *pmd=0000000000000000
      
      Fix this by using pr_cont() for all the continuations.
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      6ef4fb38
  10. 04 1月, 2017 3 次提交
  11. 03 1月, 2017 1 次提交
    • F
      ARM: dts: imx6: Disable "weim" node in the dtsi files · 116dad7d
      Fabio Estevam 提交于
      Commit 1be81ea5 ("ARM: dts: imx6: Add imx-weim parameters to
      dtsi's") causes the following probe error when the weim node is not
      present on the board dts (such as imx6q-sabresd):
      
      imx-weim 21b8000.weim: Invalid 'ranges' configuration
      imx-weim: probe of 21b8000.weim failed with error -22
      
      There is no need to always enable the "weim" node on mx6. Do the same
      as in the other i.MX dtsi files where "weim" is disabled and only gets
      enabled on a per dts basis.
      
      All the imx6 weim dts users explicitily provide 'status = "okay"', so
      this change has no impact on current imx6 weim users.
      
      If a board does not use the weim driver it will not describe its 'ranges'
      property, so simply disable the 'weim' node in the imx6 dtsi files to
      avoid such probe error message.
      
      Fixes: 1be81ea5 ("ARM: dts: imx6: Add imx-weim parameters to dtsi's")
      Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: NShawn Guo <shawnguo@kernel.org>
      116dad7d