path: root/arch/arm64
AgeCommit message (Collapse)AuthorFilesLines
2014-07-23arm64: mm: Implement 4 levels of translation tablesJungseok Lee11-17/+147
This patch implements 4 levels of translation tables since 3 levels of page tables with 4KB pages cannot support 40-bit physical address space described in [1] due to the following issue. It is a restriction that kernel logical memory map with 4KB + 3 levels (0xffffffc000000000-0xffffffffffffffff) cannot cover RAM region from 544GB to 1024GB in [1]. Specifically, ARM64 kernel fails to create mapping for this region in map_mem function since __phys_to_virt for this region reaches to address overflow. If SoC design follows the document, [1], over 32GB RAM would be placed from 544GB. Even 64GB system is supposed to use the region from 544GB to 576GB for only 32GB RAM. Naturally, it would reach to enable 4 levels of page tables to avoid hacking __virt_to_phys and __phys_to_virt. However, it is recommended 4 levels of page table should be only enabled if memory map is too sparse or there is about 512GB RAM. References ---------- [1]: Principles of ARM Memory Maps, White Paper, Issue C Signed-off-by: Jungseok Lee <> Reviewed-by: Sungjinn Chung <> Acked-by: Kukjin Kim <> Reviewed-by: Christoffer Dall <> Reviewed-by: Steve Capper <> [ MEMBLOCK_INITIAL_LIMIT removed, same as PUD_SIZE] [ early_ioremap_init() updated for 4 levels] [ 48-bit VA depends on BROKEN until KVM is fixed] Signed-off-by: Catalin Marinas <> Tested-by: Jungseok Lee <>
2014-07-23arm64: Add 4 levels of page tables definition with 4KB pagesJungseok Lee2-0/+121
This patch adds hardware definition and types for 4 levels of translation tables with 4KB pages. Signed-off-by: Jungseok Lee <> Reviewed-by: Sungjinn Chung <> Acked-by: Kukjin Kim <> Reviewed-by: Christoffer Dall <> Signed-off-by: Catalin Marinas <> Tested-by: Jungseok Lee <>
2014-07-23arm64: Introduce VA_BITS and translation level optionsJungseok Lee7-15/+54
This patch adds virtual address space size and a level of translation tables to kernel configuration. It facilicates introduction of different MMU options, such as 4KB + 4 levels, 16KB + 4 levels and 64KB + 3 levels, easily. The idea is based on the discussion with Catalin Marinas: Signed-off-by: Jungseok Lee <> Reviewed-by: Sungjinn Chung <> Acked-by: Kukjin Kim <> Reviewed-by: Christoffer Dall <> Signed-off-by: Catalin Marinas <> Tested-by: Jungseok Lee <>
2014-07-23arm64: Do not initialise the fixmap page tables in head.SCatalin Marinas3-19/+22
The early_ioremap_init() function already handles fixmap pte initialisation, so upgrade this to cover all of pud/pmd/pte and remove one page from swapper_pg_dir. Signed-off-by: Catalin Marinas <> Tested-by: Jungseok Lee <>
2014-07-23arm64: Remove stray ARCH_HAS_OPP referenceMark Brown1-1/+0
A reference to ARCH_HAS_OPP was added in commit 333d17e56 (arm64: add ARCH_HAS_OPP to allow enabling OPP library) however this symbol is no longer needed after commit 049d595a4db3b3a (PM / OPP: Make OPP invisible to users in Kconfig). Signed-off-by: Mark Brown <> Signed-off-by: Catalin Marinas <>
2014-07-21arm64: dmi: Add SMBIOS/DMI supportYi Li3-0/+54
SMbios is important for server hardware vendors. It implements a spec for providing descriptive information about the platform. Things like serial numbers, physical layout of the ports, build configuration data, and the like. This has been tested by dmidecode and lshw tools. Signed-off-by: Yi Li <> Signed-off-by: Ard Biesheuvel <> Reviewed-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-18arm64: cpuinfo: print info for all CPUsMark Rutland1-22/+18
Currently reading /proc/cpuinfo will result in information being read out of the MIDR_EL1 of the current CPU, and the information is not associated with any particular logical CPU number. This is problematic for systems with heterogeneous CPUs (i.e. big.LITTLE) where MIDR fields will vary across CPUs, and the output will differ depending on the executing CPU. This patch reorganises the code responsible for /proc/cpuinfo to print information per-cpu. In the process, we perform several cleanups: * Property names are coerced to lower-case (to match "processor" as per glibc's expectations). * Property names are simplified and made to match the MIDR field names. * Revision is changed to hex as with every other field. * The meaningless Architecture property is removed. * The ripe-for-abuse Machine field is removed. The features field (a human-readable representation of the hwcaps) remains printed once, as this is expected to remain in use as the globally support CPU features. To enable the possibility of the addition of per-cpu HW feature information later, this is printed before any CPU-specific information. Comments are added to guide userspace developers in the right direction (using the hwcaps provided in auxval). Hopefully where userspace applications parse /proc/cpuinfo rather than using the readily available hwcaps, they limit themselves to reading said first line. If CPU features differ from each other, the previously installed sanity checks will give us some advance notice with warnings and TAINT_CPU_OUT_OF_SPEC. If we are lucky, we will never see such systems. Rework will be required in many places to support such systems anyway. Signed-off-by: Mark Rutland <> Cc: Ard Biesheuvel <> Cc: Catalin Marinas <> Cc: Marcus Shawcroft <> Cc: Peter Maydell <> Acked-by: Will Deacon <> [ remove machine_name as it is no longer reported] Signed-off-by: Catalin Marinas <>
2014-07-18arm64: add runtime system sanity checksMark Rutland1-0/+93
Unexpected variation in certain system register values across CPUs is an indicator of potential problems with a system. The kernel expects CPUs to be mostly identical in terms of supported features, even in systems with heterogeneous CPUs, with uniform instruction set support being critical for the correct operation of userspace. To help detect issues early where hardware violates the expectations of the kernel, this patch adds simple runtime sanity checks on important ID registers in the bring up path of each CPU. Where CPUs are fundamentally mismatched, set TAINT_CPU_OUT_OF_SPEC. Given that the kernel assumes CPUs are identical feature wise, let's not pretend that we expect such configurations to work. Supporting such configurations would require massive rework, and hopefully they will never exist. Signed-off-by: Mark Rutland <> Reviewed-by: Will Deacon <> Reviewed-by: Catalin Marinas <> Signed-off-by: Catalin Marinas <>
2014-07-18arm64: cachetype: report weakest cache policyMark Rutland2-6/+36
In big.LITTLE systems, the I-cache policy may differ across CPUs, and thus we must always meet the most stringent maintenance requirements of any I-cache in the system when performing maintenance to ensure correctness. Unfortunately this requirement is not met as we always look at the current CPU's cache type register to determine the maintenance requirements. This patch causes the I-cache policy of all CPUs to be taken into account for icache_is_aliasing and icache_is_aivivt. If any I-cache in the system is aliasing or AIVIVT, the respective function will return true. At boot each CPU may set flags to identify that at least one I-cache in the system is aliasing and/or AIVIVT. The now unused and potentially misleading icache_policy function is removed. Signed-off-by: Mark Rutland <> Acked-by: Will Deacon <> Reviewed-by: Will Deacon <> Reviewed-by: Catalin Marinas <> Signed-off-by: Catalin Marinas <>
2014-07-18arm64: cpuinfo: record cpu system register valuesMark Rutland5-4/+144
Several kernel subsystems need to know details about CPU system register values, sometimes for CPUs other than that they are executing on. Rather than hard-coding system register accesses and cross-calls for these cases, this patch adds logic to record various system register values at boot-time. This may be used for feature reporting, firmware bug detection, etc. Separate hooks are added for the boot and hotplug paths to enable one-time intialisation and cold/warm boot value mismatch detection in later patches. Signed-off-by: Mark Rutland <> Reviewed-by: Will Deacon <> Reviewed-by: Catalin Marinas <> Signed-off-by: Catalin Marinas <>
2014-07-18arm64: add MIDR_EL1 field accessorsMark Rutland1-7/+26
The MIDR_EL1 register is composed of a number of bitfields, and uses of the fields has so far involved open-coding of the shifts and masks required. This patch adds shifts and masks for each of the MIDR_EL1 subfields, and also provides accessors built atop of these. Existing uses within cputype.h are updated to use these accessors. The read_cpuid_part_number macro is modified to return the extracted bitfield rather than returning the value in-place with all other fields (including revision) masked out, to better match the other accessors. As the value is only used in comparison with the *_CPU_PART_* macros which are similarly updated, and these values are never exposed to userspace, this change should not affect any functionality. Signed-off-by: Mark Rutland <> Acked-by: Will Deacon <> Reviewed-by: Will Deacon <> Reviewed-by: Catalin Marinas <> Signed-off-by: Catalin Marinas <>
2014-07-18arm64: kernel: add missing __init section marker to cpu_suspend_initLorenzo Pieralisi1-1/+1
Suspend init function must be marked as __init, since it is not needed after the kernel has booted. This patch moves the cpu_suspend_init() function to the __init section. Signed-off-by: Lorenzo Pieralisi <> Signed-off-by: Catalin Marinas <>
2014-07-18arm64: kernel: add __init marker to PSCI init functionsLorenzo Pieralisi1-2/+2
PSCI init functions must be marked as __init so that they are freed by the kernel upon boot. This patch marks the PSCI init functions as such since they need not be persistent in the kernel address space after the kernel has booted. Signed-off-by: Lorenzo Pieralisi <> Signed-off-by: Catalin Marinas <>
2014-07-18arm64: kernel: enable PSCI cpu operations on UP systemsLorenzo Pieralisi2-2/+4
PSCI CPU operations have to be enabled on UP kernels so that calls like eg cpu_suspend can be made functional on UP too. This patch reworks the PSCI CPU operations so that they can be enabled on UP systems. Acked-by: Mark Rutland <> Signed-off-by: Lorenzo Pieralisi <> Signed-off-by: Catalin Marinas <>
2014-07-18arm64: fpsimd: avoid restoring fpcr if the contents haven't changedWill Deacon1-2/+15
Writing to the FPCR is commonly implemented as a self-synchronising operation in the CPU, so avoid writing to the register when the saved value matches that in the hardware already. Cc: Ard Biesheuvel <> Reviewed-by: Lorenzo Pieralisi <> Signed-off-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-17arm64: Align the kbuild output for VDSOL and VDSOAIan Campbell1-2/+2
Signed-off-by: Ian Campbell <> Cc: Catalin Marinas <> Cc: Will Deacon <> Cc: Michal Marek <> Cc: Cc: Signed-off-by: Catalin Marinas <>
2014-07-17arm64: vdso: move data page before code pagesWill Deacon2-20/+18
Andy pointed out that binutils generates additional sections in the vdso image (e.g. section string table) which, if our .text section gets big enough, could cross a page boundary and end up screwing up the location where the kernel expects to put the data page. This patch solves the issue in the same manner as x86_32, by moving the data page before the code pages. Cc: Andy Lutomirski <> Signed-off-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-17arm64: vdso: move to _install_special_mapping and remove arch_vma_nameWill Deacon1-45/+35
_install_special_mapping replaces install_special_mapping and removes the need to detect special VMA in arch_vma_name. This patch moves the vdso and compat vectors page code over to the new API. Cc: Andy Lutomirski <> Signed-off-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-17arm64: vdso: put vdso datapage in a separate vmaWill Deacon1-8/+26
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 <> Signed-off-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-17arm64: Remove duplicate (SWAPPER|IDMAP)_DIR_SIZE definitionsCatalin Marinas1-3/+0
Just keep the asm/page.h definition as this is included in as well. Signed-off-by: Catalin Marinas <> Acked-by: Mark Rutland <>
2014-07-17arm64: Use pr_* instead of printkJungseok Lee1-4/+4
This patch fixed the following checkpatch complaint as using pr_* instead of printk. WARNING: printk() should include KERN_ facility level Signed-off-by: Jungseok Lee <> Reviewed-by: Sungjinn Chung <> Acked-by: Kukjin Kim <> Signed-off-by: Catalin Marinas <>
2014-07-10arm64: Enable TEXT_OFFSET fuzzingMark Rutland4-2/+30
The arm64 Image header contains a text_offset field which bootloaders are supposed to read to determine the offset (from a 2MB aligned "start of memory" per booting.txt) at which to load the kernel. The offset is not well respected by bootloaders at present, and due to the lack of variation there is little incentive to support it. This is unfortunate for the sake of future kernels where we may wish to vary the text offset (even zeroing it). This patch adds options to arm64 to enable fuzz-testing of text_offset. CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET forces the text offset to a random 16-byte aligned value value in the range [0..2MB) upon a build of the kernel. It is recommended that distribution kernels enable randomization to test bootloaders such that any compliance issues can be fixed early. Signed-off-by: Mark Rutland <> Acked-by: Tom Rini <> Acked-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-10arm64: Update the Image headerMark Rutland3-3/+69
Currently the kernel Image is stripped of everything past the initial stack, and at runtime the memory is initialised and used by the kernel. This makes the effective minimum memory footprint of the kernel larger than the size of the loaded binary, though bootloaders have no mechanism to identify how large this minimum memory footprint is. This makes it difficult to choose safe locations to place both the kernel and other binaries required at boot (DTB, initrd, etc), such that the kernel won't clobber said binaries or other reserved memory during initialisation. Additionally when big endian support was added the image load offset was overlooked, and is currently of an arbitrary endianness, which makes it difficult for bootloaders to make use of it. It seems that bootloaders aren't respecting the image load offset at present anyway, and are assuming that offset 0x80000 will always be correct. This patch adds an effective image size to the kernel header which describes the amount of memory from the start of the kernel Image binary which the kernel expects to use before detecting memory and handling any memory reservations. This can be used by bootloaders to choose suitable locations to load the kernel and/or other binaries such that the kernel will not clobber any memory unexpectedly. As before, memory reservations are required to prevent the kernel from clobbering these locations later. Both the image load offset and the effective image size are forced to be little-endian regardless of the native endianness of the kernel to enable bootloaders to load a kernel of arbitrary endianness. Bootloaders which wish to make use of the load offset can inspect the effective image size field for a non-zero value to determine if the offset is of a known endianness. To enable software to determine the endinanness of the kernel as may be required for certain use-cases, a new flags field (also little-endian) is added to the kernel header to export this information. The documentation is updated to clarify these details. To discourage future assumptions regarding the value of text_offset, the value at this point in time is removed from the main flow of the documentation (though kept as a compatibility note). Some minor formatting issues in the documentation are also corrected. Signed-off-by: Mark Rutland <> Acked-by: Tom Rini <> Cc: Geoff Levand <> Cc: Kevin Hilman <> Acked-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-10arm64: place initial page tables above the kernelMark Rutland4-28/+28
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 <> Tested-by: Laura Abbott <> Acked-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-10arm64: head.S: remove unnecessary function alignmentMark Rutland1-1/+6
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 <> Tested-by: Laura Abbott <> Acked-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-10arm64: Cast KSTK_(EIP|ESP) to unsigned longCatalin Marinas1-2/+2
This is for similarity with thread_saved_(pc|sp) and to avoid some compiler warnings in the audit code. Signed-off-by: Catalin Marinas <>
2014-07-10arm64: Add audit supportAKASHI Takahiro2-0/+16
On AArch64, audit is supported through generic lib/audit.c and compat_audit.c, and so this patch adds arch specific definitions required. Acked-by Will Deacon <> Acked-by: Richard Guy Briggs <> Signed-off-by: AKASHI Takahiro <> Signed-off-by: Catalin Marinas <>
2014-07-10arm64: audit: Add audit hook in syscall_trace_enter/exit()AKASHI Takahiro1-0/+7
This patch adds auditing functions on entry to or exit from every system call invocation. Acked-by: Richard Guy Briggs <> Acked-by Will Deacon <> Signed-off-by: AKASHI Takahiro <> Signed-off-by: Catalin Marinas <>
2014-07-10arm64: Add __NR_* definitions for compat syscallsCatalin Marinas6-404/+786
This patch adds __NR_* definitions to asm/unistd32.h, moves the __NR_compat_* definitions to asm/unistd.h and removes all the explicit unistd32.h includes apart from the one building the compat syscall table. The aim is to have the compat __NR_* definitions available but without colliding with the native syscall definitions (required by lib/compat_audit.c to avoid duplicating the audit header files between native and compat). Signed-off-by: Catalin Marinas <>
2014-07-10arm64: enable context trackingLarry Bassel3-1/+41
Make calls to ct_user_enter when the kernel is exited and ct_user_exit when the kernel is entered (in el0_da, el0_ia, el0_svc, el0_irq and all of the "error" paths). These macros expand to function calls which will only work properly if el0_sync and related code has been rearranged (in a previous patch of this series). The calls to ct_user_exit are made after hw debugging has been enabled (enable_dbg_and_irq). The call to ct_user_enter is made at the beginning of the kernel_exit macro. This patch is based on earlier work by Kevin Hilman. Save/restore optimizations were also done by Kevin. Acked-by: Will Deacon <> Reviewed-by: Kevin Hilman <> Tested-by: Kevin Hilman <> Signed-off-by: Larry Bassel <> Signed-off-by: Kevin Hilman <> Signed-off-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-10arm64: adjust el0_sync so that a function can be calledLarry Bassel1-6/+13
To implement the context tracker properly on arm64, a function call needs to be made after debugging and interrupts are turned on, but before the lr is changed to point to ret_to_user(). If the function call is made after the lr is changed the function will not return to the correct place. For similar reasons, defer the setting of x0 so that it doesn't need to be saved around the function call (save far_el1 in x26 temporarily instead). Acked-by: Will Deacon <> Reviewed-by: Kevin Hilman <> Tested-by: Kevin Hilman <> Signed-off-by: Larry Bassel <> Signed-off-by: Will Deacon <> Signed-off-by: Catalin Marinas <>
2014-07-09arm64: Add CONFIG_CC_STACKPROTECTORLaura Abbott3-0/+45
arm64 currently lacks support for -fstack-protector. Add similar functionality to arm to detect stack corruption. Acked-by: Will Deacon <> Acked-by: Kees Cook <> Signed-off-by: Laura Abbott <> Signed-off-by: Catalin Marinas <>
2014-07-09arm64: topology: add MPIDR-based detectionZi Shen Lim2-14/+35
Create cpu topology based on MPIDR. When hardware sets MPIDR to sane values, this method will always work. Therefore it should also work well as the fallback method. [1] When we have multiple processing elements in the system, we create the cpu topology by mapping each affinity level (from lowest to highest) to threads (if they exist), cores, and clusters. [1] Acked-by: Lorenzo Pieralisi <> Signed-off-by: Zi Shen Lim <> Signed-off-by: Mark Brown <> Signed-off-by: Catalin Marinas <>
2014-07-04arm64: fix el2_setup check of CurrentELMarc Zyngier3-4/+6
The CurrentEL system register reports the Current Exception Level of the CPU. It doesn't say anything about the stack handling, and yet we compare it to PSR_MODE_EL2t and PSR_MODE_EL2h. It works by chance because PSR_MODE_EL2t happens to match the right bits, but that's otherwise a very bad idea. Just check for the EL value instead. Signed-off-by: Marc Zyngier <> [ fixed arch/arm64/kernel/efi-entry.S] Signed-off-by: Catalin Marinas <>
2014-07-04arm64: mm: Make icache synchronisation logic huge page awareSteve Capper1-1/+2
The __sync_icache_dcache routine will only flush the dcache for the first page of a compound page, potentially leading to stale icache data residing further on in a hugetlb page. This patch addresses this issue by taking into consideration the order of the page when flushing the dcache. Reported-by: Mark Brown <> Tested-by: Mark Brown <> Signed-off-by: Steve Capper <> Acked-by: Will Deacon <> Signed-off-by: Catalin Marinas <> Cc: <> # v3.11+
2014-07-04arm64: mm: Fix horrendous config typoSteve Capper1-1/+1
The define ARM64_64K_PAGES is tested for rather than CONFIG_ARM64_64K_PAGES. Correct that typo here. Signed-off-by: Steve Capper <> Signed-off-by: Catalin Marinas <>
2014-06-18arm64: mm: remove broken &= operator from pmd_mknotpresentWill Deacon1-1/+1
This should be a plain old '&' and could easily lead to undefined behaviour if the target of a pmd_mknotpresent invocation was the same as the parameter. Fixes: 9c7e535fcc17 (arm64: mm: Route pmd thp functions through pte equivalents) Signed-off-by: Will Deacon <> Cc: <> # v3.15 Signed-off-by: Catalin Marinas <>
2014-06-18arm64: fix build error in sigcontext.hMark Salter1-1/+1
I'm seeing this build failure for arm64: CC [M] Documentation/filesystems/configfs/configfs_example_macros.o In file included from /usr/include/bits/sigcontext.h:27:0, from /usr/include/signal.h:340, from /usr/include/sys/wait.h:30, from Documentation/accounting/getdelays.c:24: .../linux/usr/include/asm/sigcontext.h:61:2: error: unknown type name ‘u64’ u64 esr; ^ make[2]: *** [Documentation/accounting/getdelays] Error 1 This was introduced by commit 15af1942dd61ee23: arm64: Expose ESR_EL1 information to user when SIGSEGV/SIGBUS Using __u64 instead of u64 fixes the problem. Signed-off-by: Mark Salter <> Signed-off-by: Catalin Marinas <>
2014-06-18arm64: dts: Add more serial port nodes in APM X-Gene device treeVinayak Kale2-1/+39
APM X-Gene Storm SoC supports 4 serial ports. This patch adds device nodes for serial ports 1 to 3 (a device node for serial port 0 is already present in the dts file). This patch also sets the compatible property of serial nodes to "ns16550a". Signed-off-by: Vinayak Kale <> Acked-by: Rob Herring <> Signed-off-by: Catalin Marinas <>
2014-06-18arm64/dma: Removing ARCH_HAS_DMA_GET_REQUIRED_MASK macroSuravee Suthikulpanit1-2/+0
Arm64 does not define dma_get_required_mask() function. Therefore, it should not define the ARCH_HAS_DMA_GET_REQUIRED_MASK. This causes build errors in some device drivers (e.g. mpt2sas) Signed-off-by: Suravee Suthikulpanit <> Signed-off-by: Catalin Marinas <> Cc: <>
2014-06-18arm64: ptrace: fix empty registers set in prstatus of aarch32 process coreVictor Kamensky1-9/+19
Currently core file of aarch32 process prstatus note has empty registers set. As result aarch32 core files create by V8 kernel are not very useful. It happens because compat_gpr_get and compat_gpr_set functions can copy registers values to/from either kbuf or ubuf. ELF core file collection function fill_thread_core_info calls compat_gpr_get with kbuf set and ubuf set to 0. But current compat_gpr_get and compat_gpr_set function handle copy to/from only ubuf case. Fix is to handle kbuf and ubuf as two separate cases in similar way as other functions like user_regset_copyout, user_regset_copyin do. Signed-off-by: Victor Kamensky <> Acked-by: Will Deacon <> Cc: Signed-off-by: Catalin Marinas <>
2014-06-18arm64: uid16: fix __kernel_old_{gid,uid}_t definitionsWill Deacon2-1/+10
Whilst native arm64 applications don't have the 16-bit UID/GID syscalls wired up, compat tasks can still access them. The 16-bit wrappers for these syscalls use __kernel_old_uid_t and __kernel_old_gid_t, which must be 16-bit data types to maintain compatibility with the 16-bit UIDs used by compat applications. This patch defines 16-bit __kernel_old_{gid,uid}_t types for arm64 instead of using the 32-bit types provided by asm-generic. Signed-off-by: Will Deacon <> Acked-by: Arnd Bergmann <> Cc: <> Signed-off-by: Catalin Marinas <>
2014-06-18arm64: ptrace: change fs when passing kernel pointer to regset codeWill Deacon1-0/+4
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 <> Cc: <> Signed-off-by: Catalin Marinas <>
2014-06-18arm64: Limit the CMA buffer to 32-bit if ZONE_DMACatalin Marinas1-2/+8
When the CMA buffer is allocated, it is too early to know whether devices will require ZONE_DMA memory. This patch limits the CMA buffer to (DMA_BIT_MASK(32) + 1) if CONFIG_ZONE_DMA is enabled. In addition, it computes the dma_to_phys(DMA_BIT_MASK(32)) before the increment (no current functional change). Signed-off-by: Catalin Marinas <>
2014-06-18arm64/crypto: improve performance of GHASH algorithmArd Biesheuvel2-56/+40
This patches modifies the GHASH secure hash implementation to switch to a faster, polynomial multiplication based reduction instead of one that uses shifts and rotates. Signed-off-by: Ard Biesheuvel <> Signed-off-by: Catalin Marinas <>
2014-06-18arm64/crypto: fix data corruption bug in GHASH algorithmArd Biesheuvel1-0/+1
This fixes a bug in the GHASH algorithm resulting in the calculated hash to be incorrect if the input is presented in chunks whose size is not a multiple of 16 bytes. Signed-off-by: Ard Biesheuvel <> Fixes: fdd2389457b2 ("arm64/crypto: GHASH secure hash using ARMv8 Crypto Extensions") Signed-off-by: Catalin Marinas <>
2014-06-18arm64: defconfig update for LTPCatalin Marinas1-0/+15
This patch adds several defconfig options required primarily by the LTP test suite. Signed-off-by: Catalin Marinas <>
2014-06-18arm64: ftrace: Fix comment typo 'CONFIG_FUNCTION_GRAPH_FP_TEST'Paul Bolle1-1/+1
Signed-off-by: Paul Bolle <> Signed-off-by: Catalin Marinas <>
2014-06-18arm64: add ARCH_HAS_OPP to allow enabling OPP librarySudeep Holla1-0/+1
The Operating Performance Point (OPP) Layer library is a generic library used by CPUFREQ and DEVFREQ. It can be enabled only on the platforms that specify ARCH_HAS_OPP option. This patch selects that option in order to allow ARM64 based platforms to use OPP library. Signed-off-by: Sudeep Holla <> Signed-off-by: Catalin Marinas <>
2014-06-18arm64: restore alphabetic order in KconfigSudeep Holla1-1/+1
Signed-off-by: Sudeep Holla <> Signed-off-by: Catalin Marinas <>