Commit Graph

6419 Commits

Author SHA1 Message Date
Linus Torvalds b1878b857c ARM: SoC fixes for 4.14
Only two patches came in over the last two weeks: Uniphier USB support
 needs additional clocks enabled (on both 32-bit and 64-bit ARM), and
 a Marvell MVEBU stability issue has been fixed.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIVAwUAWfz7gGCrR//JCVInAQLpeQ//SI+l8egWQCpBVF57oW3Y+PdNcYvAmfqv
 h4fPl6if0VXYKPdGoiIOLO5uk+SL2MxoX46dSmqOVnBVj7CvHZzmlCjvVk8UKzJI
 svfU3x1YwHdFf+brIoQxrdCI3iVV/6LgtHgjF2jxxatHqLpnjQRqLmY/kTV99I19
 IXSTBS49H0X4QaXt+l6AUdn5f/fauX0cN8EIh3e8bPIBHZWkrXEbJb7Zx0tGMtlz
 jKb0vw4RTms7BS7R5iZIvUzD5WvgRXEMeiTVbBXlB7Tp6Pet4+zdP98J3TBO7GYD
 Dq/vhj2rLw6C2sbmLNCdghWi7urZIuWWdJAEDU6hijvoDqidGUjtmSobGToW8B5n
 rb42NbfeOleDzFCXN+0mjE2dH/coqe3FPfG3MkppdLc8AM70wvYMpguAAkGWp+DI
 FTJvqybrPZ0/YCy9x5UDRe4VsBp015lUdRzZx/kfZ0olvE12wuLRiQ4+d26nHrry
 Y08EKY8pYJ9BMVTWYqB4XVaP5axuDa4tLr+hsuHEwW21fziyZ/IvkYTbwfmmxxCG
 bF9alE/H5bp20I8j3taZUhpdAg4f/Cl+sZBHMPfyo+oeQ2Dmx1XOtk9nXqcvroa3
 8ls9BK1ySJSAREpIADPa8OESeSWOHuGDmbzcw0KtVVcraeLfEl1m1L+zHqPsHPjB
 Ii+uUzsmg0M=
 =pn9T
 -----END PGP SIGNATURE-----

Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Arnd Bergmann:
 "Only two patches came in over the last two weeks: Uniphier USB support
  needs additional clocks enabled (on both 32-bit and 64-bit ARM), and a
  Marvell MVEBU stability issue has been fixed"

* tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: dts: mvebu: pl310-cache disable double-linefill
  arm64: dts: uniphier: add STDMAC clock to EHCI nodes
  ARM: dts: uniphier: add STDMAC clock to EHCI nodes
2017-11-04 11:33:28 -07:00
Andreas Färber 965f94c775 arm64: dts: actions: s900-bubblegum-96: Add fake uart5 clock
Give the serial driver a fixed-clock as input for baudrate 115200.

Signed-off-by: Andreas Färber <afaerber@suse.de>
2017-11-04 18:21:10 +08:00
Jason A. Donenfeld fb8722735f arm64: support __int128 on gcc 5+
Versions of gcc prior to gcc 5 emitted a __multi3 function call when
dealing with TI types, resulting in failures when trying to link to
libgcc, and more generally, bad performance. However, since gcc 5,
the compiler supports actually emitting fast instructions, which means
we can at long last enable this option and receive the speedups.

The gcc commit that added proper Aarch64 support is:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=d1ae7bb994f49316f6f63e6173f2931e837a351d
This commit appears to be part of the gcc 5 release.

There are still a few instructions, __ashlti3 and __ashrti3, which
require libgcc, which is fine. Rather than linking to libgcc, we
simply provide them ourselves, since they're not that complicated.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:21 +00:00
Dave Martin ce6990813f arm64/sve: Add documentation
This patch adds basic documentation of the user/kernel interface
provided by the for SVE.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Alan Hayward <alan.hayward@arm.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Szabolcs Nagy <szabolcs.nagy@arm.com>
Cc: linux-api@vger.kernel.org
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:21 +00:00
Dave Martin 43994d824e arm64/sve: Detect SVE and activate runtime support
This patch enables detection of hardware SVE support via the
cpufeatures framework, and reports its presence to the kernel and
userspace via the new ARM64_SVE cpucap and HWCAP_SVE hwcap
respectively.

Userspace can also detect SVE using ID_AA64PFR0_EL1, using the
cpufeatures MRS emulation.

When running on hardware that supports SVE, this enables runtime
kernel support for SVE, and allows user tasks to execute SVE
instructions and make of the of the SVE-specific user/kernel
interface extensions implemented by this series.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:21 +00:00
Dave Martin 07d79fe7c2 arm64/sve: KVM: Hide SVE from CPU features exposed to guests
KVM guests cannot currently use SVE, because SVE is always
configured to trap to EL2.

However, a guest that sees SVE reported as present in
ID_AA64PFR0_EL1 may legitimately expect that SVE works and try to
use it.  Instead of working, the guest will receive an injected
undef exception, which may cause the guest to oops or go into a
spin.

To avoid misleading the guest into believing that SVE will work,
this patch masks out the SVE field from ID_AA64PFR0_EL1 when a
guest attempts to read this register.  No support is explicitly
added for ID_AA64ZFR0_EL1 either, so that is still emulated as
reading as zero, which is consistent with SVE not being
implemented.

This is a temporary measure, and will be removed in a later series
when full KVM support for SVE is implemented.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:20 +00:00
Dave Martin aac45ffd1f arm64/sve: KVM: Treat guest SVE use as undefined instruction execution
When trapping forbidden attempts by a guest to use SVE, we want the
guest to see a trap consistent with SVE not being implemented.

This patch injects an undefined instruction exception into the
guest in response to such an exception.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:20 +00:00
Dave Martin 17eed27b02 arm64/sve: KVM: Prevent guests from using SVE
Until KVM has full SVE support, guests must not be allowed to
execute SVE instructions.

This patch enables the necessary traps, and also ensures that the
traps are disabled again on exit from the guest so that the host
can still use SVE if it wants to.

On guest exit, high bits of the SVE Zn registers may have been
clobbered as a side-effect the execution of FPSIMD instructions in
the guest.  The existing KVM host FPSIMD restore code is not
sufficient to restore these bits, so this patch explicitly marks
the CPU as not containing cached vector state for any task, thus
forcing a reload on the next return to userspace.  This is an
interim measure, in advance of adding full SVE awareness to KVM.

This marking of cached vector state in the CPU as invalid is done
using __this_cpu_write(fpsimd_last_state, NULL) in fpsimd.c.  Due
to the repeated use of this rather obscure operation, it makes
sense to factor it out as a separate helper with a clearer name.
This patch factors it out as fpsimd_flush_cpu_state(), and ports
all callers to use it.

As a side effect of this refactoring, a this_cpu_write() in
fpsimd_cpu_pm_notifier() is changed to __this_cpu_write().  This
should be fine, since cpu_pm_enter() is supposed to be called only
with interrupts disabled.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:19 +00:00
Dave Martin 4ffa09a939 arm64/sve: Add sysctl to set the default vector length for new processes
Because of the effect of SVE on the size of the signal frame, the
default vector length used for new processes involves a tradeoff
between performance of SVE-enabled software on the one hand, and
reliability of non-SVE-aware software on the other hand.

For this reason, the best choice depends on the repertoire of
userspace software in use and is thus best left up to distro
maintainers, sysadmins and developers.

If CONFIG_SYSCTL and CONFIG_PROC_SYSCTL are enabled, this patch
exposes the default vector length in
/proc/sys/abi/sve_default_vector_length, where boot scripts or the
adventurous can poke it.

In common with other arm64 ABI sysctls, this control is currently
global: setting it requires CAP_SYS_ADMIN in the root user
namespace, but the value set is effective for subsequent execs in
all namespaces.  The control only affects _new_ processes, however:
changing it does not affect the vector length of any existing
process.

The intended usage model is that if userspace is known to be fully
SVE-tolerant (or a developer is curious to find out) then this
parameter can be cranked up during system startup.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:19 +00:00
Dave Martin 2d2123bc7c arm64/sve: Add prctl controls for userspace vector length management
This patch adds two arm64-specific prctls, to permit userspace to
control its vector length:

 * PR_SVE_SET_VL: set the thread's SVE vector length and vector
   length inheritance mode.

 * PR_SVE_GET_VL: get the same information.

Although these prctls resemble instruction set features in the SVE
architecture, they provide additional control: the vector length
inheritance mode is Linux-specific and nothing to do with the
architecture, and the architecture does not permit EL0 to set its
own vector length directly.  Both can be used in portable tools
without requiring the use of SVE instructions.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
[will: Fixed up prctl constants to avoid clash with PDEATHSIG]
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:19 +00:00
Dave Martin 43d4da2c45 arm64/sve: ptrace and ELF coredump support
This patch defines and implements a new regset NT_ARM_SVE, which
describes a thread's SVE register state.  This allows a debugger to
manipulate the SVE state, as well as being included in ELF
coredumps for post-mortem debugging.

Because the regset size and layout are dependent on the thread's
current vector length, it is not possible to define a C struct to
describe the regset contents as is done for existing regsets.
Instead, and for the same reasons, NT_ARM_SVE is based on the
freeform variable-layout approach used for the SVE signal frame.

Additionally, to reduce debug overhead when debugging threads that
might or might not have live SVE register state, NT_ARM_SVE may be
presented in one of two different formats: the old struct
user_fpsimd_state format is embedded for describing the state of a
thread with no live SVE state, whereas a new variable-layout
structure is embedded for describing live SVE state.  This avoids a
debugger needing to poll NT_PRFPREG in addition to NT_ARM_SVE, and
allows existing userspace code to handle the non-SVE case without
too much modification.

For this to work, NT_ARM_SVE is defined with a fixed-format header
of type struct user_sve_header, which the recipient can use to
figure out the content, size and layout of the reset of the regset.
Accessor macros are defined to allow the vector-length-dependent
parts of the regset to be manipulated.

Signed-off-by: Alan Hayward <alan.hayward@arm.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Okamoto Takayuki <tokamoto@jp.fujitsu.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:18 +00:00
Dave Martin fdfa976cae arm64/sve: Preserve SVE registers around EFI runtime service calls
The EFI runtime services ABI allows EFI to make free use of the
FPSIMD registers during EFI runtime service calls, subject to the
callee-save requirements of the AArch64 procedure call standard.

However, the SVE architecture allows upper bits of the SVE vector
registers to be zeroed as a side-effect of FPSIMD V-register
writes.  This means that the SVE vector registers must be saved in
their entirety in order to avoid data loss: non-SVE-aware EFI
implementations cannot restore them correctly.

The non-IRQ case is already handled gracefully by
kernel_neon_begin().  For the IRQ case, this patch allocates a
suitable per-CPU stash buffer for the full SVE register state and
uses it to preserve the affected registers around EFI calls.  It is
currently unclear how the EFI runtime services ABI will be
clarified with respect to SVE, so it safest to assume that the
predicate registers and FFR must be saved and restored too.

No attempt is made to restore the restore the vector length after
a call, for now.  It is deemed rather insane for EFI to change it,
and contemporary EFI implementations certainly won't.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:18 +00:00
Dave Martin 1bd3f93641 arm64/sve: Preserve SVE registers around kernel-mode NEON use
Kernel-mode NEON will corrupt the SVE vector registers, due to the
way they alias the FPSIMD vector registers in the hardware.

This patch ensures that any live SVE register content for the task
is saved by kernel_neon_begin().  The data will be restored in the
usual way on return to userspace.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:18 +00:00
Dave Martin 2e0f2478ea arm64/sve: Probe SVE capabilities and usable vector lengths
This patch uses the cpufeatures framework to determine common SVE
capabilities and vector lengths, and configures the runtime SVE
support code appropriately.

ZCR_ELx is not really a feature register, but it is convenient to
use it as a template for recording the maximum vector length
supported by a CPU, using the LEN field.  This field is similar to
a feature field in that it is a contiguous bitfield for which we
want to determine the minimum system-wide value.  This patch adds
ZCR as a pseudo-register in cpuinfo/cpufeatures, with appropriate
custom code to populate it.  Finding the minimum supported value of
the LEN field is left to the cpufeatures framework in the usual
way.

The meaning of ID_AA64ZFR0_EL1 is not architecturally defined yet,
so for now we just require it to be zero.

Note that much of this code is dormant and SVE still won't be used
yet, since system_supports_sve() remains hardwired to false.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:17 +00:00
Dave Martin 8f1eec57cd arm64: cpufeature: Move sys_caps_initialised declarations
update_cpu_features() currently cannot tell whether it is being
called during early or late secondary boot.  This doesn't
desperately matter for anything it currently does.

However, SVE will need to know here whether the set of available
vector lengths is known or still to be determined when booting a
CPU, so that it can be updated appropriately.

This patch simply moves the sys_caps_initialised stuff to the top
of the file so that it can be used more widely.  There doesn't seem
to be a more obvious place to put it.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:17 +00:00
Dave Martin 7582e22038 arm64/sve: Backend logic for setting the vector length
This patch implements the core logic for changing a task's vector
length on request from userspace.  This will be used by the ptrace
and prctl frontends that are implemented in later patches.

The SVE architecture permits, but does not require, implementations
to support vector lengths that are not a power of two.  To handle
this, logic is added to check a requested vector length against a
possibly sparse bitmap of available vector lengths at runtime, so
that the best supported value can be chosen.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:16 +00:00
Dave Martin 8cd969d28f arm64/sve: Signal handling support
This patch implements support for saving and restoring the SVE
registers around signals.

A fixed-size header struct sve_context is always included in the
signal frame encoding the thread's vector length at the time of
signal delivery, optionally followed by a variable-layout structure
encoding the SVE registers.

Because of the need to preserve backwards compatibility, the FPSIMD
view of the SVE registers is always dumped as a struct
fpsimd_context in the usual way, in addition to any sve_context.

The SVE vector registers are dumped in full, including bits 127:0
of each register which alias the corresponding FPSIMD vector
registers in the hardware.  To avoid any ambiguity about which
alias to restore during sigreturn, the kernel always restores bits
127:0 of each SVE vector register from the fpsimd_context in the
signal frame (which must be present): userspace needs to take this
into account if it wants to modify the SVE vector register contents
on return from a signal.

FPSR and FPCR, which are used by both FPSIMD and SVE, are not
included in sve_context because they are always present in
fpsimd_context anyway.

For signal delivery, a new helper
fpsimd_signal_preserve_current_state() is added to update _both_
the FPSIMD and SVE views in the task struct, to make it easier to
populate this information into the signal frame.  Because of the
redundancy between the two views of the state, only one is updated
otherwise.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:16 +00:00
Dave Martin 79ab047c75 arm64/sve: Support vector length resetting for new processes
It's desirable to be able to reset the vector length to some sane
default for new processes, since the new binary and its libraries
may or may not be SVE-aware.

This patch tracks the desired post-exec vector length (if any) in a
new thread member sve_vl_onexec, and adds a new thread flag
TIF_SVE_VL_INHERIT to control whether to inherit or reset the
vector length.  Currently these are inactive.  Subsequent patches
will provide the capability to configure them.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:16 +00:00
Dave Martin bc0ee47603 arm64/sve: Core task context handling
This patch adds the core support for switching and managing the SVE
architectural state of user tasks.

Calls to the existing FPSIMD low-level save/restore functions are
factored out as new functions task_fpsimd_{save,load}(), since SVE
now dynamically may or may not need to be handled at these points
depending on the kernel configuration, hardware features discovered
at boot, and the runtime state of the task.  To make these
decisions as fast as possible, const cpucaps are used where
feasible, via the system_supports_sve() helper.

The SVE registers are only tracked for threads that have explicitly
used SVE, indicated by the new thread flag TIF_SVE.  Otherwise, the
FPSIMD view of the architectural state is stored in
thread.fpsimd_state as usual.

When in use, the SVE registers are not stored directly in
thread_struct due to their potentially large and variable size.
Because the task_struct slab allocator must be configured very
early during kernel boot, it is also tricky to configure it
correctly to match the maximum vector length provided by the
hardware, since this depends on examining secondary CPUs as well as
the primary.  Instead, a pointer sve_state in thread_struct points
to a dynamically allocated buffer containing the SVE register data,
and code is added to allocate and free this buffer at appropriate
times.

TIF_SVE is set when taking an SVE access trap from userspace, if
suitable hardware support has been detected.  This enables SVE for
the thread: a subsequent return to userspace will disable the trap
accordingly.  If such a trap is taken without sufficient system-
wide hardware support, SIGILL is sent to the thread instead as if
an undefined instruction had been executed: this may happen if
userspace tries to use SVE in a system where not all CPUs support
it for example.

The kernel will clear TIF_SVE and disable SVE for the thread
whenever an explicit syscall is made by userspace.  For backwards
compatibility reasons and conformance with the spirit of the base
AArch64 procedure call standard, the subset of the SVE register
state that aliases the FPSIMD registers is still preserved across a
syscall even if this happens.  The remainder of the SVE register
state logically becomes zero at syscall entry, though the actual
zeroing work is currently deferred until the thread next tries to
use SVE, causing another trap to the kernel.  This implementation
is suboptimal: in the future, the fastpath case may be optimised
to zero the registers in-place and leave SVE enabled for the task,
where beneficial.

TIF_SVE is also cleared in the following slowpath cases, which are
taken as reasonable hints that the task may no longer use SVE:
 * exec
 * fork and clone

Code is added to sync data between thread.fpsimd_state and
thread.sve_state whenever enabling/disabling SVE, in a manner
consistent with the SVE architectural programmer's model.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Alex Bennée <alex.bennee@linaro.org>
[will: added #include to fix allnoconfig build]
[will: use enable_daif in do_sve_acc]
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:15 +00:00
Dave Martin 22043a3c08 arm64/sve: Low-level CPU setup
To enable the kernel to use SVE, SVE traps from EL1 to EL2 must be
disabled.  To take maximum advantage of the hardware, the full
available vector length also needs to be enabled for EL1 by
programming ZCR_EL2.LEN.  (The kernel will program ZCR_EL1.LEN as
required, but this cannot override the limit set by ZCR_EL2.)

This patch makes the appropriate changes to the EL2 early setup
code.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:15 +00:00
Dave Martin d0b8cd3187 arm64/sve: Signal frame and context structure definition
This patch defines the representation that will be used for the SVE
register state in the signal frame, and implements support for
saving and restoring the SVE registers around signals.

The same layout will also be used for the in-kernel task state.

Due to the variability of the SVE vector length, it is not possible
to define a fixed C struct to describe all the registers.  Instead,
Macros are defined in sigcontext.h to facilitate access to the
parts of the structure.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:14 +00:00
Dave Martin ddd25ad1fd arm64/sve: Kconfig update and conditional compilation support
This patch adds CONFIG_ARM64_SVE to control building of SVE support
into the kernel, and adds a stub predicate system_supports_sve() to
control conditional compilation and runtime SVE support.

system_supports_sve() just returns false for now: it will be
replaced with a non-trivial implementation in a later patch, once
SVE support is complete enough to be enabled safely.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:14 +00:00
Dave Martin 1fc5dce78a arm64/sve: Low-level SVE architectural state manipulation functions
Manipulating the SVE architectural state, including the vector and
predicate registers, first-fault register and the vector length,
requires the use of dedicated instructions added by SVE.

This patch adds suitable assembly functions for saving and
restoring the SVE registers and querying the vector length.
Setting of the vector length is done as part of register restore.

Since people building kernels may not all get an SVE-enabled
toolchain for a while, this patch uses macros that generate
explicit opcodes in place of assembler mnemonics.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:14 +00:00
Dave Martin 672365649c arm64/sve: System register and exception syndrome definitions
The SVE architecture adds some system registers, ID register fields
and a dedicated ESR exception class.

This patch adds the appropriate definitions that will be needed by
the kernel.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:13 +00:00
Dave Martin 9cf5b54faf arm64: fpsimd: Simplify uses of {set,clear}_ti_thread_flag()
The existing FPSIMD context switch code contains a couple of
instances of {set,clear}_ti_thread(task_thread_info(task)).  Since
there are thread flag manipulators that operate directly on
task_struct, this verbosity isn't strictly needed.

For consistency, this patch simplifies the affected calls.  This
should have no impact on behaviour.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:13 +00:00
Dave Martin 38b9aeb32f arm64: Port deprecated instruction emulation to new sysctl interface
Currently, armv8_deprected.c takes charge of the "abi" sysctl
directory, which makes life difficult for other code that wants to
register sysctls in the same directory.

There is a "new" [1] sysctl registration interface that removes the
need to define ctl_tables for parent directories explicitly, which
is ideal here.

This patch ports register_insn_emulation_sysctl() over to the
register_sysctl() interface and removes the redundant ctl_table for
"abi".

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>

[1] fea478d410 (sysctl: Add register_sysctl for normal sysctl
users)
The commit message notes an intent to port users of the
pre-existing interfaces over to register_sysctl(), though the
number of users of the new interface currently appears negligible.
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:12 +00:00
Dave Martin b472db6cf8 arm64: efi: Add missing Kconfig dependency on KERNEL_MODE_NEON
The EFI runtime services ABI permits calls to EFI to clobber
certain FPSIMD/NEON registers, as per the AArch64 procedure call
standard.

Saving/restoring the clobbered registers around such calls needs
KERNEL_MODE_NEON, but the dependency is missing from Kconfig.

This patch adds the missing dependency.

This will aid bisection of the patches implementing support for the
ARM Scalable Vector Extension (SVE).

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:12 +00:00
Dave Martin 93390c0a1b arm64: KVM: Hide unsupported AArch64 CPU features from guests
Currently, a guest kernel sees the true CPU feature registers
(ID_*_EL1) when it reads them using MRS instructions.  This means
that the guest may observe features that are present in the
hardware but the host doesn't understand or doesn't provide support
for.  A guest may legimitately try to use such a feature as per the
architecture, but use of the feature may trap instead of working
normally, triggering undef injection into the guest.

This is not a problem for the host, but the guest may go wrong when
running on newer hardware than the host knows about.

This patch hides from guest VMs any AArch64-specific CPU features
that the host doesn't support, by exposing to the guest the
sanitised versions of the registers computed by the cpufeatures
framework, instead of the true hardware registers.  To achieve
this, HCR_EL2.TID3 is now set for AArch64 guests, and emulation
code is added to KVM to report the sanitised versions of the
affected registers in response to MRS and register reads from
userspace.

The affected registers are removed from invariant_sys_regs[] (since
the invariant_sys_regs handling is no longer quite correct for
them) and added to sys_reg_desgs[], with appropriate access(),
get_user() and set_user() methods.  No runtime vcpu storage is
allocated for the registers: instead, they are read on demand from
the cpufeatures framework.  This may need modification in the
future if there is a need for userspace to customise the features
visible to the guest.

Attempts by userspace to write the registers are handled similarly
to the current invariant_sys_regs handling: writes are permitted,
but only if they don't attempt to change the value.  This is
sufficient to support VM snapshot/restore from userspace.

Because of the additional registers, restoring a VM on an older
kernel may not work unless userspace knows how to handle the extra
VM registers exposed to the KVM user ABI by this patch.

Under the principle of least damage, this patch makes no attempt to
handle any of the other registers currently in
invariant_sys_regs[], or to emulate registers for AArch32: however,
these could be handled in a similar way in future, as necessary.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:12 +00:00
Dave Martin abf73988a7 arm64: signal: Verify extra data is user-readable in sys_rt_sigreturn
Currently sys_rt_sigreturn() verifies that the base sigframe is
readable, but no similar check is performed on the extra data to
which an extra_context record points.

This matters because the extra data will be read with the
unprotected user accessors.  However, this is not a problem at
present because the extra data base address is required to be
exactly at the end of the base sigframe.  So, there would need to
be a non-user-readable kernel address within about 59K
(SIGFRAME_MAXSZ - sizeof(struct rt_sigframe)) of some address for
which access_ok(VERIFY_READ) returns true, in order for sigreturn
to be able to read kernel memory that should be inaccessible to the
user task.  This is currently impossible due to the untranslatable
address hole between the TTBR0 and TTBR1 address ranges.

Disappearance of the hole between the TTBR0 and TTBR1 mapping
ranges would require the VA size for TTBR0 and TTBR1 to grow to at
least 55 bits, and either the disabling of tagged pointers for
userspace or enabling of tagged pointers for kernel space; none of
which is currently envisaged.

Even so, it is wrong to use the unprotected user accessors without
an accompanying access_ok() check.

To avoid the potential for future surprises, this patch does an
explicit access_ok() check on the extra data space when parsing an
extra_context record.

Fixes: 33f082614c ("arm64: signal: Allow expansion of the signal frame")
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:11 +00:00
Dave Martin 94ef7ecbdf arm64: fpsimd: Correctly annotate exception helpers called from asm
A couple of FPSIMD exception handling functions that are called
from entry.S are currently not annotated as such.

This is not a big deal since asmlinkage does nothing on arm/arm64,
but fixing the annotations is more consistent and may help avoid
future surprises.

This patch adds appropriate asmlinkage annotations for
do_fpsimd_acc() and do_fpsimd_exc().

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 15:24:11 +00:00
Julien Thierry d125bffcef arm64: Fix static use of function graph
Function graph does not work currently when CONFIG_DYNAMIC_TRACE is not
set. This is because ftrace_function_trace is not always set to ftrace_stub
when function_graph is in use.

Do not skip checking of graph tracer functions when ftrace_function_trace
is set.

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Reviewed-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-03 12:05:23 +00:00
Linus Torvalds 6daa083923 Check addr_limit in arm64 __dump_instr()
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAln7Zo4ACgkQa9axLQDI
 XvE0ohAAmACeUnOCNdpao4wR5aej/t6vKIl3ts+Pi7MseFefc0NtDB0skhLaefwT
 TjkJpqMgLDAj4LX0QKtjeZq3NkEYF2OBsyQKSlWQjPAwEIZGGl033sOQJBGKQ6pb
 8MmFqpWrSAcQcLGJ7AaE41NZgfrYMfVnltUErLL/dGlCuDQ2MFEejA7IiXdr2HXH
 C4HmYtH3ZbHaDviicWu3McIpLJHeZbOcZLAt5iHzUy0eyYwWcQFVw2SuKfMSNDHG
 wanId/QVWWZQU2jc5HGVF1KEEF5HIkKOpxGX0EushUXYPrjoPa/xJ+M5r1/651gy
 qM3r4vkGHODVKJa5PmGLlZDQf2VPdHZxG7Xo5zihtDVnMx/DulbTLJW3OekxrVBT
 LvbyenBU/9KFSxSbZVzUtXc4WWCZrT0rXVpgEhGkx0GxS90sWPnFjlqFALehOXpV
 wfSMCq1Cq4SzyujmPWtZXGqwk+OiWyeLS36NXS1OvDiMcirdKkNw2F95JRmvKjCB
 nOghAtyDpoO9gzPwKQM191PP+X+xkSAnWv3zmwDLXpgmYpiQETfLIQ4SUJF7nNFP
 lu7x/RoPGfV4ntP7RRQtL1GH5j7CxtR3tQZ+EQA4jjPRICuCMSw3dUoP6BStRXfT
 NyP85n45elHm9DzsgtA1w8C10qNWoDd5w3ltF7yLLz0sd+V4Tw8=
 =5uBQ
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fix from Catalin Marinas:
 "Check addr_limit in arm64 __dump_instr()"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: ensure __dump_instr() checks addr_limit
2017-11-02 12:01:26 -07:00
Mark Rutland 7a7003b1da arm64: ensure __dump_instr() checks addr_limit
It's possible for a user to deliberately trigger __dump_instr with a
chosen kernel address.

Let's avoid problems resulting from this by using get_user() rather than
__get_user(), ensuring that we don't erroneously access kernel memory.

Where we use __dump_instr() on kernel text, we already switch to
KERNEL_DS, so this shouldn't adversely affect those cases.

Fixes: 60ffc30d56 ("arm64: Exception handling")
Cc: stable@vger.kernel.org
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-11-02 18:33:08 +00:00
Xie XiuQi a92d4d1454 arm64: entry.S: move SError handling into a C function for future expansion
Today SError is taken using the inv_entry macro that ends up in
bad_mode.

SError can be used by the RAS Extensions to notify either the OS or
firmware of CPU problems, some of which may have been corrected.

To allow this handling to be added, add a do_serror() C function
that just panic()s. Add the entry.S boiler plate to save/restore the
CPU registers and unmask debug exceptions. Future patches may change
do_serror() to return if the SError Interrupt was notification of a
corrected error.

Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: Wang Xiongfeng <wangxiongfengi2@huawei.com>
[Split out of a bigger patch, added compat path, renamed, enabled debug
 exceptions]
Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 15:55:41 +00:00
James Morse b282e1ce29 arm64: entry.S: convert elX_irq
Following our 'dai' order, irqs should be processed with debug and
serror exceptions unmasked.

Add a helper to unmask these two, (and fiq for good measure).

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 15:55:41 +00:00
James Morse 746647c75a arm64: entry.S convert el0_sync
el0_sync also unmasks exceptions on a case-by-case basis, debug exceptions
are enabled, unless this was a debug exception. Irqs are unmasked for
some exception types but not for others.

el0_dbg should run with everything masked to prevent us taking a debug
exception from do_debug_exception. For the other cases we can unmask
everything. This changes the behaviour of fpsimd_{acc,exc} and el0_inv
which previously ran with irqs masked.

This patch removed the last user of enable_dbg_and_irq, remove it.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 15:55:41 +00:00
James Morse b55a5a1b0a arm64: entry.S: convert el1_sync
el1_sync unmasks exceptions on a case-by-case basis, debug exceptions
are unmasked, unless this was a debug exception. IRQs are unmasked
for instruction and data aborts only if the interupted context had
irqs unmasked.

Following our 'dai' order, el1_dbg should run with everything masked.
For the other cases we can inherit whatever we interrupted.

Add a macro inherit_daif to set daif based on the interrupted pstate.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 15:55:41 +00:00
James Morse 84d0fb1bb6 arm64: entry.S: Remove disable_dbg
enable_step_tsk is the only user of disable_dbg, which doesn't respect
our 'dai' order for exception masking. enable_step_tsk may enable
single-step, so previously needed to mask debug exceptions to prevent us
from single-stepping kernel_exit. enable_step_tsk is called at the end
of the ret_to_user loop, which has already masked all exceptions so this
is no longer needed.

Remove disable_dbg, add a comment that enable_step_tsk's caller should
have masked debug.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 15:55:41 +00:00
James Morse 8d66772e86 arm64: Mask all exceptions during kernel_exit
To take RAS Exceptions as quickly as possible we need to keep SError
unmasked as much as possible. We need to mask it during kernel_exit
as taking an error from this code will overwrite the exception-registers.

Adding a naked 'disable_daif' to kernel_exit causes a performance problem
for micro-benchmarks that do no real work, (e.g. calling getpid() in a
loop). This is because the ret_to_user loop has already masked IRQs so
that the TIF_WORK_MASK thread flags can't change underneath it, adding
disable_daif is an additional self-synchronising operation.

In the future, the RAS APEI code may need to modify the TIF_WORK_MASK
flags from an SError, in which case the ret_to_user loop must mask SError
while it examines the flags.

Disable all exceptions for return to EL1. For return to EL0 get the
ret_to_user loop to leave all exceptions masked once it has done its
work, this avoids an extra pstate-write.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 15:55:41 +00:00
James Morse 41bd5b5d22 arm64: Move the async/fiq helpers to explicitly set process context flags
Remove the local_{async,fiq}_{en,dis}able macros as they don't respect
our newly defined order and are only used to set the flags for process
context when we bring CPUs online.

Add a helper to do this. The IRQ flag varies as we want it masked on
the boot CPU until we are ready to handle interrupts.
The boot CPU unmasks SError during early boot once it can print an error
message. If we can print an error message about SError, we can do the
same for FIQ. Debug exceptions are already enabled by __cpu_setup(),
which has also configured MDSCR_EL1 to disable MDE and KDE.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 15:55:41 +00:00
James Morse 65be7a1b79 arm64: introduce an order for exceptions
Currently SError is always masked in the kernel. To support RAS exceptions
using SError on hardware with the v8.2 RAS Extensions we need to unmask
SError as much as possible.

Let's define an order for masking and unmasking exceptions. 'dai' is
memorable and effectively what we have today.

Disabling debug exceptions should cause all other exceptions to be masked.
Masking SError should mask irq, but not disable debug exceptions.
Masking irqs has no side effects for other flags. Keeping to this order
makes it easier for entry.S to know which exceptions should be unmasked.

FIQ is never expected, but we mask it when we mask debug exceptions, and
unmask it at all other times.

Given masking debug exceptions masks everything, we don't need macros
to save/restore that bit independently. Remove them and switch the last
caller over to use the daif calls.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 15:55:41 +00:00
James Morse 0fbeb31875 arm64: explicitly mask all exceptions
There are a few places where we want to mask all exceptions. Today we
do this in a piecemeal fashion, typically we expect the caller to
have masked irqs and the arch code masks debug exceptions, ignoring
serror which is probably masked.

Make it clear that 'mask all exceptions' is the intention by adding
helpers to do exactly that.

This will let us unmask SError without having to add 'oh and SError'
to these paths.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 15:55:40 +00:00
Marc Zyngier 05f3647359 Linux 4.14-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJZ0WQ6AAoJEHm+PkMAQRiGuloH/3sF4qfBhPuJo8OTf0uCtQ18
 4Ux9zZbm81df/Jjz0exAp1Jqk+TvdIS3OXPWcKilvbUBP16hQcsxFTnI/5QF+YcN
 87aNr+OCMJzOBK4suN1yhzO46NYHeIizdB0PTZVL1Zsto69Tt31D8VJmgH6oBxAw
 Isb/nAkOr31dZ9PI5UEExTIanUt6EywVb0UswA+2rNl3h1UkeasQCpMpK2n6HBhU
 kVD7sxEd/CN0MmfhB0HrySSam/BeSpOtzoU9bemOwrU2uu9+5+2rqMe7Gsdj4nX6
 3Kk+7FQNktlrhxCZIFN/+CdusOUuDd8r/75d7DnsRK5YvSb0sZzJkfD3Nba68Ms=
 =7J2+
 -----END PGP SIGNATURE-----

Merge tag 'v4.14-rc3' into irq/irqchip-4.15

Required merge to get mainline irqchip updates.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
2017-11-02 15:54:58 +00:00
Arnd Bergmann d29d30782a SoCFPGA DTS updates for v4.15, part 2
- Stratix10 platform update
   - Enable GPIO and LEDs for Stratix10 devkit
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZ9zkrAAoJEBmUBAuBoyj0uMQQALJ5ZKHHs6SXmMEM9/n1wQ9W
 LPiISwxPLTRsMNkxgLkwUH/crhkFQB5Udp+ntXNPEzoLG6eYrx7Tkr2oy09QxUbr
 N//HNoUutgNM/OelUpVhjEpCW8E3jbF7DiuNsfQshx6oIu7kxmGDpELcPErvqo3f
 ISYcScISnrETYgX+V5URUgoF7tRZllfPKirpttj5asESgaPcTg0w5eyCY4EDepWL
 W2Kpwb23OxmSL9jCXAmyT0wTKN1B/pUJi8teguqBE470GWr4KC0CS7BD945AM9DD
 Po9m2My4XrNe4I6WeV1l23xFi9s7jT31AgaYISpAZheeDJFmMmRjGZcf6MzMFPl7
 i/LqteQsty+L2G6mUjTP3uExChIp98V2CB8x6P4HJADv7zeV2fAUMTdZ/oVUB8H8
 6tti1JDsVstn63aEdqjyGE08LyseNznAVguTm7bf5c217eUegdsYyVFAD+QXiVkD
 jhW0o+AEzT4+oQuFRL0epGO1a97RNx7NBeCQEWgdEFU9wV/9v0kEpU2Senu81y5v
 8BF9T0X+OM0+REcqMNEH3VpA5IFEH2RUnETobS/SQ/7MtZqYKxe6Y1PjEGkBb/T1
 GgMpDlCZQ5zSf4yFhaRIW1cl64Rp7in/2J4/oFXr8FFsOJajT4+65rLKP7F2REsq
 CPaTYjukDCfgV5cOZZbG
 =GhNJ
 -----END PGP SIGNATURE-----

Merge tag 'socfpga_dts_for_v4.15_part2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into next/dt

Pull "SoCFPGA DTS updates for v4.15, part 2" from Dinh Nguyen:

- Stratix10 platform update
  - Enable GPIO and LEDs for Stratix10 devkit

* tag 'socfpga_dts_for_v4.15_part2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux:
  arm64: dts: stratix10: fix interrupt number for gpio1
  arm64: dts: stratix10: enable gpio and leds
  arm64: dts: stratix10: add gpio header
2017-11-02 16:37:53 +01:00
Arnd Bergmann 9855b3db51 - add 32 bit read/write support to pwrap
- add mt7622 support to pwrap
 - test build all mediatek soc drivers
 - fix compiler issues
 - clean up Kconfig description
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCAA1FiEEiUuSfQSYnG8EMsBltDliWyzx00MFAlns36cXHG1hdHRoaWFz
 LmJnZ0BnbWFpbC5jb20ACgkQtDliWyzx00Ozxg/9EL0cErlhOwxCVfLljeVlRsQV
 2qKgoFKINT/JoTd0OW3Xodzhia0Mbf7G6xtfokktEG7R4jUV6W5UoyftlRVDJjw+
 OAM1t/QoGBifcRP5XJfxVnln9GT3egcfixLJB7e1KR9HM+Yjin8pX8EK5blWJ5X5
 nJPHAuxo6/RcU+TaLhTNMyLa22OpFkVGKkaxsOh1/qKVMk9SfVe3oW2WYqXRc/3Y
 9Qt83xldIqXXkwS0p/o5GeZZq8pui29V3y2jLBzv9soKqkVAM6fO3hXSQFsEAMre
 doAhErbXwHFwV8TnVqdnoDK5Q41TNpDC215wi0ElywrMV5TbV4TtEclNMxR2xdc7
 t8pf8TNj08dzV3xiOK0RDrxmmAymxnbjqVEacdNHgByu0wSryD5Js/BDYcwmweUv
 VTCCJyTFA/vEeTdo4vEZCy+SHmiw73mBcIVmc+fgxFqw9J6BCNGFcasPS8TGNlfa
 ouGbkK+fEWep+659dKECuwYgyT4ODqpJ05hYQDMn8vArHTh5pXi/GyGlR/c+xPgY
 cHWU0XCZx80jAF80iVbXVdBU/TuKwuoyytyvAG44lmMY5BIj2Q/xoWPTwkEgJ/ZV
 JyGE04QzANP2SxTGoBHEgwOe5NvU2aulyUF18/kJh6t1los+/sKtoDzf9hGKrwB/
 VkLn2D2qpoKqNz5yvkk=
 =ZWf/
 -----END PGP SIGNATURE-----

Merge tag 'v4.14-next-soc' of https://github.com/mbgg/linux-mediatek into next/drivers

Pull "Mediatek: soc driver updates for v4.15" from Matthias Brugger:

- add 32 bit read/write support to pwrap
- add mt7622 support to pwrap
- test build all mediatek soc drivers
- fix compiler issues
- clean up Kconfig description

* tag 'v4.14-next-soc' of https://github.com/mbgg/linux-mediatek:
  soc: mediatek: pwrap: fix fatal compiler error
  soc: mediatek: pwrap: fix compiler errors
  arm64: mediatek: cleanup message for platform selection
  soc: Allow test-building of MediaTek drivers
  soc: mediatek: place Kconfig for all SoC drivers under menu
  soc: mediatek: pwrap: add support for MT7622 SoC
  soc: mediatek: pwrap: add common way for setup CS timing extenstion
  soc: mediatek: pwrap: add MediaTek MT6380 as one slave of pwrap
  soc: mediatek: pwrap: refactor pwrap_init for the various PMIC types
  soc: mediatek: pwrap: add pwrap_write32 for writing in 32-bit mode
  soc: mediatek: pwrap: add pwrap_read32 for reading in 32-bit mode
  dt-bindings: arm: mediatek: add MT7622 string to the PMIC wrapper doc
  ARM: mediatek: Cocci spatch "of_table"
  soc: mediatek: pwrap: fixup warnings from coding style
2017-11-02 16:29:56 +01:00
Yisheng Xie c10f0d06ad arm64: suspend: remove useless included file
After commit 9e8e865bbe ("arm64: unify idmap removal"), we no need to
flush tlb in suspend.c, so the included file tlbflush.h can be removed.

Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 14:37:01 +00:00
Chaotian Jing 689362b3c9 arm64: dts: mt8173: remove "mediatek, mt8135-mmc" from mmc nodes
devicetree bindings has been updated to support multi-platforms,
so that each platform has its owns compatible name.
And, this compatible name may used in driver to distinguish with
other platform.

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
2017-11-02 15:19:59 +01:00
Will Deacon 80b6eb04b5 arm64: Don't walk page table for user faults in do_mem_abort
Commit 42dbf54e88 ("arm64: consistently log ESR and page table")
dumps page table entries for user faults hitting do_bad entries in the
fault handler table. Whilst this shouldn't really happen in practice,
it's not beyond the realms of possibility if e.g. running an old kernel
on a new CPU.

Generally, we want to avoid exposing physical addresses under the control
of userspace (see commit bf396c09c2 ("arm64: mm: don't print out page
table entries on EL0 faults")), so walk the page tables only on exceptions
from EL1.

Reported-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-11-02 13:52:48 +00:00
Greg Kroah-Hartman e2be04c7f9 License cleanup: add SPDX license identifier to uapi header files with a license
Many user space API headers have licensing information, which is either
incomplete, badly formatted or just a shorthand for referring to the
license under which the file is supposed to be.  This makes it hard for
compliance tools to determine the correct license.

Update these files with an SPDX license identifier.  The identifier was
chosen based on the license information in the file.

GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
identifier with the added 'WITH Linux-syscall-note' exception, which is
the officially assigned exception identifier for the kernel syscall
exception:

   NOTE! This copyright does *not* cover user programs that use kernel
   services by normal system calls - this is merely considered normal use
   of the kernel, and does *not* fall under the heading of "derived work".

This exception makes it possible to include GPL headers into non GPL
code, without confusing license compliance tools.

Headers which have either explicit dual licensing or are just licensed
under a non GPL license are updated with the corresponding SPDX
identifier and the GPLv2 with syscall exception identifier.  The format
is:
        ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)

SPDX license identifiers are a legally binding shorthand, which can be
used instead of the full boiler plate text.  The update does not remove
existing license information as this has to be done on a case by case
basis and the copyright holders might have to be consulted. This will
happen in a separate step.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.  See the previous patch in this series for the
methodology of how this patch was researched.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:20:11 +01:00
Greg Kroah-Hartman 6f52b16c5b License cleanup: add SPDX license identifier to uapi header files with no license
Many user space API headers are missing licensing information, which
makes it hard for compliance tools to determine the correct license.

By default are files without license information under the default
license of the kernel, which is GPLV2.  Marking them GPLV2 would exclude
them from being included in non GPLV2 code, which is obviously not
intended. The user space API headers fall under the syscall exception
which is in the kernels COPYING file:

   NOTE! This copyright does *not* cover user programs that use kernel
   services by normal system calls - this is merely considered normal use
   of the kernel, and does *not* fall under the heading of "derived work".

otherwise syscall usage would not be possible.

Update the files which contain no license information with an SPDX
license identifier.  The chosen identifier is 'GPL-2.0 WITH
Linux-syscall-note' which is the officially assigned identifier for the
Linux syscall exception.  SPDX license identifiers are a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.  See the previous patch in this series for the
methodology of how this patch was researched.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:19:54 +01:00
Greg Kroah-Hartman b24413180f License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.

By default all files without license information are under the default
license of the kernel, which is GPL version 2.

Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier.  The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.

How this work was done:

Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
 - file had no licensing information it it.
 - file was a */uapi/* one with no licensing information in it,
 - file was a */uapi/* one with existing licensing information,

Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.

The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne.  Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.

The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed.  Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.

Criteria used to select files for SPDX license identifier tagging was:
 - Files considered eligible had to be source code files.
 - Make and config files were included as candidates if they contained >5
   lines of source
 - File already had some variant of a license header in it (even if <5
   lines).

All documentation files were explicitly excluded.

The following heuristics were used to determine which SPDX license
identifiers to apply.

 - when both scanners couldn't find any license traces, file was
   considered to have no license information in it, and the top level
   COPYING file license applied.

   For non */uapi/* files that summary was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0                                              11139

   and resulted in the first patch in this series.

   If that file was a */uapi/* path one, it was "GPL-2.0 WITH
   Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0 WITH Linux-syscall-note                        930

   and resulted in the second patch in this series.

 - if a file had some form of licensing information in it, and was one
   of the */uapi/* ones, it was denoted with the Linux-syscall-note if
   any GPL family license was found in the file or had no licensing in
   it (per prior point).  Results summary:

   SPDX license identifier                            # files
   ---------------------------------------------------|------
   GPL-2.0 WITH Linux-syscall-note                       270
   GPL-2.0+ WITH Linux-syscall-note                      169
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
   LGPL-2.1+ WITH Linux-syscall-note                      15
   GPL-1.0+ WITH Linux-syscall-note                       14
   ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
   LGPL-2.0+ WITH Linux-syscall-note                       4
   LGPL-2.1 WITH Linux-syscall-note                        3
   ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
   ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1

   and that resulted in the third patch in this series.

 - when the two scanners agreed on the detected license(s), that became
   the concluded license(s).

 - when there was disagreement between the two scanners (one detected a
   license but the other didn't, or they both detected different
   licenses) a manual inspection of the file occurred.

 - In most cases a manual inspection of the information in the file
   resulted in a clear resolution of the license that should apply (and
   which scanner probably needed to revisit its heuristics).

 - When it was not immediately clear, the license identifier was
   confirmed with lawyers working with the Linux Foundation.

 - If there was any question as to the appropriate license identifier,
   the file was flagged for further research and to be revisited later
   in time.

In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.

Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights.  The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.

Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.

In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.

Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
 - a full scancode scan run, collecting the matched texts, detected
   license ids and scores
 - reviewing anything where there was a license detected (about 500+
   files) to ensure that the applied SPDX license was correct
 - reviewing anything where there was no detection but the patch license
   was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
   SPDX license was correct

This produced a worksheet with 20 files needing minor correction.  This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.

These .csv files were then reviewed by Greg.  Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected.  This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.)  Finally Greg ran the script using the .csv files to
generate the patches.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:10:55 +01:00
Corentin Labbe 44a94c7ef9 arm64: dts: allwinner: H5: Restore EMAC changes
The original dwmac-sun8i DT bindings have some issue on how to handle
integrated PHY and was reverted in last RC of 4.13.
But now we have a solution so we need to get back that was reverted.

This patch restore arm64 DT about dwmac-sun8i for H5
This reverts a part of commit 87e1f5e8bb ("arm64: dts: allwinner: Revert EMAC changes")

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-11-02 09:02:14 +01:00
Corentin Labbe 16416084e0 arm64: dts: allwinner: add snps,dwmac-mdio compatible to emac/mdio
stmmac bindings docs said that its mdio node must have
compatible = "snps,dwmac-mdio";
Since dwmac-sun8i does not have any good reasons to not doing it, all
their MDIO node must have it.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-31 14:32:08 +01:00
Corentin Labbe 94f4428867 arm64: dts: allwinner: A64: Restore EMAC changes
The original dwmac-sun8i DT bindings have some issue on how to handle
integrated PHY and was reverted in last RC of 4.13.
But now we have a solution so we need to get back that was reverted.

This patch restore arm64 DT about dwmac-sun8i for A64
This reverts commit 87e1f5e8bb ("arm64: dts: allwinner: Revert EMAC changes")

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-31 14:32:06 +01:00
Mark Rutland c80ed088a5 arm64: vdso: fix clock_getres for 4GiB-aligned res
The vdso tries to check for a NULL res pointer in __kernel_clock_getres,
but only checks the lower 32 bits as is uses CBZ on the W register the
res pointer is held in.

Thus, if the res pointer happened to be aligned to a 4GiB boundary, we'd
spuriously skip storing the timespec to it, while returning a zero error code
to the caller.

Prevent this by checking the whole pointer, using CBZ on the X register
the res pointer is held in.

Fixes: 9031fefde6 ("arm64: VDSO support")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reported-by: Andrew Pinski <apinski@cavium.com>
Reported-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-31 09:49:33 +00:00
Miquel Raynal c3c08c5d32 arm64: dts: marvell: armada-3720-espressobin: fill UART nodes
Fill ESPRESSObin uart0 node with pinctrl information like in the
Armada-3720-DB device tree (which uses the same node).

Also explain how to enable the second UART port available on the
headers. This second port is not enabled by default because both
headers are dedicated to expose general purpose pins and remapping
some of them to use the second UART would break existing users.

Suggested-by: László ÁSHIN <laszlo@ashin.hu>
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-10-30 15:56:34 +01:00
Miquel Raynal 71e278ce81 arm64: dts: marvell: armada-3720-db: enable second UART port
Enable Armada-3720-DB second UART port by adding the corresponding
device tree node in the board DTS and enabling it.

Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-10-30 15:56:28 +01:00
Miquel Raynal 7c48dc201b arm64: dts: marvell: armada-37xx: add second UART port
Add a node in Armada 37xx DTSI file for the second UART, with a
different compatible due to its extended IP which has some
differences with the first UART already in place.

Make use of this commit to also fully describe the first port and
use the same clear and named interrupt bindings for both ports.

The standard UART (UART0) uses level-interrupts while the extended
UART (UART1) uses edge-triggered interrupts.

Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-10-30 15:56:22 +01:00
Miquel Raynal 2ff0d0b5bb arm64: dts: marvell: armada-37xx: add UART clock
Add the missing clock property to armada-3700 UART node.

This clock will be used to derive the prescaler value to comply with
the requested baudrate.

Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2017-10-30 15:56:16 +01:00
Nick Desaulniers fd9dde6abc arm64: prevent regressions in compressed kernel image size when upgrading to binutils 2.27
Upon upgrading to binutils 2.27, we found that our lz4 and gzip
compressed kernel images were significantly larger, resulting is 10ms
boot time regressions.

As noted by Rahul:
"aarch64 binaries uses RELA relocations, where each relocation entry
includes an addend value. This is similar to x86_64.  On x86_64, the
addend values are also stored at the relocation offset for relative
relocations. This is an optimization: in the case where code does not
need to be relocated, the loader can simply skip processing relative
relocations.  In binutils-2.25, both bfd and gold linkers did this for
x86_64, but only the gold linker did this for aarch64.  The kernel build
here is using the bfd linker, which stored zeroes at the relocation
offsets for relative relocations.  Since a set of zeroes compresses
better than a set of non-zero addend values, this behavior was resulting
in much better lz4 compression.

The bfd linker in binutils-2.27 is now storing the actual addend values
at the relocation offsets. The behavior is now consistent with what it
does for x86_64 and what gold linker does for both architectures.  The
change happened in this upstream commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=1f56df9d0d5ad89806c24e71f296576d82344613
Since a bunch of zeroes got replaced by non-zero addend values, we see
the side effect of lz4 compressed image being a bit bigger.

To get the old behavior from the bfd linker, "--no-apply-dynamic-relocs"
flag can be used:
$ LDFLAGS="--no-apply-dynamic-relocs" make
With this flag, the compressed image size is back to what it was with
binutils-2.25.

If the kernel is using ASLR, there aren't additional runtime costs to
--no-apply-dynamic-relocs, as the relocations will need to be applied
again anyway after the kernel is relocated to a random address.

If the kernel is not using ASLR, then presumably the current default
behavior of the linker is better. Since the static linker performed the
dynamic relocs, and the kernel is not moved to a different address at
load time, it can skip applying the relocations all over again."

Some measurements:

$ ld -v
GNU ld (binutils-2.25-f3d35cf6) 2.25.51.20141117
                    ^
$ ls -l vmlinux
-rwxr-x--- 1 ndesaulniers eng 300652760 Oct 26 11:57 vmlinux
$ ls -l Image.lz4-dtb
-rw-r----- 1 ndesaulniers eng 16932627 Oct 26 11:57 Image.lz4-dtb

$ ld -v
GNU ld (binutils-2.27-53dd00a1) 2.27.0.20170315
                    ^
pre patch:
$ ls -l vmlinux
-rwxr-x--- 1 ndesaulniers eng 300376208 Oct 26 11:43 vmlinux
$ ls -l Image.lz4-dtb
-rw-r----- 1 ndesaulniers eng 18159474 Oct 26 11:43 Image.lz4-dtb

post patch:
$ ls -l vmlinux
-rwxr-x--- 1 ndesaulniers eng 300376208 Oct 26 12:06 vmlinux
$ ls -l Image.lz4-dtb
-rw-r----- 1 ndesaulniers eng 16932466 Oct 26 12:06 Image.lz4-dtb

By Siqi's measurement w/ gzip:
binutils 2.27 with this patch (with --no-apply-dynamic-relocs):
Image 41535488
Image.gz 13404067

binutils 2.27 without this patch (without --no-apply-dynamic-relocs):
Image 41535488
Image.gz 14125516

Any compression scheme should be able to get better results from the
longer runs of zeros, not just GZIP and LZ4.

10ms boot time savings isn't anything to get excited about, but users of
arm64+compression+bfd-2.27 should not have to pay a penalty for no
runtime improvement.

Reported-by: Gopinath Elanchezhian <gelanchezhian@google.com>
Reported-by: Sindhuri Pentyala <spentyala@google.com>
Reported-by: Wei Wang <wvw@google.com>
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Suggested-by: Rahul Chaudhry <rahulchaudhry@google.com>
Suggested-by: Siqi Lin <siqilin@google.com>
Suggested-by: Stephen Hines <srhines@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[will: added comment to Makefile]
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-30 13:45:12 +00:00
Masahiro Yamada d0e470e0db arm64: defconfig: enable CONFIG_GPIO_UNIPHIER
Enable the GPIO controller driver used for UniPhier SoC family.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2017-10-30 14:41:54 +01:00
Arnd Bergmann 18ea0db308 Amlogic 64-bit DT updates for v4.15, round 2
- add support for new GPIO IRQ driver
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEe4dGDhaSf6n1v/EMWTcYmtP7xmUFAln2BpMACgkQWTcYmtP7
 xmV5og//YkRwzS21agdQu3ZYCh/VP5i1CUhXZkp520DSLeY60LZfQNnz1lFvFHjN
 baSW2Gypy9rBjcRr4efl79Qb8v10JvLytUt7LYLHCFaU/u5AeEPFNLc0E4JzKtIB
 n8x99sqoY0NsVBfN4yVLqNmQjUZw87+I0nit/BcOAoHdOTnxtK1GBgcVF3ovRwet
 T/opxgKQeR2rp1NS5kjye9NYt/HK9WCE9e3eoO+h0OjLtlVu9b2M2/XYz2yMKlmj
 T09SWZx9gmqF47B3mXb0/f5KUaYNnnoxVGx8F55oVQhtWZcTt9G67CvBnAdU26Lm
 ftw0uwOF1Rjc4heybJkePm4k5pJTtXtgmCoEQl79/L1v+dvC1d+oPPvExd7Zp5rU
 qiT5SKOIeCP7Bclzbn01mszMFefxmtJe2zyrbwjL/Ntvo/1DlifI70Rjde7rY+Mw
 pWtgONhRjr8Q5XvFXNKVXqeDlLBM8Qv+YOqZ2weMqdBDsbr1LFIeCZOhRNu3O1qR
 bNQ+soVfuHL7ei6lks+cbBApNRDN+J0YIx2Y6alJ/0kjpI2aNWvGPfgdmPq5w4Uw
 rOIRgm19Et5loHbdI60A1VfKNlu+WkrSkESj4h6bQ2pwt1tWso7RrlpfCXROcCbm
 2JicBHIe1665E+FCRZOCPXdPx73SRBIPCVbNL3T1oomaf3prqrE=
 =vVV3
 -----END PGP SIGNATURE-----

Merge tag 'amlogic-dt64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/dt

Pull "Amlogic 64-bit DT updates for v4.15, round 2" from Kevin Hilman:
- add support for new GPIO IRQ driver

* tag 'amlogic-dt64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic:
  ARM64: dts: meson-gx: add external PHY interrupt on some platforms
  ARM64: dts: meson-gx: add gpio interrupt controller
  ARM64: meson: enable MESON_IRQ_GPIO in Kconfig
  ARM64: dts: meson-gxbb-odroidc2: fix usb1 power supply
2017-10-30 14:40:14 +01:00
Arnd Bergmann e45cba78c6 Freescale arm64 device tree updates for 4.15:
- Add GICv3 ITS node and PCIe devcies for LS1088A support.
  - Enable PCIe support for LS2088A SoC.
  - Add OP-TEE support for various Layerscape SoCs, LS1012A, LS1043A,
    LS1046A, LS1088A and LS208XA.
  - Update DPAA QBMan nodes to use constant defines in the interrupt
    description.
  - Add DSPI device to support SPI-NOR on LS1012A based boards.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJZ7y0kAAoJEFBXWFqHsHzOE70H/iAI1WmTWW1kuc2d7w1pCZrP
 m3aBdavPb6N2XT43HUDo5yuAVl84AvmoHWkOXeiAEgSTwuGCMcAT90P3v+MJQG5P
 xFCuqEAYfKb4BwMNs3oBbgdWBErxOpqFGd58vvXbEHzGv6DCnJRD6euhVNMosTKv
 QI62vZkbD3sR1aUcC/dLG0hCFRb7+fscL+sgtU0vnF5nWKQLXQ/eGCDhhh4mmY/5
 sjgeCqhYeIBrhpoOLm8qK9CkRnf7nPZwSiTFhG1o0nHDqbmzTRU5zQrAEDGB9Ukg
 pWDtHyIEkrmnzOucIbKVpFue7IldkR7WN2rslpkHhtDaK1gIYnhjO26toU7/f2U=
 =T0d9
 -----END PGP SIGNATURE-----

Merge tag 'imx-dt64-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/dt

Pull "Freescale arm64 device tree updates for 4.15" from Shawn Guo:

 - Add GICv3 ITS node and PCIe devcies for LS1088A support.
 - Enable PCIe support for LS2088A SoC.
 - Add OP-TEE support for various Layerscape SoCs, LS1012A, LS1043A,
   LS1046A, LS1088A and LS208XA.
 - Update DPAA QBMan nodes to use constant defines in the interrupt
   description.
 - Add DSPI device to support SPI-NOR on LS1012A based boards.

* tag 'imx-dt64-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  arm64: dts: update the DPAA QBMan nodes
  arm64: dts: ls1088a: add PCIe controller DT nodes
  arm64: dts: ls1088a: add gicv3 ITS DT node
  arm64: dts: ls2088a: add pcie support
  arm64: dts: ls: Add optee node
  dt-bindings: mtd: add sst25wf040b and en25s64 to sip-nor list
  dt-bindings: spi: Add fsl,ls1012a-dspi compatible string
  arm64: dts: ls1012a: add the DTS node for DSPI support
2017-10-30 14:38:56 +01:00
Arnd Bergmann 25b8384898 - mt2712: add cpuidle support
-----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCAA1FiEEiUuSfQSYnG8EMsBltDliWyzx00MFAlns4G8XHG1hdHRoaWFz
 LmJnZ0BnbWFpbC5jb20ACgkQtDliWyzx00Mv1BAAq9iFGeVlSTia9VXbd8v4/BQW
 KGxGNt7UNMmk8tlLDNSO4pG4ACkVVTL50t+PNYOCTi7+aTbbeBi6/zXBXvWdwZ1d
 XRmuLwuibpr+ozskVfpV6Ussr0jSV2J3z0DsGIyWBCjlVIqUQM/QZ/4E2P6D8aJn
 NmwI1vx9FV3VQXKMwYuiXmRrSUvJDB26arjl4ryJPLA7OV6K7rS++4U7i88LZLe7
 iIZ/6jqoNqJAnJVgowjVbCADr5yzlGp7q3CD0n0Y3QhMBg8ShVtMAd2NqNU5rFXJ
 vPMIKJccAzxtGieIgBAZjhpm8hQUZFhaEggx5BdQXQriZwK7t56mtaQy4TdhRZwu
 6BT9+9aH1TIpvC7OQtP2Tfg1UHqCfJUMPDAnHyeqUg737aNaiv5VRQkPLjtUZ84B
 6+1zNiZisX0bGD/VW1mxzzssgxbiYetSKX0KiNcHKa84osMwF94BLdCoaMz6VbMT
 i5acAUlhWTI8DHBqGa6kCde97A5LCJiLc5q6B5Ig3CaY48MqIC4vr3CAoOg2YpBZ
 6PsUsgb1PhpkNXheMB7jwyMG6wr7xE0qLSurcXfR2zbOg9GTB0FD8Sf1DGrholv+
 d92nLvyfIWY3y+CwKQtsIkMtQYH4da+izUsEeMmBH9ChyDimE7S3j5dyBaU7XemO
 KvlYHlWjiWThTz7gHAU=
 =D5oL
 -----END PGP SIGNATURE-----

Merge tag 'v4.14-next-dts64' of https://github.com/mbgg/linux-mediatek into next/dt

Pull "Mediatek: 64-bit DT update for v4.15" from Matthias Brugger:

- mt2712: add cpuidle support

* tag 'v4.14-next-dts64' of https://github.com/mbgg/linux-mediatek:
  arm64: dts: mediatek: Add cpuidle support for MT2712
2017-10-30 14:37:50 +01:00
Arnd Bergmann a5494aed0d Amlogic 64-bit platforms: DT updates for v4.15
- new SoC support: A113D
 - new boards: Tronsmart Vega S96, Khadas vim2
 - reserved memory fixups
 - gpio-names cleanups
 - MMC cleanups, enable high-speed modes
 - misc cleanups
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEe4dGDhaSf6n1v/EMWTcYmtP7xmUFAlnsbzwACgkQWTcYmtP7
 xmWwSw/+LBr7iNv9ugxgfShcd8ugecjJm7eBMD9zKMJaHw+1AUxhexZsCyUQVjDy
 UjAeTTMsugTzIEvQoSI97h82K3uE7/3zqU+UaWziWILegb8b9VnYVzjHUoodNE9Z
 /9gbIb7P55rlJ1BN0zzXcsvEjvC7TrfklgXBfIBK0Ob2zqDHGpiWOFnrQiuZNweA
 tgSemkT4ELZYAksXszFhU1o87QW5IRqXwNX5ech7p3UpUTdDnY1MPNbLRRh9tVWi
 G7EtLJfbSPEHczBBtfcxQkagpk2TjVStMpYgrAaa3eMG5Ervdh3QrdGp8B7bObPY
 rZgYAU1x7q3PBWm07IpnlnprMC3RHP7wdirXVKMNW1DbYqRBoyGeTc9pF+DgiMNP
 wcxsbQgotSZbeke6ODPaP2xEtIqWCgTee/4P6zjOYfsXxphtVkdfLGvICwpximUj
 CqbXZSsn+pg4g1IsGU3EcVLbFzq2A+uv5hkV18b9ouDIN0mm7+/mpyaLeQ8wrl2U
 5f+dCbrU4ypYosnOQIZKla8kHwutWmur6a9+VBPSEVWMXzdUUmBUicxgUYi5DMLZ
 SLXBklAZ74YqnFNZvrNaLvaD2GR5COU8NpW9S3PBxsUqXa57jMUAAOzbeLLvRB87
 57S3pR7f+thG93pe8JFfP/ciVcnAGn9oQkV5LU8k6lTd7gaxtEw=
 =bJwM
 -----END PGP SIGNATURE-----

Merge tag 'amlogic-dt64' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/dt

Pull "Amlogic 64-bit platforms: DT updates for v4.15" from Kevin Hilman:

- new SoC support: A113D
- new boards: Tronsmart Vega S96, Khadas vim2
- reserved memory fixups
- gpio-names cleanups
- MMC cleanups, enable high-speed modes
- misc cleanups

* tag 'amlogic-dt64' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic:
  arm64: dts: meson-axg: add initial A113D SoC DT support
  dt-bindings: arm: amlogic: Add Meson AXG binding
  ARM64: dts: meson-gx: remove unnecessary uart compatible
  ARM64: dts: meson-gx: remove unnecessary clocks properties
  ARM64: dts: meson-gxl: Add alternate ARM Trusted Firmware reserved memory zone
  ARM64: dts: meson-gxm: enable HS400 on the vim2
  ARM64: dts: meson-gxbb-nexbox-a95x: Enable USB Nodes
  dt-bindings: arm: amlogic: Add Tronsmart Vega S96 binding
  ARM64: dts: meson-gxm: Add Vega S96 board
  ARM64: dts: meson-gxm: Add support for Khadas VIM2
  ARM64: dts: meson-gxl: Take eMMC data strobe out of eMMC pins
  ARM64: dts: meson-gxl: adjust libretech-cc gpio-line-names
  ARM64: dts: meson-gxl: adjust kvim gpio-line-names
  ARM64: dts: meson-gxbb: adjust odroid-c2 gpio-line-names
  ARM64: dts: meson-gxbb: adjust nanopi-k2 gpio-line-names
  ARM64: dts: meson-gx: adjust gpio-ranges for TEST_N
  ARM64: dts: meson-gx: remove gpio offset
  ARM: dts: meson8: remove gpio offset
  ARM64: dts: meson-gxl-libretech-cc: enable internal phy leds
  ARM64: dts: meson-gxl-libretech-cc: enable saradc
2017-10-30 14:37:17 +01:00
Arnd Bergmann b295477e00 mvebu dt64 for 4.15 (part 1)
On Armada 7K/8k:
 - Improve network support at SoC and board level
 - Enable watchdog
 - Add UART muxing
 - On 7040 DB: add CD SDIO and NAND support
 - On 8040 DB: add PCIE more ports and SPI1
 
 On Armada 37xx:
  - Fix UART register size
  - Add vmmc regulator for SD on 3720 DB
 -----BEGIN PGP SIGNATURE-----
 
 iIEEABECAEEWIQQYqXDMF3cvSLY+g9cLBhiOFHI71QUCWeoPnCMcZ3JlZ29yeS5j
 bGVtZW50QGZyZWUtZWxlY3Ryb25zLmNvbQAKCRALBhiOFHI71eWeAJ4yqhFToGh9
 bLvyANmN33Lp0kYfEwCeKTJv715mvxAfJMYUMX7CUmgEAOs=
 =9sls
 -----END PGP SIGNATURE-----

Merge tag 'mvebu-dt64-4.15-1' of git://git.infradead.org/linux-mvebu into next/dt

Pull "mvebu dt64 for 4.15 (part 1)" from Gregory CLEMENT:

On Armada 7K/8k:
- Improve network support at SoC and board level
- Enable watchdog
- Add UART muxing
- On 7040 DB: add CD SDIO and NAND support
- On 8040 DB: add PCIE more ports and SPI1

On Armada 37xx:
 - Fix UART register size
 - Add vmmc regulator for SD on 3720 DB

* tag 'mvebu-dt64-4.15-1' of git://git.infradead.org/linux-mvebu:
  arm64: dts: marvell: 7040-db: Add the carrier detect pin for SD card on CP
  arm64: dts: marvell: 7040-db: Document the gpio expander
  arm64: dts: marvell: enable additional PCIe ports on Armada 8040 DB
  arm64: dts: marvell: add NAND support on the 7040-DB board
  arm64: dts: marvell: Enable Armada-8040-DB CPS SPI1
  arm64: dts: marvell: 8040-db: enable the SFP ports
  arm64: dts: marvell: 7040-db: enable the SFP port
  arm64: dts: marvell: 7040-db: add comphy reference to Ethernet port
  arm64: dts: marvell: mcbin: add comphy references to Ethernet ports
  arm64: dts: marvell: 37xx: remove empty line
  arm64: dts: marvell: cp110: add PPv2 port interrupts
  arm64: dts: marvell: add comphy nodes on cp110 master and slave
  arm64: dts: marvell: extend the cp110 syscon register area length
  arm64: dts: marvell: enable AP806 watchdog
  arm64: dts: marvell: Fix A37xx UART0 register size
  arm64: dts: marvell: armada-3720-db: Add vmmc regulator for SD slot
  arm64: dts: marvell: add UART muxing on Armada 7K/8K
2017-10-30 14:32:45 +01:00
Arnd Bergmann a2c614a7db arm64: tegra: Device tree changes for v4.15-rc1
Enables host1x, VIC, PCIe and the BPMP thermal sensor on Tegra186.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlnp4kkTHHRyZWRpbmdA
 bnZpZGlhLmNvbQAKCRDdI6zXfz6zoRzED/0UbIFfK3R8EreqoPDdxqBZN471PcMo
 zAiYoSZ3WOHhbsexhpgJRUiHUpW4C0RnguG6x1QXN5Gt0EuIy4ydeYjLX6r1jcZi
 74ZxGgHvOipCj83CspGV0oGcys4c3A/KpSLBH/+7oy9YUXQ/xo2g9kj0941wP22a
 4kCiVOSjEXOP7m25GJ4MistFqkIOdkEEWBUGghsCxYFoZEGngKgG0PKEhb4ta/BQ
 i8i6h9NmzF1LyAA2Vka3mn3XmvF+EM58L4eUt3deNlMqW/mIc5wcXJwzXKFbyTxp
 c7V2V0EcU2sANg6/MjAf33VQLg5TkM04REJE7MBZ+FrTLxSn1hA4unLoeWN5Q6Hf
 pRmjvQhH49Dl3rX2cNMGGAHfK4oRsWjfX5dlNBA1ub0HlBlClNRRf87A4rkg12tx
 RIdFGF9B8sjddAUItXdPLzfNqaLkfk9fePS2bRfqChMlPYvPynQrUe3sVKhkjPDm
 O8NevnC+eYYeNWNKRp4RM19RW5/McZup03LQLN62BehQlUxb3Tpe3EIJOdbHdMYb
 5m5cSj9YERk8boS1LOUG3orN/LAAR/G1uU2T12w7+PN8xagN+Uic6JMMF34/87j+
 LdYGEaWV/6tr8J1ull6wFTlsNPmuGJ8IxS5y6o5qn9oZOXK2UVoymluC5kFkx+hB
 oEcNdBIxSM679Q==
 =AvTC
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-4.15-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/dt

Pull "arm64: tegra: Device tree changes for v4.15-rc1" from Thierry Reding:

Enables host1x, VIC, PCIe and the BPMP thermal sensor on Tegra186.

* tag 'tegra-for-4.15-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  arm64: tegra: Add BPMP thermal sensor to Tegra186
  arm64: tegra: Enable PCIe on Jetson TX2
  arm64: tegra: Add PCIe node for Tegra186
  arm64: tegra: Add VIC on Tegra186
  arm64: tegra: Add host1x on Tegra186
  arm64: tegra: Add #power-domain-cells for BPMP
2017-10-30 14:27:50 +01:00
Arnd Bergmann 918c822374 Second Round of Renesas ARM64 Based SoC DT Updates for v4.15
* r8a7795 (H3) and r8a7796 (M3-W) SoCs
   - Use R-Car Gen 3 fallback compat string for GPIO
 
     Simon Horman says "Use newly added R-Car GPIO Gen 1, 2 and 3 fallback
     compat strings in peace of now deprecated non-generation specific R-Car
     GPIO fallback compat string in the DT of Renesas ARM and arm64 based
     SoCs.
 
 * r8a7795 (H3) and r8a7796 (M3-W) Salvator boards
   - Add dr_mode property for USB2.0 channel 0
 
     Shimoda-san says "Since Salvator-X[S] have a USB2.0 dual-role channel
     (CN9), this patch
     adds dr_mode property for USB2.0 channel 0 (EHCI/OHCI and HS-USB)
     as "otg".
 
     Using dual-role channel (or not) is related to the type of USB receptor
     on board specification. So, I added the property into the
     salvator-common.dtsi."
 
   - Add pfc node for USB3.0 channel 0
 
     Shimoda-san says "Since a R-Car Gen3 bootloader enables the PFC of
     USB3.0 channel 0, the USB3.0 host controller works without this setting
     on the kernel.  But, this setting should have salvator-common.dtsi. So,
     this patch adds the pfc node for USB3.0 channel 0."
 
 * r8a7795 (H3) and r8a7796 (M3-W) Salvator and ULCB boards
   - Correct audio_clkout
 
     Morimoto-san says ""audio_clkout" is dummy clock of <&rcar_sound 0> to
     avoid clock loop which invites probe conflct. Thus <&rcar_sound 0> and
     "audio_clkout" should be same value."
 
 * r8a7795 (H3) and r8a7796 (M3-W) Salvator and ULCB, and
   r8a77995 (D3) Draak boards
   - Drop "avb_phy_int" from avb_pins
 
     Shimoda-san says "Since the Ethernet AVB driver doesn't support
     AVB_PHY_INT handling and it will be handled by a phy driver as a gpio
     pin, this patch removes the "avb_phy_int" from the avb_pins node."
 
 * r8a77995 (D3) Draak board
   - Enable PWM channels
 
     Shimoda-san says "Each channel connects to LTC2644 for brightness
     control."
 
 * r8a77970 (V3M) Eagle and ULCB Kingfisher boards
   - Add initial device tree support
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4nzZofWswv9L/nKF189kaWo3T74FAlnpzqwACgkQ189kaWo3
 T75X7w//Xf29SJUGRAZ8fYnA5b8r+QHvJX/79eI5Z+Nq12UGdPZXS6yhBsfcptD4
 EGY9E6u7O+wJryhZJT50t7Dr19WzGgLDfsqBas9wXxaniAh7sLn4fIvcrwrDf86a
 LJT9JWinjEbOqO4Crc4GEx4i2r/kZVIwL0HOA5o64JclW33NwCAzo7D/Z3uDBrXa
 H16G8webhjCLa4vhdqPmYJO9OlKwtnLcx6XA855do2uUbRF1O7chekyOXFKccOk+
 FvBH96hH7dEBmE9GwrjTiiFOfIDyU7kzDVKwz+UurUC+zrqfc8N12OdttodrN8+i
 iOMGVOMxbAE1eYbvTkxCT7OB0r2GYnFqb5JkNT/3PiEstf3YrxGm15drZYf10d/E
 mgv6ifKgq02cTVjQF3JF7jAcMaHbB18dde86fe5DspAH32SyFzGnUc8I3LwLWScf
 pxIPSycI5rrPwKYbITCPOLbem3nS1PPvOB/r6B+6E/wyrU7OOe0YCr4GsJLhzhrH
 IPNNt0DZa+K7crWbqQetv4+s8Jf61nXp2iUjuKP64k+YDKkM5CcPSsF6PnbiRjXn
 Rt8k2wpNS72Cvq/D+zs9l8ymX1Z7goe66fmYDfCxpd4SehyYL2QAxL6K2eOCOv1C
 MZtbJ18zyUXmsNZvVd/dW4g6W5zOn/l9VpD9oxREo5bFXR7nR/Q=
 =BmC8
 -----END PGP SIGNATURE-----

Merge tag 'renesas-arm64-dt2-for-v4.15' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt

Pull "Second Round of Renesas ARM64 Based SoC DT Updates for v4.15" from Simon Horman:

* r8a7795 (H3) and r8a7796 (M3-W) SoCs
  - Use R-Car Gen 3 fallback compat string for GPIO

    Simon Horman says "Use newly added R-Car GPIO Gen 1, 2 and 3 fallback
    compat strings in peace of now deprecated non-generation specific R-Car
    GPIO fallback compat string in the DT of Renesas ARM and arm64 based
    SoCs.

* r8a7795 (H3) and r8a7796 (M3-W) Salvator boards
  - Add dr_mode property for USB2.0 channel 0

    Shimoda-san says "Since Salvator-X[S] have a USB2.0 dual-role channel
    (CN9), this patch
    adds dr_mode property for USB2.0 channel 0 (EHCI/OHCI and HS-USB)
    as "otg".

    Using dual-role channel (or not) is related to the type of USB receptor
    on board specification. So, I added the property into the
    salvator-common.dtsi."

  - Add pfc node for USB3.0 channel 0

    Shimoda-san says "Since a R-Car Gen3 bootloader enables the PFC of
    USB3.0 channel 0, the USB3.0 host controller works without this setting
    on the kernel.  But, this setting should have salvator-common.dtsi. So,
    this patch adds the pfc node for USB3.0 channel 0."

* r8a7795 (H3) and r8a7796 (M3-W) Salvator and ULCB boards
  - Correct audio_clkout

    Morimoto-san says ""audio_clkout" is dummy clock of <&rcar_sound 0> to
    avoid clock loop which invites probe conflct. Thus <&rcar_sound 0> and
    "audio_clkout" should be same value."

* r8a7795 (H3) and r8a7796 (M3-W) Salvator and ULCB, and
  r8a77995 (D3) Draak boards
  - Drop "avb_phy_int" from avb_pins

    Shimoda-san says "Since the Ethernet AVB driver doesn't support
    AVB_PHY_INT handling and it will be handled by a phy driver as a gpio
    pin, this patch removes the "avb_phy_int" from the avb_pins node."

* r8a77995 (D3) Draak board
  - Enable PWM channels

    Shimoda-san says "Each channel connects to LTC2644 for brightness
    control."

* r8a77970 (V3M) Eagle and ULCB Kingfisher boards
  - Add initial device tree support

* tag 'renesas-arm64-dt2-for-v4.15' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (31 commits)
  arm64: dts: renesas: salvator-common: add dr_mode property for USB2.0 channel 0
  arm64: dts: r8a7796: Use R-Car GPIO Gen3 fallback compat string
  arm64: dts: r8a7795: Use R-Car GPIO Gen3 fallback compat string
  arm64: renesas: ulcb: fixup audio_clkout
  arm64: renesas: salvator-common: fixup audio_clkout
  arm64: dts: renesas: eagle: add EtherAVB support
  arm64: dts: r8a77995: Add INTC-EX device node
  arm64: dts: r8a77970: Add INTC-EX device node
  arm64: dts: r8a7796: Add INTC-EX device node
  arm64: dts: ulcb-kf: hog USB3 hub control gpios
  arm64: dts: ulcb-kf: enable PCA9548 on I2C4
  arm64: dts: ulcb-kf: enable PCA9548 on I2C2
  arm64: dts: ulcb-kf: enable TCA9539 on I2C4
  arm64: dts: ulcb-kf: enable TCA9539 on I2C2
  arm64: dts: ulcb-kf: enable USB3.0 Host
  arm64: dts: ulcb-kf: enable PCIE0/1
  arm64: dts: ulcb-kf: enable USB2.0 Host channel 0
  arm64: dts: ulcb-kf: enable HSUSB
  arm64: dts: ulcb-kf: enable CAN0/1
  arm64: dts: ulcb-kf: enable SCIF1
  ...
2017-10-30 14:26:01 +01:00
Arnd Bergmann 11c3889c23 UniPhier ARM64 SoC DT updates for v4.15
- add thermal monitor and thermal zone nodes
 - add efuse nodes
 - fix W=2 warnings
 - add GPIO controller nodes and related properties
 - add resets properties
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZ7idoAAoJED2LAQed4NsG9HsQAKbgS6BqmEi7l6dg8Iz++DPE
 OkICvN5EPMh0NFujlqfGswmawXgZv1MsvQphFyJ9+a2FC1wC7p8AUqiNmEiXt208
 +ogVs1LVHDJwMyJcP1iL1eGJClMOdX9hQ11qQfSlpKFqN6xy67okigahSEMGRveU
 Bydncrih9/zxepv9pCENjE6wuOO73DpxyKsGooVgCeTKtQfSMpT9OhRqMXsC8e3i
 OswsCPii3JtlYEN6EsBj/zkE349mUwkThA+JEZ0nxzgrMir7+6pDJwfu/Dx4F+Z4
 wupplnHAd4/WzAbySb1VBKiLcFhqf0tcdLLmlqS2zNg4s712BDlS22tsurDvpvLt
 lNPZP+/bxcctgug+4pPy5ogilUzExotd+stHUq9G7zCZKAnK50NNdQDb4uAwbc/l
 7yAgOXXIldP523cX3xTMC6x5k4yJD6icCwtOEKyiUqI3hJUo1BlFS1tzlTic+iOx
 CDyNwBGH5vECCHiJyIQHH5HOQ5dvBuArGgnSWdWqFFdYzsIEKnC9UT+VnHJh9giA
 XeyLj/PMnamsso5j1oKhIuxGLho4ap5w4J99QS7ImBD9LJrIaSFrEY7MzNGref9j
 AdxMKPdkZmJg7Jq2hiwcF/5PF+84rUccu9ESrZ/sure2o8XGu72Bpn6pK25HQERI
 7EROd1eaKQhdUCn0zKXj
 =YY9L
 -----END PGP SIGNATURE-----

Merge tag 'uniphier-dt64-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier into next/dt

Pull "UniPhier ARM64 SoC DT updates for v4.15" from Masahiro Yamada:

- add thermal monitor and thermal zone nodes
- add efuse nodes
- fix W=2 warnings
- add GPIO controller nodes and related properties
- add resets properties

* tag 'uniphier-dt64-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier:
  arm64: dts: uniphier: add resets properties
  arm64: dts: uniphier: add eMMC hardware reset provider node
  arm64: dts: uniphier: add GPIO hog definition
  arm64: dts: uniphier: route on-board device IRQ to GPIO controller
  arm64: dts: uniphier: add GPIO controller nodes
  arm64: dts: uniphier: fix W=2 build warnings
  arm64: dts: uniphier: enable NAND for PXs3 reference board
  arm64: dts: uniphier: add efuse node for LD11, LD20, and PXs3
  arm64: dts: uniphier: add nodes of thermal monitor and thermal zone for LD20
2017-10-30 14:17:29 +01:00
Arnd Bergmann add5c42e99 Allwinner arm64 DT changes for 4.15
Most notable changes:
   - SPI and DMA support on the a64
   - New boards: NanoPi NEO Plus2
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJZ6a4VAAoJEBx+YmzsjxAgnL0P/1KkOUnEuo0sW56x9S5BTLob
 tc8HjJtismgCAISKIQmtFSrPQ4LhP2QRSce7a1sqOAp5TXOzKazXo8UJ4Peg7zkQ
 91aqwOn0Bv3azelzzSnTnfLxJBSOuBBu+DfmoEp7nJsnFcon7xzDeRPSVE+r4bDH
 nAygZJq+d9rJogsWA9x20GR+3HsGShPo2GHXWDDP23eCDSA7EzguaJJq2bp58kQV
 lp/naY6BUCQ6svXdM1yoVtx6YbHMMzuV+ltZ8ZnryGtT3Dqm2y+tYGuQ2iBHhCz6
 IWC9pyaVd62exoOr827M+qErJoszPgO9yxjSgQkrpZzzuIo2zsQNWfNIjkuJ2F18
 jVKzCyuYQhLUVnIBpDAcRa33k37SvXJdyZgRdiAin/wGixrRw0LivX3qcpfe1EZB
 MgSsiAa7c82/Fy1gzj+49zcfPkk7cqpQnTK3dDSMRyOsZuN34meiaYvT7tmI44/q
 EQOJvat49Bm/54ueqBHET0dMCY447TDudG9zJinvEGkbCQzTxx1dMk4EP68qnOZF
 /57meyzaNs5Xo9KM/KpSXYC+Z0SKWQBDNVN3rtNLzDg+lQi5GCKVmXss2r5xabYN
 m/dMrZeJskVi+/2IIkNgUop7UgCvNDMq+PtEQMEh7c2ezO4eQWKkz/t2Y6MguK0Y
 NbBLy+4tfmML2mLHyqBB
 =OAav
 -----END PGP SIGNATURE-----

Merge tag 'sunxi-dt64-for-4.15' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt

Pull "Allwinner arm64 DT changes for 4.15" from Maxime Ripard:

Most notable changes:
  - SPI and DMA support on the a64
  - New boards: NanoPi NEO Plus2

* tag 'sunxi-dt64-for-4.15' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  arm: allwinner: Correct unit name in devicetree binding example
  arm64: allwinner: a64: add dma controller references to spi nodes
  arm64: allwinner: a64: Add device node for DMA controller
  arm64: allwinner: a64: Fix node with unit name and no reg property
  arm64: allwinner: a64: Fix simple-bus unit address format error
  arm64: allwinner: h5: add NanoPi NEO Plus2 DT support
  arm64: allwinner: a64: add SPI nodes
2017-10-30 14:13:31 +01:00
Catalin Marinas 6218f96c58 arm64: Implement arch-specific pte_access_permitted()
The generic pte_access_permitted() implementation only checks for
pte_present() (together with the write permission where applicable).
However, for both kernel ptes and PROT_NONE mappings pte_present() also
returns true on arm64 even though such mappings are not user accessible.
Additionally, arm64 now supports execute-only user permission
(PROT_EXEC) which is implemented by clearing the PTE_USER bit.

With this patch the arm64 implementation of pte_access_permitted()
checks for the PTE_VALID and PTE_USER bits together with writable access
if applicable.

Cc: <stable@vger.kernel.org>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-30 12:41:15 +00:00
Arnd Bergmann c0dec1ec33 Allwinner DT changes for 4.15
The most notable changes are:
   - Conversion to the last SoC (A10, A20) to the new clock framework
   - HDMI and dual pipeline support for the A10, A20 and A31 DRM driver
   - Support for the various power supplies on a number of boards
   - Fix of DTC warnings on a number of SoCs, but most of them still need
     some work
   - New boards: A20-OLinuXino-MICRO-eMMC, TBS A711, Banana Pi M2 Berry,
     Banana Pi M2 Ultra
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJZ6avvAAoJEBx+YmzsjxAgQ9MP/RvW5lGwVg8Y6aIEr8pGBNCO
 pNiQkBToR5HQnCPTBzNfspoaR8w/8H344AGS56+tzjFIF1P2cawzOxEn1oUrOcbM
 mAuSUzekpBoKbad2vXsL6uwY2qo3fv62+I72edZkQ4tSEGLK6ISA49sKzhIfFP/2
 7K92nP9xodKfMu/pn74/jxzSqcOKXDRSsj1Eyht5KL0oiSmwPgZfCFz+ITE5lozt
 mzh19qTdxabXZZ4CxVRCBPz/+p6+lmbnIgh8anjcL0YgLN96B1rly3bqAvAmgw7H
 Bv6nxRhNlEGwvQasgHiSQM7AaVONfPK6WUdDI5Wrpch7de4aFt/Bpz676zeDWWUt
 dH3Nix8z4AAIma1Yw5CM3fJaPY7vKiL8TlWmSzu2Gc+fb1jGIVf/yvDlV9Gu3g6I
 JE6YoQmUDC3Sw2q2fvrCokjGTr24u6Er+mBt7u0qGmv7dx70jTBIosXsGwfcwtj2
 iKGCjbfRU6rzui+YGEgktCz6m8LIdm5T2BkS93hgfVWJPL7oxmDd+rRon2N196ni
 JhM8ieTHrow7Mb365FK66Xa4KK8emhLhH7wubo2l9x5uIfr4iu61gv0rOhAppoCC
 Cop3YyHk1H7SlSUP0tbN2pc36x2wMoPDfAy1MsZNzuD3VXVd//wf9z1c07oL22XA
 TXkVd4c39WYRx6MZlQ7+
 =HjP6
 -----END PGP SIGNATURE-----

Merge tag 'sunxi-dt-for-4.15' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt

Pull "Allwinner DT changes for 4.15" from Maxime Ripard:

The most notable changes are:
  - Conversion to the last SoC (A10, A20) to the new clock framework
  - HDMI and dual pipeline support for the A10, A20 and A31 DRM driver
  - Support for the various power supplies on a number of boards
  - Fix of DTC warnings on a number of SoCs, but most of them still need
    some work
  - New boards: A20-OLinuXino-MICRO-eMMC, TBS A711, Banana Pi M2 Berry,
    Banana Pi M2 Ultra
  - New R40 SoC support

* tag 'sunxi-dt-for-4.15' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: (63 commits)
  ARM: sun8i: r40: enable USB host for Banana Pi M2 Ultra
  ARM: sun8i: v40: add 5V regulator for Banana Pi M2 Berry
  ARM: sun8i: r40: add 5V regulator for Banana Pi M2 Ultra
  ARM: sun8i: r40: add USB host port nodes for R40
  ARM: dts: sun4i: Enable HDMI support on some A10 devices
  ARM: dts: sun7i: Enable HDMI support on some A20 devices
  ARM: dts: sun7i: Add device nodes for display pipelines
  ARM: dts: sun4i: Add device nodes for display pipelines
  ARM: dts: sun8i: r40: add watchdog device node
  ARM: dts: sun5i: reference-design-tablet: Enable AXP209 AC and battery
  ARM: dts: sun9i: Change node names to remove underscores
  ARM: dts: sun9i: Change node names to remove underscores
  ARM: dts: sun4i: Remove underscores from nodes names
  ARM: dts: sun4i: Provide default muxing for relevant controllers
  ARM: dts: sun4i: Change pinctrl nodes to avoid warning
  ARM: dts: sun6i: Enable HDMI support on some A31/A31s devices
  ARM: dts: sun6i: Add device node for HDMI controller
  ARM: dts: sun4i: Change LRADC node names to avoid warnings
  ARM: dts: sun4i: Remove skeleton and memory to avoid warnings
  ARM: dts: sun4i: Remove gpio-keys warnings
  ...
2017-10-30 11:52:18 +01:00
Arnd Bergmann 5068d87100 mvebu arm64 for 4.15 (part 1)
For Armada 7K/8K, enable NAND, RTC, comphy and 10G PHY in the
 defconfig
 -----BEGIN PGP SIGNATURE-----
 
 iIEEABECAEEWIQQYqXDMF3cvSLY+g9cLBhiOFHI71QUCWeoQjSMcZ3JlZ29yeS5j
 bGVtZW50QGZyZWUtZWxlY3Ryb25zLmNvbQAKCRALBhiOFHI71SAGAJwN7iJ6Xywi
 3DGgmYy/KtEm0/ZxcwCfZ6dFcGrSWo4IsPictpUL+x4TETk=
 =Gmg4
 -----END PGP SIGNATURE-----

Merge tag 'mvebu-arm64-4.15-1' of git://git.infradead.org/linux-mvebu into next/soc

Pull "mvebu arm64 for 4.15 (part 1)" from Gregory CLEMENT:

For Armada 7K/8K, enable NAND, RTC, comphy and 10G PHY in the
defconfig

* tag 'mvebu-arm64-4.15-1' of git://git.infradead.org/linux-mvebu:
  arm64: defconfig: enable RTC on Armada 7K/8K SoCs
  arm64: defconfig: enable NAND on Armada 7K/8K SoCs
  arm64: defconfig: enable Marvell CP110 comphy
  arm64: defconfig: enable the Marvell 10G PHY as a module
2017-10-30 10:38:07 +01:00
Arnd Bergmann 17a8045ba3 arm64: tegra: Default configuration updates for v4.15-rc1
This enables the PCI host controller on 64-bit ARM. It is supported and
 enabled via device tree on Tegra210 and Tegra186.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlnp4n4THHRyZWRpbmdA
 bnZpZGlhLmNvbQAKCRDdI6zXfz6zoZQSD/9MJu8m9Qhg6kdN7qiHjry7pTMW5GVV
 EO6L1jSQQo4VedEZbOh9ot46Aj0HGGDVvi9YuQi7UHoV3y2SeWJ/WmFN3sf0FNm5
 PR37c8lOxp3Oj6dGfMGHrpz4P8a0FPiKqqFlI4x/sahKgSta4z7ac1lmGcnYRGEs
 X69zZxEHjvDkkataAkScmSexEZvCvVVORKU/odTtrIAGYE56docCkY4uI34EWJF7
 igT0ammthwCJZIy3Nhbt+5Bvd03PKtAXdmurMrAsX0/DXVjKtUqzSDuN0CBdVPtl
 wzHRO0cKx1m+EEDl4MdxfXfoo92klBRMc0I2Oj0b3+vTZMED1xvieo7vfSeflxRJ
 /hs76EOyUQvgTLuwqrd5v6p916aGu7T4FT1YQchViq/d77BRIjPtR2x8leipKtU+
 d5Am5qHEUdVF8EapEo/4wEzpRdZCCAQ8ZU3p0hq7YM3U5vWbmmnGGgumxNkzYj4e
 7XECrc29BHEBE5Lcn+yUeHbCoED7RjrUXkT/mQ6wzG7dhLb1FQ1VF2lcQKCPVaV0
 8Qt4cY3rSHZXEmKDkeJSzpkNd1cr4W7sXVQkeePgXov7aOrVnW1XYlN+4HWBPrk3
 Or0LBhR84AaB5R01PG5QAdFX/A5pfSCLZlZiCbyk1rRoN26JxX6tHk6ehCAFbrZ2
 eBCNv96QrpCMGw==
 =nDdS
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-4.15-arm64-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/soc

Pull "arm64: tegra: Default configuration updates for v4.15-rc1" from Thierry Reding:

This enables the PCI host controller on 64-bit ARM. It is supported and
enabled via device tree on Tegra210 and Tegra186.

* tag 'tegra-for-4.15-arm64-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  arm64: defconfig: Enable Tegra PCI controller
2017-10-30 10:36:47 +01:00
Arnd Bergmann 36a247ba72 UniPhier ARM SoC fixes for v4.14
- Add necessary clock to EHCI node
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZ6iQbAAoJED2LAQed4NsG/+gP/3KBBo4ta73DSJIwNHLO2DJK
 uNLRNHYSAvYTp+DD9sUkyaeU/YeE6A+SqD0Zm6gSPfoJTCYI9dS0ktLPiMhXLu0L
 Qc1JttaKA6SBmydbsLBuzDDSZzTt7D2lUjHECZ/BxTsFEOEWriRA1/LNOx+lmnHj
 F7euH9Tl09W9OcYj1a0qm2B1boMfyVjd3zvWEXU/iKf869J6iNruVo4WUV/3dG55
 mhcgBHF2YX0Rbpl5JPs/bSWDtQVgFP2jAyuQ3L0i0xsomWMdzVSEZbULCFrzG52n
 1IHy7RcnZ0ID7QBozruQVYw689dmRYz1qGRBgHmi739PUY+PgucBo0zKrr0NA0UA
 g2ctaIpZpQ/yp6cmajoVLBfGs7K+bFMwaXXjrbT+2Ug4k+HcSYpAYzgy2JkI3c3C
 574YNo8DrKj/Wji2gg21Ulp7lG6MIwgW2hXQxlX7LFvlEtG5nxjHuSKItdn4FfpJ
 VS0tReyvRvHAyEn8/1g+YltVVPO+9yzdLj4Enm9b2j/kz1Kihq3zb51eJExd9U/E
 mgeYMWXcMST5oiOtFMSFEJSU9mebNFA7PRdLQc5R3RWAOCcwHV0N6WVBrDA8NkGs
 o/wrPXaOXrDHIL8FrilrD4tYcRp6Pa/G8zJUyXt8Fw9ykCzTIvLsn63Qbme4kpga
 LsArieMVrpCEzEb/R5me
 =hxk8
 -----END PGP SIGNATURE-----

Merge tag 'uniphier-fixes-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier into fixes

Pull "UniPhier ARM SoC fixes for v4.14" from Masahiro Yamada:

- Add necessary clock to EHCI node

* tag 'uniphier-fixes-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier:
  arm64: dts: uniphier: add STDMAC clock to EHCI nodes
  ARM: dts: uniphier: add STDMAC clock to EHCI nodes
2017-10-30 10:20:45 +01:00
Jerome Brunet b94d22d94a ARM64: dts: meson-gx: add external PHY interrupt on some platforms
Add the external PHY interrupt on the nanopi-k2, odroid-c2, p200, p230
and q200

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-10-29 08:44:04 -07:00
Jerome Brunet 9dbb56ea09 ARM64: dts: meson-gx: add gpio interrupt controller
Add gpio interrupt controller to Amlogic GX family SoCs

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-10-29 08:43:29 -07:00
Jerome Brunet f2c2122a6c ARM64: meson: enable MESON_IRQ_GPIO in Kconfig
select MESON_IRQ_GPIO in Kconfig for Amlogic's meson SoC family

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-10-29 08:43:17 -07:00
Neil Armstrong e841ec956e ARM64: dts: meson-gxbb-odroidc2: fix usb1 power supply
Looking at the schematics, the USB Power Supply is shared between the
two USB interfaces,
If the usb0 fails to initialize, the second one won't have power.

Fixes: 5a0803bd5a ("ARM64: dts: meson-gxbb-odroidc2: Enable USB Nodes")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2017-10-29 08:43:00 -07:00
Will Deacon d7b1d22d38 arm64: uapi: Remove PSR_Q_BIT
PSTATE.Q only exists for AArch32, which can be referred to using
COMPAT_PSR_Q_BIT. Remove PSR_Q_BIT, since the native bit doesn't exist
in the architecture

Tested-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-27 16:27:03 +01:00
Will Deacon b7300d4c03 arm64: traps: Pretty-print pstate in register dumps
We can decode the PSTATE easily enough, so pretty-print it in register
dumps.

Tested-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-27 16:26:58 +01:00
Will Deacon a25ffd3a63 arm64: traps: Don't print stack or raw PC/LR values in backtraces
Printing raw pointer values in backtraces has potential security
implications and are of questionable value anyway.

This patch follows x86's lead and removes the "Exception stack:" dump
from kernel backtraces, as well as converting PC/LR values to symbols
such as "sysrq_handle_crash+0x20/0x30".

Tested-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-27 16:26:53 +01:00
Mark Rutland 42dbf54e88 arm64: consistently log ESR and page table
When we take a fault we can't handle, we try to dump some relevant
information, but we're not consistent about doing so.

In do_mem_abort(), we log the full ESR, but don't dump a page table
walk. In __do_kernel_fault, we dump an attempted decoding of the ESR
(but not the ESR itself) along with a page table walk.

Let's try to make things more consistent by dumping the full ESR in
mem_abort_decode(), and having do_mem_abort dump a page table walk. The
existing dump of the ESR in do_mem_abort() is rendered redundant, and
removed.

Tested-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Julien Thierry <julien.thierry@arm.com>
Cc: Kristina Martsenko <kristina.martsenko@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-27 16:26:47 +01:00
Andreas Färber a9ce6f8545 arm64: dts: realtek: Add MeLE V9
Add an initial Device Tree for MeLE V9 Media Player.

Cc: meleservice@mele.cn
Signed-off-by: Andreas Färber <afaerber@suse.de>
2017-10-26 16:24:38 +09:00
Andreas Färber f8b3436dad arm64: dts: realtek: Factor out common RTD129x parts
Prepares for RTD1293 and RTD1296.

Signed-off-by: Andreas Färber <afaerber@suse.de>
2017-10-26 16:11:54 +09:00
Dave Martin fa3eb71d96 arm64: asm-bug: Renumber macro local labels to avoid clashes
Currently ASM_BUG() and its constituent macros define local
assembler labels 0, 1 and 2 internally, which carries a high risk
of clash with callers' labels and consequent mis-assembly.

This patch gives the labels a big random offset to minimise the
chance of such errors.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-25 15:57:15 +01:00
Julien Thierry 6436beeee5 arm64: Fix single stepping in kernel traps
Software Step exception is missing after stepping a trapped instruction.

Ensure SPSR.SS gets set to 0 after emulating/skipping a trapped instruction
before doing ERET.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
[will: replaced AARCH32_INSN_SIZE with 4]
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-25 11:57:33 +01:00
Julien Thierry e28cc02559 arm64: Use existing defines for mdscr
Literal values are being used to set single stepping in mdscr from assembly
code. There are already existing defines representing those values, use
those instead of the literal values.

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-25 11:56:59 +01:00
Will Deacon 087133ac90 locking/qrwlock, arm64: Move rwlock implementation over to qrwlocks
Now that the qrwlock can make use of WFE, remove our homebrewed rwlock
code in favour of the generic queued implementation.

Tested-by: Waiman Long <longman@redhat.com>
Tested-by: Jeremy Linton <jeremy.linton@arm.com>
Tested-by: Adam Wallis <awallis@codeaurora.org>
Tested-by: Jan Glauber <jglauber@cavium.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Jeremy.Linton@arm.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: boqun.feng@gmail.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: paulmck@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/1507810851-306-5-git-send-email-will.deacon@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-10-25 10:57:25 +02:00
Mark Salyzyn 9ca255bf04 arm64: Avoid aligning normal memory pointers in __memcpy_{to,from}io
__memcpy_{to,from}io fall back to byte-at-a-time copying if both the
source and destination pointers are not 8-byte aligned. Since one of the
pointers always points at normal memory, this is unnecessary and
detrimental to performance, so only do byte copying until we hit an 8-byte
boundary for the device pointer.

This change was motivated by performance issues in the pstore driver.
On a test platform, measuring probe time for pstore, console buffer
size of 1/4MB and pmsg of 1/2MB, was in the 90-107ms region. Change
managed to reduce it to 10-25ms, an improvement in boot time.

Cc: Kees Cook <keescook@chromium.org>
Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-24 16:23:07 +01:00
Will Deacon 1e0c661f05 Merge branch 'for-next/perf' into aarch64/for-next/core
Merge in ARM PMU and perf updates for 4.15:

  - Support for the Statistical Profiling Extension
  - Support for Hisilicon's SoC PMU

Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-10-24 16:06:56 +01:00
Romain Perier 6f8c539313 arm64: dts: rockchip: add efuse for RK3368 SoCs
This adds the definition for eFuse that is found on RK3368 SoCs with the
corresponding data cells.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-10-24 15:25:27 +02:00
Ingo Molnar 9babb091e0 Linux 4.14-rc6
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJZ7clWAAoJEHm+PkMAQRiG07AH/iKcej+AsurISHx6i/LUEDC1
 a9wo5HAR5kEj+ohdE3JSkD9BHLcyhcCXaqIk9yOrwi9xv1DrPv8U/nGkKzZJzFi2
 mGWK09Zgi+vgSpA+YSErgl05IVGtgaryQQPqQdawpyRpqTUwP0+2pLnKEnJe0f05
 fpv+S4bDKUCuE8GcVNjF9gxXDg8j60fFa+oAcn7QPS6dCun/H6TbDRue5oeky0Y+
 50ZYjjioy9S9DIm2VF7pktMCP/mK/fgb+Q+4Up09VJGHGhq+891SRJ27yDulxo47
 /gq22SRIGBX2PGNllSwhYslgaCRRlYTMBYOIWrBreanA4NpGD662dp+GgWhD154=
 =TAMw
 -----END PGP SIGNATURE-----

Merge tag 'v4.14-rc6' into locking/core, to pick up fixes

Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-10-24 13:17:20 +02:00
Masahiro Yamada 76c48e1eca arm64: dts: uniphier: add resets properties
Add resets properties to all nodes that have reset lines.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-24 02:12:57 +09:00
Masahiro Yamada b6e5ec203b arm64: dts: uniphier: add eMMC hardware reset provider node
Add mmc-pwrseq-emmc node to perform standard eMMC hardware reset
procedure.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-24 02:12:38 +09:00
Masahiro Yamada 15e85695e5 arm64: dts: uniphier: add GPIO hog definition
Interrupt lines from on-board devices are connected to the GPIO
controller.  Add GPIO hogging so that the corresponding GPIO line
is automatically requested.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-24 02:10:47 +09:00
Masahiro Yamada 429f203eb7 arm64: dts: uniphier: route on-board device IRQ to GPIO controller
Interrupt lines from on-board devices are connected to the GPIO
controller.  Handle this correctly.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-24 02:10:47 +09:00
Masahiro Yamada 277b51e705 arm64: dts: uniphier: add GPIO controller nodes
The GPIO controller also acts as an interrupt controller and the
interrupt lines are connected to the AIDET block.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-24 02:10:41 +09:00
Masahiro Yamada 9cd7d03f20 arm64: dts: uniphier: fix W=2 build warnings
Fix warnings like follows:

Warning (node_name_chars_strict): Character '_' not recommended in ...

Commit 8654cb8d03 ("dtc: update warning settings for new bus and
node/property name checks") says these checks are a bit subjective,
but Rob also says to not add new W=2 warnings.

The exising warnings should be fixed in order to catch new ones
easily.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-24 01:28:46 +09:00
Masahiro Yamada ae4cce8788 arm64: dts: uniphier: enable NAND for PXs3 reference board
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-23 10:09:48 +09:00