Skip to content

Commit 26d189b

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "This small set of fixes addresses a few issues introduced during the merge window, including: - fix typo in I-cache detection that was causing us to treat all I-caches as aliasing - hook up memfd_create and getrandom syscalls for native and compat - revert a temporary hack for defconfig builds in -next (the audit tree changes didn't make it in this merge window) - a couple of UEFI fixes for TEXT_OFFSET fuzzing and /memreserve/ - a simple sparsemem fix for 48-bit physical addressing - small defconfig updates to get autotesters working with X-gene" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: Revert "arm64: Do not invoke audit_syscall_* functions if !CONFIG_AUDIT_SYSCALL" arm64: mm: update max pa bits to 48 arm64: ignore DT memreserve entries when booting in UEFI mode arm64: configs: Enable X-Gene SATA and ethernet in defconfig arm64: align randomized TEXT_OFFSET on 4 kB boundary asm-generic: add memfd_create system call to unistd.h arm64: compat: wire up memfd_create and getrandom syscalls for aarch32 arm64: fix typo in I-cache policy detection
2 parents 1ae45cf + 44b3750 commit 26d189b

File tree

11 files changed

+24
-14
lines changed

11 files changed

+24
-14
lines changed

arch/arm64/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ head-y := arch/arm64/kernel/head.o
3939

4040
# The byte offset of the kernel image in RAM from the start of RAM.
4141
ifeq ($(CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET), y)
42-
TEXT_OFFSET := $(shell awk 'BEGIN {srand(); printf "0x%04x0\n", int(65535 * rand())}')
42+
TEXT_OFFSET := $(shell awk 'BEGIN {srand(); printf "0x%03x000\n", int(512 * rand())}')
4343
else
4444
TEXT_OFFSET := 0x00080000
4545
endif

arch/arm64/configs/defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,16 @@ CONFIG_VIRTIO_BLK=y
6464
CONFIG_BLK_DEV_SD=y
6565
# CONFIG_SCSI_LOWLEVEL is not set
6666
CONFIG_ATA=y
67+
CONFIG_AHCI_XGENE=y
68+
CONFIG_PHY_XGENE=y
6769
CONFIG_PATA_PLATFORM=y
6870
CONFIG_PATA_OF_PLATFORM=y
6971
CONFIG_NETDEVICES=y
7072
CONFIG_TUN=y
7173
CONFIG_VIRTIO_NET=y
7274
CONFIG_SMC91X=y
7375
CONFIG_SMSC911X=y
76+
CONFIG_NET_XGENE=y
7477
# CONFIG_WLAN is not set
7578
CONFIG_INPUT_EVDEV=y
7679
# CONFIG_SERIO_SERPORT is not set

arch/arm64/include/asm/sparsemem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define __ASM_SPARSEMEM_H
1818

1919
#ifdef CONFIG_SPARSEMEM
20-
#define MAX_PHYSMEM_BITS 40
20+
#define MAX_PHYSMEM_BITS 48
2121
#define SECTION_SIZE_BITS 30
2222
#endif
2323

arch/arm64/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#define __ARM_NR_compat_cacheflush (__ARM_NR_COMPAT_BASE+2)
4242
#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE+5)
4343

44-
#define __NR_compat_syscalls 383
44+
#define __NR_compat_syscalls 386
4545
#endif
4646

4747
#define __ARCH_WANT_SYS_CLONE

arch/arm64/include/asm/unistd32.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,3 +787,8 @@ __SYSCALL(__NR_sched_setattr, sys_sched_setattr)
787787
__SYSCALL(__NR_sched_getattr, sys_sched_getattr)
788788
#define __NR_renameat2 382
789789
__SYSCALL(__NR_renameat2, sys_renameat2)
790+
/* 383 for seccomp */
791+
#define __NR_getrandom 384
792+
__SYSCALL(__NR_getrandom, sys_getrandom)
793+
#define __NR_memfd_create 385
794+
__SYSCALL(__NR_memfd_create, sys_memfd_create)

arch/arm64/kernel/cpuinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info)
4949

5050
if (l1ip != ICACHE_POLICY_PIPT)
5151
set_bit(ICACHEF_ALIASING, &__icache_flags);
52-
if (l1ip == ICACHE_POLICY_AIVIVT);
52+
if (l1ip == ICACHE_POLICY_AIVIVT)
5353
set_bit(ICACHEF_AIVIVT, &__icache_flags);
5454

5555
pr_info("Detected %s I-cache on CPU%d\n", icache_policy_str[l1ip], cpu);

arch/arm64/kernel/efi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ static __init void reserve_regions(void)
188188
if (uefi_debug)
189189
pr_cont("\n");
190190
}
191+
192+
set_bit(EFI_MEMMAP, &efi.flags);
191193
}
192194

193195

arch/arm64/kernel/head.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838

3939
#define KERNEL_RAM_VADDR (PAGE_OFFSET + TEXT_OFFSET)
4040

41-
#if (TEXT_OFFSET & 0xf) != 0
42-
#error TEXT_OFFSET must be at least 16B aligned
43-
#elif (PAGE_OFFSET & 0xfffff) != 0
41+
#if (TEXT_OFFSET & 0xfff) != 0
42+
#error TEXT_OFFSET must be at least 4KB aligned
43+
#elif (PAGE_OFFSET & 0x1fffff) != 0
4444
#error PAGE_OFFSET must be at least 2MB aligned
45-
#elif TEXT_OFFSET > 0xfffff
45+
#elif TEXT_OFFSET > 0x1fffff
4646
#error TEXT_OFFSET must be less than 2MB
4747
#endif
4848

arch/arm64/kernel/ptrace.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,19 +1115,15 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs)
11151115
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
11161116
trace_sys_enter(regs, regs->syscallno);
11171117

1118-
#ifdef CONFIG_AUDITSYSCALL
11191118
audit_syscall_entry(syscall_get_arch(), regs->syscallno,
11201119
regs->orig_x0, regs->regs[1], regs->regs[2], regs->regs[3]);
1121-
#endif
11221120

11231121
return regs->syscallno;
11241122
}
11251123

11261124
asmlinkage void syscall_trace_exit(struct pt_regs *regs)
11271125
{
1128-
#ifdef CONFIG_AUDITSYSCALL
11291126
audit_syscall_exit(regs);
1130-
#endif
11311127

11321128
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
11331129
trace_sys_exit(regs, regs_return_value(regs));

arch/arm64/mm/init.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <linux/of_fdt.h>
3333
#include <linux/dma-mapping.h>
3434
#include <linux/dma-contiguous.h>
35+
#include <linux/efi.h>
3536

3637
#include <asm/fixmap.h>
3738
#include <asm/sections.h>
@@ -148,7 +149,8 @@ void __init arm64_memblock_init(void)
148149
memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start);
149150
#endif
150151

151-
early_init_fdt_scan_reserved_mem();
152+
if (!efi_enabled(EFI_MEMMAP))
153+
early_init_fdt_scan_reserved_mem();
152154

153155
/* 4GB maximum for 32-bit only capable devices */
154156
if (IS_ENABLED(CONFIG_ZONE_DMA))

include/uapi/asm-generic/unistd.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,11 @@ __SYSCALL(__NR_renameat2, sys_renameat2)
703703
__SYSCALL(__NR_seccomp, sys_seccomp)
704704
#define __NR_getrandom 278
705705
__SYSCALL(__NR_getrandom, sys_getrandom)
706+
#define __NR_memfd_create 279
707+
__SYSCALL(__NR_memfd_create, sys_memfd_create)
706708

707709
#undef __NR_syscalls
708-
#define __NR_syscalls 279
710+
#define __NR_syscalls 280
709711

710712
/*
711713
* All syscalls below here should go away really,

0 commit comments

Comments
 (0)