Commit Graph

332 Commits

Author SHA1 Message Date
Mark Brown
c69294e957 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-efi' into linux-linaro-lsk
Conflicts:
	arch/arm64/kernel/Makefile
	arch/arm64/kernel/head.S
2014-07-24 23:03:21 +01:00
Leif Lindholm
2edcb9f57b arm64: efi: only attempt efi map setup if booting via EFI
Booting a kernel with CONFIG_EFI enabled on a non-EFI system caused
an oops with the current UEFI support code.
Add the required test to prevent this.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
(cherry picked from commit 74bcc24992)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-24 22:58:43 +01:00
Mark Salter
9d805241d7 arm64: add EFI runtime services
This patch adds EFI runtime support for arm64. This runtime support allows
the kernel to access various EFI runtime services provided by EFI firmware.
Things like reboot, real time clock, EFI boot variables, and others.

This functionality is supported for little endian kernels only. The UEFI
firmware standard specifies that the firmware be little endian. A future
patch is expected to add support for big endian kernels running with
little endian firmware.

Signed-off-by: Mark Salter <msalter@redhat.com>
[ Remove unnecessary cache/tlb maintenance. ]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>

(cherry picked from commit f84d02755f)
Signed-off-by: Mark Brown <broonie@linaro.org>

Conflicts:
	arch/arm64/Kconfig
	arch/arm64/kernel/Makefile
2014-07-24 22:58:43 +01:00
Ard Biesheuvel
05b1bec982 efi/arm64: efistub: remove local copy of linux_banner
The shared efistub code for ARM and arm64 contains a local copy of
linux_banner, allowing it to be referenced from separate executables
such as the ARM decompressor. However, this introduces a dependency on
generated header files, causing unnecessary rebuilds of the stub itself
and, in case of arm64, vmlinux which contains it.

On arm64, the copy is not actually needed since we can reference the
original symbol directly, and as it turns out, there may be better ways
to deal with this for ARM as well, so let's remove it from the shared
code. If it still needs to be reintroduced for ARM later, it should live
under arch/arm anyway and not in shared code.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
(cherry picked from commit a55c072dfe)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-24 22:58:42 +01:00
Mark Salter
e26b51869e arm64: efi: add EFI stub
This patch adds PE/COFF header fields to the start of the kernel
Image so that it appears as an EFI application to UEFI firmware.
An EFI stub is included to allow direct booting of the kernel
Image.

Signed-off-by: Mark Salter <msalter@redhat.com>
[Add support in PE/COFF header for signed images]
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>

(cherry picked from commit 3c7f255039)
Signed-off-by: Mark Brown <broonie@linaro.org>

Conflicts:
	arch/arm64/Kconfig
	arch/arm64/kernel/Makefile
2014-07-24 22:58:42 +01:00
Roy Franz
19227cf4a6 arm64: Expand arm64 image header
Expand the arm64 image header to allow for co-existance with
PE/COFF header required by the EFI stub.  The PE/COFF format
requires the "MZ" header to be at offset 0, and the offset
to the PE/COFF header to be at offset 0x3c.  The image
header is expanded to allow 2 instructions at the beginning
to accommodate a benign intruction at offset 0 that includes
the "MZ" header, a magic number, and the offset to the PE/COFF
header.

Signed-off-by: Roy Franz <roy.franz@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 4370eec05a)
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 3033aae67a)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-24 22:58:42 +01:00
Mark Brown
bf3738e515 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-misc' into linux-linaro-lsk
Conflicts:
	arch/arm64/kernel/head.S
2014-07-24 22:52:37 +01:00
Mark Rutland
0c0ec28f52 arm64: place initial page tables above the kernel
Currently we place swapper_pg_dir and idmap_pg_dir below the kernel
image, between PHYS_OFFSET and (PHYS_OFFSET + TEXT_OFFSET). However,
bootloaders may use portions of this memory below the kernel and we do
not parse the memory reservation list until after the MMU has been
enabled. As such we may clobber some memory a bootloader wishes to have
preserved.

To enable the use of all of this memory by bootloaders (when the
required memory reservations are communicated to the kernel) it is
necessary to move our initial page tables elsewhere. As we currently
have an effectively unbound requirement for memory at the end of the
kernel image for .bss, we can place the page tables here.

This patch moves the initial page table to the end of the kernel image,
after the BSS. As they do not consist of any initialised data they will
be stripped from the kernel Image as with the BSS. The BSS clearing
routine is updated to stop at __bss_stop rather than _end so as to not
clobber the page tables, and memory reservations made redundant by the
new organisation are removed.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Laura Abbott <lauraa@codeaurora.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit bd00cd5f8c)
Signed-off-by: Mark Brown <broonie@linaro.org>

Conflicts:
	arch/arm64/mm/init.c
2014-07-23 12:58:04 +01:00
Catalin Marinas
83c5fe50e1 arm64: Relax the kernel cache requirements for boot
With system caches for the host OS or architected caches for guest OS we
cannot easily guarantee that there are no dirty or stale cache lines for
the areas of memory written by the kernel during boot with the MMU off
(therefore non-cacheable accesses).

This patch adds the necessary cache maintenance during boot and relaxes
the booting requirements.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit c218bca74e)
Signed-off-by: Mark Brown <broonie@linaro.org>

Conflicts:
	arch/arm64/kernel/head.S
2014-07-23 12:55:36 +01:00
Matthew Leach
c4885474b7 arm64: head: create a new function for setting the boot_cpu_mode flag
Currently, the code for setting the __cpu_boot_mode flag is munged in
with el2_setup. This makes things difficult on a BE bringup as a
memory access has to have occurred before el2_setup which is the place
that we'd like to set the endianess on the current EL.

Create a new function for setting __cpu_boot_mode and have el2_setup
return the mode the CPU. Also define a new constant in virt.h,
BOOT_CPU_MODE_EL1, for readability.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Matthew Leach <matthew.leach@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 828e9834e9)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-23 12:54:22 +01:00
Ian Campbell
099776d20c arm64: Align the kbuild output for VDSOL and VDSOA
Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit ad789ba5f7)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-23 00:39:03 +01:00
Will Deacon
b44e79e0d8 arm64: vdso: put vdso datapage in a separate vma
The VDSO datapage doesn't need to be executable (no code there) or
CoW-able (the kernel writes the page, so a private copy is totally
useless).

This patch moves the datapage into its own VMA, identified as "[vvar]"
in /proc/<pid>/maps.

Cc: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 8715493852)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-23 00:37:26 +01:00
Mark Rutland
55ae4c39fc arm64: head.S: remove unnecessary function alignment
Currently __turn_mmu_on is aligned to 64 bytes to ensure that it doesn't
span any page boundary, which simplifies the idmap and spares us
requiring an additional page table to map half of the function. In
keeping with other important requirements in architecture code, this
fact is undocumented.

Additionally, as the function consists of three instructions totalling
12 bytes with no literal pool data, a smaller alignment of 16 bytes
would be sufficient.

This patch reduces the alignment to 16 bytes and documents the
underlying reason for the alignment. This reduces the required alignment
of the entire .head.text section from 64 bytes to 16 bytes, though it
may still be aligned to a larger value depending on TEXT_OFFSET.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Laura Abbott <lauraa@codeaurora.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 909a4069da)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-23 00:34:12 +01:00
Mark Brown
fa6e052947 Merge tag 'v3.10.48' into linux-linaro-lsk
This is the 3.10.48 stable release
2014-07-14 10:45:20 +01:00
ChiaHao
c30371e884 arm64: Bug fix in stack alignment exception
commit 3906c2b53c upstream.

The value of ESR has been stored into x1, and should be directly pass to
do_sp_pc_abort function, "MOV x1, x25" is an extra operation and do_sp_pc_abort
will get the wrong value of ESR.

Signed-off-by: ChiaHao <andy.jhshiu@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 11:14:01 -07:00
Mark Brown
d01bd6fdb3 Merge tag 'v3.10.46' into linux-linaro-lsk
This is the 3.10.46 stable release
2014-07-01 11:19:52 +01:00
Will Deacon
97d4477d9e arm64: ptrace: change fs when passing kernel pointer to regset code
commit c168870704 upstream.

Our compat PTRACE_POKEUSR implementation simply passes the user data to
regset_copy_from_user after some simple range checking. Unfortunately,
the data in question has already been copied to the kernel stack by this
point, so the subsequent access_ok check fails and the ptrace request
returns -EFAULT. This causes problems tracing fork() with older versions
of strace.

This patch briefly changes the fs to KERNEL_DS, so that the access_ok
check passes even with a kernel address.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-30 20:09:42 -07:00
Mark Brown
9580f70223 Revert "Merge remote-tracking branch 'lsk/v3.10/topic/arm64-fpsimd' into linux-linaro-lsk"
This reverts commit b621c22123, reversing
changes made to d7610b8eaf.
2014-06-26 10:49:57 +01:00
Mark Brown
b621c22123 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-fpsimd' into linux-linaro-lsk
Conflicts:
	arch/arm64/Kconfig
	arch/arm64/include/asm/thread_info.h
	arch/arm64/kernel/fpsimd.c
2014-06-19 13:17:52 +01:00
Ard Biesheuvel
92732accb6 arm64: add support for kernel mode NEON in interrupt context
This patch modifies kernel_neon_begin() and kernel_neon_end(), so
they may be called from any context. To address the case where only
a couple of registers are needed, kernel_neon_begin_partial(u32) is
introduced which takes as a parameter the number of bottom 'n' NEON
q-registers required. To mark the end of such a partial section, the
regular kernel_neon_end() should be used.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
(cherry picked from commit 190f1ca85d)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-19 12:34:28 +01:00
Ard Biesheuvel
8ec3883b5a arm64: defer reloading a task's FPSIMD state to userland resume
If a task gets scheduled out and back in again and nothing has touched
its FPSIMD state in the mean time, there is really no reason to reload
it from memory. Similarly, repeated calls to kernel_neon_begin() and
kernel_neon_end() will preserve and restore the FPSIMD state every time.

This patch defers the FPSIMD state restore to the last possible moment,
i.e., right before the task returns to userland. If a task does not return to
userland at all (for any reason), the existing FPSIMD state is preserved
and may be reused by the owning task if it gets scheduled in again on the
same CPU.

This patch adds two more functions to abstract away from straight FPSIMD
register file saves and restores:
- fpsimd_restore_current_state -> ensure current's FPSIMD state is loaded
- fpsimd_flush_task_state -> invalidate live copies of a task's FPSIMD state

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
(cherry picked from commit 005f78cd88)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-19 12:34:14 +01:00
Ard Biesheuvel
2c65b0d368 arm64: add abstractions for FPSIMD state manipulation
There are two tacit assumptions in the FPSIMD handling code that will no longer
hold after the next patch that optimizes away some FPSIMD state restores:
. the FPSIMD registers of this CPU contain the userland FPSIMD state of
  task 'current';
. when switching to a task, its FPSIMD state will always be restored from
  memory.

This patch adds the following functions to abstract away from straight FPSIMD
register file saves and restores:
- fpsimd_preserve_current_state -> ensure current's FPSIMD state is saved
- fpsimd_update_current_state -> replace current's FPSIMD state

Where necessary, the signal handling and fork code are updated to use the above
wrappers instead of poking into the FPSIMD registers directly.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
(cherry picked from commit c51f92693c)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-19 12:34:05 +01:00
Lorenzo Pieralisi
d7ee1fd79f arm64: kernel: implement fpsimd CPU PM notifier
When a CPU enters a low power state, its FP register content is lost.
This patch adds a notifier to save the FP context on CPU shutdown
and restore it on CPU resume. The context is saved and restored only
if the suspending thread is not a kernel thread, mirroring the current
context switch behaviour.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
(cherry picked from commit fb1ab1ab38)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-19 12:33:56 +01:00
Jiang Liu
2f36c2ef13 arm64: fix possible invalid FPSIMD initialization state
If context switching happens during executing fpsimd_flush_thread(),
stale value in FPSIMD registers will be saved into current thread's
fpsimd_state by fpsimd_thread_switch(). That may cause invalid
initialization state for the new process, so disable preemption
when executing fpsimd_flush_thread().

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Jiang Liu <liuj97@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 6db83cea1c)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-19 12:33:49 +01:00
Ard Biesheuvel
df40a73882 arm64: add support for kernel mode NEON
Add <asm/neon.h> containing kernel_neon_begin/kernel_neon_end function
declarations and corresponding definitions in fpsimd.c

These are needed to wrap uses of NEON in kernel mode. The names are
identical to the ones used in arm/ so code using intrinsics or
vectorized by GCC can be shared between arm and arm64.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 4cfb361364)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-19 12:33:41 +01:00
Mark Brown
3d9077e6d4 arm64: smp: Fix mismerge
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-09 19:31:52 +01:00
Mark Brown
2521006663 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-ftrace' into linux-linaro-lsk
Conflicts:
	arch/arm64/Kconfig
	arch/arm64/kernel/Makefile
	arch/arm64/kernel/hw_breakpoint.c
	arch/arm64/kernel/ptrace.c
2014-05-30 18:18:44 +01:00
AKASHI Takahiro
0cc5286fc3 arm64: ftrace: (bugfix) synced with ftcace interface change
ftrace_init() failed since ftrace_dyn_arch_init() doesn't initialize
the argument to null.
This bug comes in only if arm64 ftrace is back-ported as
ftrace_dyn_arch_init() interface has been changed in the merge window of
3.15.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-30 18:15:44 +01:00
AKASHI Takahiro
1bda9b270a arm64: ftrace: Add system call tracepoint
This patch allows system call entry or exit to be traced as ftrace events,
ie. sys_enter_*/sys_exit_*, if CONFIG_FTRACE_SYSCALLS is enabled.
Those events appear and can be controlled under
    ${sysfs}/tracing/events/syscalls/

Please note that we can't trace compat system calls here because
AArch32 mode does not share the same syscall table with AArch64.
Just define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS in order to avoid unexpected
results (bogus syscalls reported or even hang-up).

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-30 18:15:44 +01:00
AKASHI Takahiro
ea76465b82 arm64: ftrace: Add CALLER_ADDRx macros
CALLER_ADDRx returns caller's address at specified level in call stacks.
They are used for several tracers like irqsoff and preemptoff.
Strange to say, however, they are refered even without FTRACE.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-30 18:15:43 +01:00
AKASHI Takahiro
95d7e55333 arm64: ftrace: Add dynamic ftrace support
This patch allows "dynamic ftrace" if CONFIG_DYNAMIC_FTRACE is enabled.
Here we can turn on and off tracing dynamically per-function base.

On arm64, this is done by patching single branch instruction to _mcount()
inserted by gcc -pg option. The branch is replaced to NOP initially at
kernel start up, and later on, NOP to branch to ftrace_caller() when
enabled or branch to NOP when disabled.
Please note that ftrace_caller() is a counterpart of _mcount() in case of
'static' ftrace.

More details on architecture specific requirements are described in
Documentation/trace/ftrace-design.txt.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-30 18:15:43 +01:00
AKASHI Takahiro
fc0c93936a arm64: Add ftrace support
This patch implements arm64 specific part to support function tracers,
such as function (CONFIG_FUNCTION_TRACER), function_graph
(CONFIG_FUNCTION_GRAPH_TRACER) and function profiler
(CONFIG_FUNCTION_PROFILER).

With 'function' tracer, all the functions in the kernel are traced with
timestamps in ${sysfs}/tracing/trace. If function_graph tracer is
specified, call graph is generated.

The kernel must be compiled with -pg option so that _mcount() is inserted
at the beginning of functions. This function is called on every function's
entry as long as tracing is enabled.
In addition, function_graph tracer also needs to be able to probe function's
exit. ftrace_graph_caller() & return_to_handler do this by faking link
register's value to intercept function's return path.

More details on architecture specific requirements are described in
Documentation/trace/ftrace-design.txt.

Reviewed-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-30 18:15:43 +01:00
AKASHI Takahiro
8370369c5c arm64: Add 'notrace' attribute to unwind_frame() for ftrace
walk_stackframe() calls unwind_frame(), and if walk_stackframe() is
"notrace", unwind_frame() should be also "notrace".

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-30 18:15:42 +01:00
AKASHI Takahiro
568549bd6f arm64: is_compat_task is defined both in asm/compat.h and linux/compat.h
Some kernel files may include both linux/compat.h and asm/compat.h directly
or indirectly. Since both header files contain is_compat_task() under
!CONFIG_COMPAT, compiling them with !CONFIG_COMPAT will eventually fail.
Such files include kernel/auditsc.c, kernel/seccomp.c and init/do_mountfs.c
(do_mountfs.c may read asm/compat.h via asm/ftrace.h once ftrace is
implemented).

So this patch proactively
1) removes is_compat_task() under !CONFIG_COMPAT from asm/compat.h
2) replaces asm/compat.h to linux/compat.h in kernel/*.c,
   but asm/compat.h is still necessary in ptrace.c and process.c because
   they use is_compat_thread().

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit fd92d4a54a)
Signed-off-by: Mark Brown <broonie@linaro.org>

Conflicts:
	arch/arm64/kernel/hw_breakpoint.c
2014-05-30 18:15:41 +01:00
AKASHI Takahiro
517f60a12d arm64: split syscall_trace() into separate functions for enter/exit
As done in arm, this change makes it easy to confirm we invoke syscall
related hooks, including syscall tracepoint, audit and seccomp which would
be implemented later, in correct order. That is, undoing operations in the
opposite order on exit that they were done on entry.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 3157858fef)
Signed-off-by: Mark Brown <broonie@linaro.org>

Conflicts:
	arch/arm64/kernel/ptrace.c
2014-05-30 18:15:40 +01:00
AKASHI Takahiro
3deeb6e480 arm64: make a single hook to syscall_trace() for all syscall features
Currently syscall_trace() is called only for ptrace.
With additional TIF_xx flags defined, it is now called in all the cases
of audit, ftrace and seccomp in addition to ptrace.

Acked-by: Richard Guy Briggs <rgb@redhat.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 449f81a4da)
Signed-off-by: Mark Brown <broonie@linaro.org>

Conflicts:
	arch/arm64/kernel/entry.S
2014-05-30 18:15:40 +01:00
Mark Brown
6fe70bb73e Merge remote-tracking branch 'lsk/v3.10/topic/arm64-cpuidle' into linux-linaro-lsk
Conflicts:
	drivers/cpuidle/Makefile
2014-05-30 11:14:13 +01:00
Lorenzo Pieralisi
75ce30ddaa arm64: add PSCI CPU_SUSPEND based cpu_suspend support
This patch implements the cpu_suspend cpu operations method through
the PSCI CPU_SUSPEND API. The PSCI implementation translates the idle state
index passed by the cpu_suspend core call into a valid PSCI state according to
the PSCI states initialized at boot by the PSCI suspend backend.

Entry point is set to cpu_resume physical address, that represents the
default kernel execution address following a CPU reset.

Idle state indices missing a DT node description are initialized to power
state standby WFI so that if called by the idle driver they provide the
default behaviour.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-29 21:43:15 +01:00
Mark Brown
44e35c33f2 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-ptrace' into HEAD 2014-05-28 20:12:09 +01:00
Alex Shi
8352d7dd08 Merge branch 'v3.10/topic/arm64-misc' into linux-linaro-lsk
For armv8 clock getting failure bug.
2014-05-26 17:25:46 +08:00
Alex Shi
3698e46b6e Revert "arm64: init: Move of_clk_init to time_init"
This reverts commit 638b6642b0.
Since time is close to 14.05 release, we revert this commit for a
quick fix to clock missing bug on armv8:

[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:64 nr_irqs:64 0
[    0.000000] vexpress-osc: Failed to obtain config func for node
'/smb/motherboard/mcc/osc@1'!

Signed-off-by: Alex Shi <alex.shi@linaro.org>
2014-05-26 17:18:05 +08:00
Mark Brown
088d7dadf9 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-misc' into linux-linaro-lsk
Conflicts:
	arch/arm64/Kconfig
2014-05-24 14:11:01 +01:00
Catalin Marinas
8b343c860c arm64: Clean up the default pgprot setting
The primary aim of this patchset is to remove the pgprot_default and
prot_sect_default global variables and rely strictly on predefined
values. The original goal was to be able to run SMP kernels on UP
hardware by not setting the Shareability bit. However, it is unlikely to
see UP ARMv8 hardware and even if we do, the Shareability bit is no
longer assumed to disable cacheable accesses.

A side effect is that the device mappings now have the Shareability
attribute set. The hardware, however, should ignore it since Device
accesses are always Outer Shareable.

Following the removal of the two global variables, there is some PROT_*
macro reshuffling and cleanup, including the __PAGE_* macros (replaced
by PAGE_*).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit a501e32430)
Signed-off-by: Mark Brown <broonie@linaro.org>

Conflicts:
	arch/arm64/include/asm/io.h
	arch/arm64/include/asm/pgtable.h
2014-05-24 14:04:51 +01:00
Mark Brown
ea3518bfc0 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-dma' into lsk-v3.10-arm64-misc
Conflicts:
	arch/arm64/Kconfig
	arch/arm64/mm/dma-mapping.c
	mm/Kconfig
2014-05-24 14:04:44 +01:00
Mark Salter
2036aef6cd arm64: add early_ioremap support
Add support for early IO or memory mappings which are needed before the
normal ioremap() is usable.  This also adds fixmap support for permanent
fixed mappings such as that used by the earlyprintk device register
region.

Signed-off-by: Mark Salter <msalter@redhat.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Borislav Petkov <borislav.petkov@amd.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit bf4b558eba)
Signed-off-by: Mark Brown <broonie@linaro.org>

Conflicts:
	arch/arm64/Kconfig
	arch/arm64/mm/ioremap.c
2014-05-23 19:27:34 +01:00
Mark Brown
fb64c4d995 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-misc' into linux-linaro-lsk
Conflicts:
	arch/arm64/kernel/debug-monitors.c
	arch/arm64/mm/dma-mapping.c
2014-05-22 00:13:20 +01:00
Mark Brown
2a9c800470 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-dma' into linux-linaro-lsk 2014-05-22 00:11:40 +01:00
Mark Brown
c578ab8f44 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-kgdb' into linux-linaro-lsk 2014-05-22 00:11:36 +01:00
Mark Brown
fbd2e15366 Merge remote-tracking branch 'lsk/v3.10/topic/arm64-perf' into linux-linaro-lsk
Conflicts:
	arch/arm64/kernel/Makefile
2014-05-22 00:11:30 +01:00
Will Deacon
2b3a92c809 arm64: barriers: make use of barrier options with explicit barriers
When calling our low-level barrier macros directly, we can often suffice
with more relaxed behaviour than the default "all accesses, full system"
option.

This patch updates the users of dsb() to specify the option which they
actually require.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 98f7685ee6)
Signed-off-by: Mark Brown <broonie@linaro.org>

Conflicts:
	arch/arm64/kvm/sys_regs.c
2014-05-22 00:10:33 +01:00