Commit 92b94417 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull arm64 fixes from Catalin Marinas:
 "These are primarily bug fixes with a performance improvement patch for
  the GHASH crypto algorithm (which went in during this merging window)
  and dts/defconfig/Kconfig updates.

   - ftrace_return_addr() macro fix for arm (introduced earlier via the
     arm64 tree)
   - stack alignment exception entry code fix
   - GHASH crypto algorithm fix and performance improvement
   - CMA buffer limited to 32-bit (until a better way to describe the
     system topology in DT)
   - UAPI sigcontext.h build fix
   - __kernel_old_{gid,uid}_t definitions fix (affecting 32-bit LTP)
   - ptrace fixes (kernel fault and 32-bit arm core dump)
   - pte_mknotpresent() fix
   - dts updates (APM SoC)
   - defconfig and Kconfig update"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: mm: remove broken &= operator from pmd_mknotpresent
  arm64: fix build error in sigcontext.h
  arm64: dts: Add more serial port nodes in APM X-Gene device tree
  arm64/dma: Removing ARCH_HAS_DMA_GET_REQUIRED_MASK macro
  arm64: ptrace: fix empty registers set in prstatus of aarch32 process core
  arm64: uid16: fix __kernel_old_{gid,uid}_t definitions
  arm64: ptrace: change fs when passing kernel pointer to regset code
  arm64: Limit the CMA buffer to 32-bit if ZONE_DMA
  arm/ftrace: fix ftrace_return_addr() to ftrace_return_address()
  arm64/crypto: improve performance of GHASH algorithm
  arm64/crypto: fix data corruption bug in GHASH algorithm
  arm64: defconfig update for LTP
  arm64: ftrace: Fix comment typo 'CONFIG_FUNCTION_GRAPH_FP_TEST'
  arm64: add ARCH_HAS_OPP to allow enabling OPP library
  arm64: restore alphabetic order in Kconfig
  arm64: Bug fix in stack alignment exception
parents c4222e46 e3a920af
...@@ -52,7 +52,7 @@ extern inline void *return_address(unsigned int level) ...@@ -52,7 +52,7 @@ extern inline void *return_address(unsigned int level)
#endif #endif
#define ftrace_return_addr(n) return_address(n) #define ftrace_return_address(n) return_address(n)
#endif /* ifndef __ASSEMBLY__ */ #endif /* ifndef __ASSEMBLY__ */
......
config ARM64 config ARM64
def_bool y def_bool y
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
select ARCH_USE_CMPXCHG_LOCKREF select ARCH_HAS_OPP
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
select ARCH_USE_CMPXCHG_LOCKREF
select ARCH_WANT_OPTIONAL_GPIOLIB select ARCH_WANT_OPTIONAL_GPIOLIB
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
select ARCH_WANT_FRAME_POINTERS select ARCH_WANT_FRAME_POINTERS
......
...@@ -24,3 +24,7 @@ memory { ...@@ -24,3 +24,7 @@ memory {
reg = < 0x1 0x00000000 0x0 0x80000000 >; /* Updated by bootloader */ reg = < 0x1 0x00000000 0x0 0x80000000 >; /* Updated by bootloader */
}; };
}; };
&serial0 {
status = "ok";
};
...@@ -273,8 +273,9 @@ rtcclk: rtcclk@17000000 { ...@@ -273,8 +273,9 @@ rtcclk: rtcclk@17000000 {
}; };
serial0: serial@1c020000 { serial0: serial@1c020000 {
status = "disabled";
device_type = "serial"; device_type = "serial";
compatible = "ns16550"; compatible = "ns16550a";
reg = <0 0x1c020000 0x0 0x1000>; reg = <0 0x1c020000 0x0 0x1000>;
reg-shift = <2>; reg-shift = <2>;
clock-frequency = <10000000>; /* Updated by bootloader */ clock-frequency = <10000000>; /* Updated by bootloader */
...@@ -282,6 +283,39 @@ serial0: serial@1c020000 { ...@@ -282,6 +283,39 @@ serial0: serial@1c020000 {
interrupts = <0x0 0x4c 0x4>; interrupts = <0x0 0x4c 0x4>;
}; };
serial1: serial@1c021000 {
status = "disabled";
device_type = "serial";
compatible = "ns16550a";
reg = <0 0x1c021000 0x0 0x1000>;
reg-shift = <2>;
clock-frequency = <10000000>; /* Updated by bootloader */
interrupt-parent = <&gic>;
interrupts = <0x0 0x4d 0x4>;
};
serial2: serial@1c022000 {
status = "disabled";
device_type = "serial";
compatible = "ns16550a";
reg = <0 0x1c022000 0x0 0x1000>;
reg-shift = <2>;
clock-frequency = <10000000>; /* Updated by bootloader */
interrupt-parent = <&gic>;
interrupts = <0x0 0x4e 0x4>;
};
serial3: serial@1c023000 {
status = "disabled";
device_type = "serial";
compatible = "ns16550a";
reg = <0 0x1c023000 0x0 0x1000>;
reg-shift = <2>;
clock-frequency = <10000000>; /* Updated by bootloader */
interrupt-parent = <&gic>;
interrupts = <0x0 0x4f 0x4>;
};
phy1: phy@1f21a000 { phy1: phy@1f21a000 {
compatible = "apm,xgene-phy"; compatible = "apm,xgene-phy";
reg = <0x0 0x1f21a000 0x0 0x100>; reg = <0x0 0x1f21a000 0x0 0x100>;
......
...@@ -6,9 +6,18 @@ CONFIG_NO_HZ_IDLE=y ...@@ -6,9 +6,18 @@ CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y CONFIG_HIGH_RES_TIMERS=y
CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=14 CONFIG_LOG_BUF_SHIFT=14
CONFIG_RESOURCE_COUNTERS=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_KMEM=y
CONFIG_CGROUP_HUGETLB=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_IPC_NS is not set # CONFIG_IPC_NS is not set
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
...@@ -27,6 +36,7 @@ CONFIG_ARCH_VEXPRESS=y ...@@ -27,6 +36,7 @@ CONFIG_ARCH_VEXPRESS=y
CONFIG_ARCH_XGENE=y CONFIG_ARCH_XGENE=y
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_PREEMPT=y CONFIG_PREEMPT=y
CONFIG_KSM=y
CONFIG_TRANSPARENT_HUGEPAGE=y CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_CMA=y CONFIG_CMA=y
CONFIG_CMDLINE="console=ttyAMA0" CONFIG_CMDLINE="console=ttyAMA0"
...@@ -45,6 +55,7 @@ CONFIG_IP_PNP_BOOTP=y ...@@ -45,6 +55,7 @@ CONFIG_IP_PNP_BOOTP=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS=y
CONFIG_DMA_CMA=y CONFIG_DMA_CMA=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_VIRTIO_BLK=y CONFIG_VIRTIO_BLK=y
# CONFIG_SCSI_PROC_FS is not set # CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y CONFIG_BLK_DEV_SD=y
...@@ -53,6 +64,7 @@ CONFIG_ATA=y ...@@ -53,6 +64,7 @@ CONFIG_ATA=y
CONFIG_PATA_PLATFORM=y CONFIG_PATA_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y CONFIG_PATA_OF_PLATFORM=y
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_TUN=y
CONFIG_SMC91X=y CONFIG_SMC91X=y
CONFIG_SMSC911X=y CONFIG_SMSC911X=y
# CONFIG_WLAN is not set # CONFIG_WLAN is not set
...@@ -85,6 +97,8 @@ CONFIG_EXT3_FS=y ...@@ -85,6 +97,8 @@ CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
# CONFIG_EXT3_FS_XATTR is not set # CONFIG_EXT3_FS_XATTR is not set
CONFIG_EXT4_FS=y CONFIG_EXT4_FS=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_FUSE_FS=y CONFIG_FUSE_FS=y
CONFIG_CUSE=y CONFIG_CUSE=y
CONFIG_VFAT_FS=y CONFIG_VFAT_FS=y
...@@ -104,6 +118,7 @@ CONFIG_DEBUG_KERNEL=y ...@@ -104,6 +118,7 @@ CONFIG_DEBUG_KERNEL=y
CONFIG_LOCKUP_DETECTOR=y CONFIG_LOCKUP_DETECTOR=y
# CONFIG_SCHED_DEBUG is not set # CONFIG_SCHED_DEBUG is not set
# CONFIG_FTRACE is not set # CONFIG_FTRACE is not set
CONFIG_SECURITY=y
CONFIG_CRYPTO_ANSI_CPRNG=y CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_ARM64_CRYPTO=y CONFIG_ARM64_CRYPTO=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y CONFIG_CRYPTO_SHA1_ARM64_CE=y
......
...@@ -3,14 +3,6 @@ ...@@ -3,14 +3,6 @@
* *
* Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org> * Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
* *
* Based on arch/x86/crypto/ghash-pmullni-intel_asm.S
*
* Copyright (c) 2009 Intel Corp.
* Author: Huang Ying <ying.huang@intel.com>
* Vinodh Gopal
* Erdinc Ozturk
* Deniz Karakoyunlu
*
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published * under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation. * by the Free Software Foundation.
...@@ -19,13 +11,15 @@ ...@@ -19,13 +11,15 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/assembler.h> #include <asm/assembler.h>
DATA .req v0 SHASH .req v0
SHASH .req v1 SHASH2 .req v1
IN1 .req v2
T1 .req v2 T1 .req v2
T2 .req v3 T2 .req v3
T3 .req v4 MASK .req v4
VZR .req v5 XL .req v5
XM .req v6
XH .req v7
IN1 .req v7
.text .text
.arch armv8-a+crypto .arch armv8-a+crypto
...@@ -35,61 +29,51 @@ ...@@ -35,61 +29,51 @@
* struct ghash_key const *k, const char *head) * struct ghash_key const *k, const char *head)
*/ */
ENTRY(pmull_ghash_update) ENTRY(pmull_ghash_update)
ld1 {DATA.16b}, [x1]
ld1 {SHASH.16b}, [x3] ld1 {SHASH.16b}, [x3]
eor VZR.16b, VZR.16b, VZR.16b ld1 {XL.16b}, [x1]
movi MASK.16b, #0xe1
ext SHASH2.16b, SHASH.16b, SHASH.16b, #8
shl MASK.2d, MASK.2d, #57
eor SHASH2.16b, SHASH2.16b, SHASH.16b
/* do the head block first, if supplied */ /* do the head block first, if supplied */
cbz x4, 0f cbz x4, 0f
ld1 {IN1.2d}, [x4] ld1 {T1.2d}, [x4]
b 1f b 1f
0: ld1 {IN1.2d}, [x2], #16 0: ld1 {T1.2d}, [x2], #16
sub w0, w0, #1 sub w0, w0, #1
1: ext IN1.16b, IN1.16b, IN1.16b, #8
CPU_LE( rev64 IN1.16b, IN1.16b )
eor DATA.16b, DATA.16b, IN1.16b
/* multiply DATA by SHASH in GF(2^128) */ 1: /* multiply XL by SHASH in GF(2^128) */
ext T2.16b, DATA.16b, DATA.16b, #8 CPU_LE( rev64 T1.16b, T1.16b )
ext T3.16b, SHASH.16b, SHASH.16b, #8
eor T2.16b, T2.16b, DATA.16b
eor T3.16b, T3.16b, SHASH.16b
pmull2 T1.1q, SHASH.2d, DATA.2d // a1 * b1 ext T2.16b, XL.16b, XL.16b, #8
pmull DATA.1q, SHASH.1d, DATA.1d // a0 * b0 ext IN1.16b, T1.16b, T1.16b, #8
pmull T2.1q, T2.1d, T3.1d // (a1 + a0)(b1 + b0) eor T1.16b, T1.16b, T2.16b
eor T2.16b, T2.16b, T1.16b // (a0 * b1) + (a1 * b0) eor XL.16b, XL.16b, IN1.16b
eor T2.16b, T2.16b, DATA.16b
ext T3.16b, VZR.16b, T2.16b, #8 pmull2 XH.1q, SHASH.2d, XL.2d // a1 * b1
ext T2.16b, T2.16b, VZR.16b, #8 eor T1.16b, T1.16b, XL.16b
eor DATA.16b, DATA.16b, T3.16b pmull XL.1q, SHASH.1d, XL.1d // a0 * b0
eor T1.16b, T1.16b, T2.16b // <T1:DATA> is result of pmull XM.1q, SHASH2.1d, T1.1d // (a1 + a0)(b1 + b0)
// carry-less multiplication
/* first phase of the reduction */ ext T1.16b, XL.16b, XH.16b, #8
shl T3.2d, DATA.2d, #1 eor T2.16b, XL.16b, XH.16b
eor T3.16b, T3.16b, DATA.16b eor XM.16b, XM.16b, T1.16b
shl T3.2d, T3.2d, #5 eor XM.16b, XM.16b, T2.16b
eor T3.16b, T3.16b, DATA.16b pmull T2.1q, XL.1d, MASK.1d
shl T3.2d, T3.2d, #57
ext T2.16b, VZR.16b, T3.16b, #8
ext T3.16b, T3.16b, VZR.16b, #8
eor DATA.16b, DATA.16b, T2.16b
eor T1.16b, T1.16b, T3.16b
/* second phase of the reduction */ mov XH.d[0], XM.d[1]
ushr T2.2d, DATA.2d, #5 mov XM.d[1], XL.d[0]
eor T2.16b, T2.16b, DATA.16b
ushr T2.2d, T2.2d, #1 eor XL.16b, XM.16b, T2.16b
eor T2.16b, T2.16b, DATA.16b ext T2.16b, XL.16b, XL.16b, #8
ushr T2.2d, T2.2d, #1 pmull XL.1q, XL.1d, MASK.1d
eor T1.16b, T1.16b, T2.16b eor T2.16b, T2.16b, XH.16b
eor DATA.16b, DATA.16b, T1.16b eor XL.16b, XL.16b, T2.16b
cbnz w0, 0b cbnz w0, 0b
st1 {DATA.16b}, [x1] st1 {XL.16b}, [x1]
ret ret
ENDPROC(pmull_ghash_update) ENDPROC(pmull_ghash_update)
...@@ -67,11 +67,12 @@ static int ghash_update(struct shash_desc *desc, const u8 *src, ...@@ -67,11 +67,12 @@ static int ghash_update(struct shash_desc *desc, const u8 *src,
blocks = len / GHASH_BLOCK_SIZE; blocks = len / GHASH_BLOCK_SIZE;
len %= GHASH_BLOCK_SIZE; len %= GHASH_BLOCK_SIZE;
kernel_neon_begin_partial(6); kernel_neon_begin_partial(8);
pmull_ghash_update(blocks, ctx->digest, src, key, pmull_ghash_update(blocks, ctx->digest, src, key,
partial ? ctx->buf : NULL); partial ? ctx->buf : NULL);
kernel_neon_end(); kernel_neon_end();
src += blocks * GHASH_BLOCK_SIZE; src += blocks * GHASH_BLOCK_SIZE;
partial = 0;
} }
if (len) if (len)
memcpy(ctx->buf + partial, src, len); memcpy(ctx->buf + partial, src, len);
...@@ -88,7 +89,7 @@ static int ghash_final(struct shash_desc *desc, u8 *dst) ...@@ -88,7 +89,7 @@ static int ghash_final(struct shash_desc *desc, u8 *dst)
memset(ctx->buf + partial, 0, GHASH_BLOCK_SIZE - partial); memset(ctx->buf + partial, 0, GHASH_BLOCK_SIZE - partial);
kernel_neon_begin_partial(6); kernel_neon_begin_partial(8);
pmull_ghash_update(1, ctx->digest, ctx->buf, key, NULL); pmull_ghash_update(1, ctx->digest, ctx->buf, key, NULL);
kernel_neon_end(); kernel_neon_end();
} }
......
...@@ -30,7 +30,6 @@ generic-y += msgbuf.h ...@@ -30,7 +30,6 @@ generic-y += msgbuf.h
generic-y += mutex.h generic-y += mutex.h
generic-y += pci.h generic-y += pci.h
generic-y += poll.h generic-y += poll.h
generic-y += posix_types.h
generic-y += preempt.h generic-y += preempt.h
generic-y += resource.h generic-y += resource.h
generic-y += rwsem.h generic-y += rwsem.h
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#include <xen/xen.h> #include <xen/xen.h>
#include <asm/xen/hypervisor.h> #include <asm/xen/hypervisor.h>
#define ARCH_HAS_DMA_GET_REQUIRED_MASK
#define DMA_ERROR_CODE (~(dma_addr_t)0) #define DMA_ERROR_CODE (~(dma_addr_t)0)
extern struct dma_map_ops *dma_ops; extern struct dma_map_ops *dma_ops;
extern struct dma_map_ops coherent_swiotlb_dma_ops; extern struct dma_map_ops coherent_swiotlb_dma_ops;
......
...@@ -246,7 +246,7 @@ static inline pmd_t pte_pmd(pte_t pte) ...@@ -246,7 +246,7 @@ static inline pmd_t pte_pmd(pte_t pte)
#define pmd_mkwrite(pmd) pte_pmd(pte_mkwrite(pmd_pte(pmd))) #define pmd_mkwrite(pmd) pte_pmd(pte_mkwrite(pmd_pte(pmd)))
#define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd))) #define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd)))
#define pmd_mkyoung(pmd) pte_pmd(pte_mkyoung(pmd_pte(pmd))) #define pmd_mkyoung(pmd) pte_pmd(pte_mkyoung(pmd_pte(pmd)))
#define pmd_mknotpresent(pmd) (__pmd(pmd_val(pmd) &= ~PMD_TYPE_MASK)) #define pmd_mknotpresent(pmd) (__pmd(pmd_val(pmd) & ~PMD_TYPE_MASK))
#define __HAVE_ARCH_PMD_WRITE #define __HAVE_ARCH_PMD_WRITE
#define pmd_write(pmd) pte_write(pmd_pte(pmd)) #define pmd_write(pmd) pte_write(pmd_pte(pmd))
......
#ifndef __ASM_POSIX_TYPES_H
#define __ASM_POSIX_TYPES_H
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;
#define __kernel_old_uid_t __kernel_old_uid_t
#include <asm-generic/posix_types.h>
#endif /* __ASM_POSIX_TYPES_H */
...@@ -58,7 +58,7 @@ struct fpsimd_context { ...@@ -58,7 +58,7 @@ struct fpsimd_context {
struct esr_context { struct esr_context {
struct _aarch64_ctx head; struct _aarch64_ctx head;
u64 esr; __u64 esr;
}; };
#endif /* _UAPI__ASM_SIGCONTEXT_H */ #endif /* _UAPI__ASM_SIGCONTEXT_H */
...@@ -205,7 +205,7 @@ ENDPROC(ftrace_graph_caller) ...@@ -205,7 +205,7 @@ ENDPROC(ftrace_graph_caller)
* *
* Run ftrace_return_to_handler() before going back to parent. * Run ftrace_return_to_handler() before going back to parent.
* @fp is checked against the value passed by ftrace_graph_caller() * @fp is checked against the value passed by ftrace_graph_caller()
* only when CONFIG_FUNCTION_GRAPH_FP_TEST is enabled. * only when CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST is enabled.
*/ */
ENTRY(return_to_handler) ENTRY(return_to_handler)
str x0, [sp, #-16]! str x0, [sp, #-16]!
......
...@@ -279,7 +279,6 @@ el1_sp_pc: ...@@ -279,7 +279,6 @@ el1_sp_pc:
*/ */
mrs x0, far_el1 mrs x0, far_el1
enable_dbg enable_dbg
mov x1, x25
mov x2, sp mov x2, sp
b do_sp_pc_abort b do_sp_pc_abort
el1_undef: el1_undef:
......
...@@ -655,12 +655,17 @@ static int compat_gpr_get(struct task_struct *target, ...@@ -655,12 +655,17 @@ static int compat_gpr_get(struct task_struct *target,
reg = task_pt_regs(target)->regs[idx]; reg = task_pt_regs(target)->regs[idx];
} }
if (kbuf) {
memcpy(kbuf, &reg, sizeof(reg));
kbuf += sizeof(reg);
} else {
ret = copy_to_user(ubuf, &reg, sizeof(reg)); ret = copy_to_user(ubuf, &reg, sizeof(reg));
if (ret) if (ret)
break; break;
ubuf += sizeof(reg); ubuf += sizeof(reg);
} }
}
return ret; return ret;
} }
...@@ -689,11 +694,16 @@ static int compat_gpr_set(struct task_struct *target, ...@@ -689,11 +694,16 @@ static int compat_gpr_set(struct task_struct *target,
unsigned int idx = start + i; unsigned int idx = start + i;
compat_ulong_t reg; compat_ulong_t reg;
if (kbuf) {
memcpy(&reg, kbuf, sizeof(reg));
kbuf += sizeof(reg);
} else {
ret = copy_from_user(&reg, ubuf, sizeof(reg)); ret = copy_from_user(&reg, ubuf, sizeof(reg));
if (ret) if (ret)
return ret; return ret;
ubuf += sizeof(reg); ubuf += sizeof(reg);
}
switch (idx) { switch (idx) {
case 15: case 15:
...@@ -827,6 +837,7 @@ static int compat_ptrace_write_user(struct task_struct *tsk, compat_ulong_t off, ...@@ -827,6 +837,7 @@ static int compat_ptrace_write_user(struct task_struct *tsk, compat_ulong_t off,
compat_ulong_t val) compat_ulong_t val)
{ {
int ret; int ret;
mm_segment_t old_fs = get_fs();
if (off & 3 || off >= COMPAT_USER_SZ) if (off & 3 || off >= COMPAT_USER_SZ)
return -EIO; return -EIO;
...@@ -834,10 +845,13 @@ static int compat_ptrace_write_user(struct task_struct *tsk, compat_ulong_t off, ...@@ -834,10 +845,13 @@ static int compat_ptrace_write_user(struct task_struct *tsk, compat_ulong_t off,
if (off >= sizeof(compat_elf_gregset_t)) if (off >= sizeof(compat_elf_gregset_t))
return 0; return 0;
set_fs(KERNEL_DS);
ret = copy_regset_from_user(tsk, &user_aarch32_view, ret = copy_regset_from_user(tsk, &user_aarch32_view,
REGSET_COMPAT_GPR, off, REGSET_COMPAT_GPR, off,
sizeof(compat_ulong_t), sizeof(compat_ulong_t),
&val); &val);
set_fs(old_fs);
return ret; return ret;
} }
......
...@@ -71,7 +71,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) ...@@ -71,7 +71,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
/* 4GB maximum for 32-bit only capable devices */ /* 4GB maximum for 32-bit only capable devices */
if (IS_ENABLED(CONFIG_ZONE_DMA)) { if (IS_ENABLED(CONFIG_ZONE_DMA)) {
unsigned long max_dma_phys = unsigned long max_dma_phys =
(unsigned long)dma_to_phys(NULL, DMA_BIT_MASK(32) + 1); (unsigned long)(dma_to_phys(NULL, DMA_BIT_MASK(32)) + 1);
max_dma = max(min, min(max, max_dma_phys >> PAGE_SHIFT)); max_dma = max(min, min(max, max_dma_phys >> PAGE_SHIFT));
zone_size[ZONE_DMA] = max_dma - min; zone_size[ZONE_DMA] = max_dma - min;
} }
...@@ -126,6 +126,8 @@ static void arm64_memory_present(void) ...@@ -126,6 +126,8 @@ static void arm64_memory_present(void)
void __init arm64_memblock_init(void) void __init arm64_memblock_init(void)
{ {
phys_addr_t dma_phys_limit = 0;
/* Register the kernel text, kernel data and initrd with memblock */ /* Register the kernel text, kernel data and initrd with memblock */
memblock_reserve(__pa(_text), _end - _text); memblock_reserve(__pa(_text), _end - _text);
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
...@@ -141,7 +143,11 @@ void __init arm64_memblock_init(void) ...@@ -141,7 +143,11 @@ void __init arm64_memblock_init(void)
memblock_reserve(__pa(idmap_pg_dir), IDMAP_DIR_SIZE); memblock_reserve(__pa(idmap_pg_dir), IDMAP_DIR_SIZE);
early_init_fdt_scan_reserved_mem(); early_init_fdt_scan_reserved_mem();
dma_contiguous_reserve(0);
/* 4GB maximum for 32-bit only capable devices */
if (IS_ENABLED(CONFIG_ZONE_DMA))
dma_phys_limit = dma_to_phys(NULL, DMA_BIT_MASK(32)) + 1;
dma_contiguous_reserve(dma_phys_limit);
memblock_allow_resize(); memblock_allow_resize();
memblock_dump_all(); memblock_dump_all();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment