Skip to content

Commit 55d728b

Browse files
committed
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "arm64 fixes that came in during the merge window. There will probably be more to come, but it doesn't seem like it's worth me sitting on these in the meantime. - Fix SCS debug check to report max stack usage in bytes as advertised - Fix typo: CONFIG_FTRACE_WITH_REGS => CONFIG_DYNAMIC_FTRACE_WITH_REGS - Fix incorrect mask in HiSilicon L3C perf PMU driver - Fix compat vDSO compilation under some toolchain configurations - Fix false UBSAN warning from ACPI IORT parsing code - Fix booting under bootloaders that ignore TEXT_OFFSET - Annotate debug initcall function with '__init'" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: warn on incorrect placement of the kernel by the bootloader arm64: acpi: fix UBSAN warning arm64: vdso32: add CONFIG_THUMB2_COMPAT_VDSO drivers/perf: hisi: Fix wrong value for all counters enable arm64: ftrace: Change CONFIG_FTRACE_WITH_REGS to CONFIG_DYNAMIC_FTRACE_WITH_REGS arm64: debug: mark a function as __init to save some memory scs: Report SCS usage in bytes rather than number of entries
2 parents d3ea693 + dd4bc60 commit 55d728b

File tree

8 files changed

+30
-7
lines changed

8 files changed

+30
-7
lines changed

arch/arm64/Kconfig

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,14 @@ config COMPAT_VDSO
12991299
You must have a 32-bit build of glibc 2.22 or later for programs
13001300
to seamlessly take advantage of this.
13011301

1302+
config THUMB2_COMPAT_VDSO
1303+
bool "Compile the 32-bit vDSO for Thumb-2 mode" if EXPERT
1304+
depends on COMPAT_VDSO
1305+
default y
1306+
help
1307+
Compile the compat vDSO with '-mthumb -fomit-frame-pointer' if y,
1308+
otherwise with '-marm'.
1309+
13021310
menuconfig ARMV8_DEPRECATED
13031311
bool "Emulate deprecated/obsolete ARMv8 instructions"
13041312
depends on SYSCTL
@@ -1740,8 +1748,9 @@ config ARM64_DEBUG_PRIORITY_MASKING
17401748
endif
17411749

17421750
config RELOCATABLE
1743-
bool
1751+
bool "Build a relocatable kernel image" if EXPERT
17441752
select ARCH_HAS_RELR
1753+
default y
17451754
help
17461755
This builds the kernel as a Position Independent Executable (PIE),
17471756
which retains all relocation metadata required to relocate the

arch/arm64/include/asm/acpi.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/efi.h>
1313
#include <linux/memblock.h>
1414
#include <linux/psci.h>
15+
#include <linux/stddef.h>
1516

1617
#include <asm/cputype.h>
1718
#include <asm/io.h>
@@ -31,14 +32,14 @@
3132
* is therefore used to delimit the MADT GICC structure minimum length
3233
* appropriately.
3334
*/
34-
#define ACPI_MADT_GICC_MIN_LENGTH ACPI_OFFSET( \
35+
#define ACPI_MADT_GICC_MIN_LENGTH offsetof( \
3536
struct acpi_madt_generic_interrupt, efficiency_class)
3637

3738
#define BAD_MADT_GICC_ENTRY(entry, end) \
3839
(!(entry) || (entry)->header.length < ACPI_MADT_GICC_MIN_LENGTH || \
3940
(unsigned long)(entry) + (entry)->header.length > (end))
4041

41-
#define ACPI_MADT_GICC_SPE (ACPI_OFFSET(struct acpi_madt_generic_interrupt, \
42+
#define ACPI_MADT_GICC_SPE (offsetof(struct acpi_madt_generic_interrupt, \
4243
spe_interrupt) + sizeof(u16))
4344

4445
/* Basic configuration for ACPI */

arch/arm64/kernel/debug-monitors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static int clear_os_lock(unsigned int cpu)
130130
return 0;
131131
}
132132

133-
static int debug_monitors_init(void)
133+
static int __init debug_monitors_init(void)
134134
{
135135
return cpuhp_setup_state(CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING,
136136
"arm64/debug_monitors:starting",

arch/arm64/kernel/ftrace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ static struct plt_entry *get_ftrace_plt(struct module *mod, unsigned long addr)
6969

7070
if (addr == FTRACE_ADDR)
7171
return &plt[FTRACE_PLT_IDX];
72-
if (addr == FTRACE_REGS_ADDR && IS_ENABLED(CONFIG_FTRACE_WITH_REGS))
72+
if (addr == FTRACE_REGS_ADDR &&
73+
IS_ENABLED(CONFIG_DYNAMIC_FTRACE_WITH_REGS))
7374
return &plt[FTRACE_REGS_PLT_IDX];
7475
#endif
7576
return NULL;

arch/arm64/kernel/setup.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ void __init setup_arch(char **cmdline_p)
319319

320320
xen_early_init();
321321
efi_init();
322+
323+
if (!efi_enabled(EFI_BOOT) && ((u64)_text % MIN_KIMG_ALIGN) != 0)
324+
pr_warn(FW_BUG "Kernel image misaligned at boot, please fix your bootloader!");
325+
322326
arm64_memblock_init();
323327

324328
paging_init();

arch/arm64/kernel/vdso32/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ VDSO_CFLAGS += -D__uint128_t='void*'
105105
VDSO_CFLAGS += $(call cc32-disable-warning,shift-count-overflow)
106106
VDSO_CFLAGS += -Wno-int-to-pointer-cast
107107

108+
# Compile as THUMB2 or ARM. Unwinding via frame-pointers in THUMB2 is
109+
# unreliable.
110+
ifeq ($(CONFIG_THUMB2_COMPAT_VDSO), y)
111+
VDSO_CFLAGS += -mthumb -fomit-frame-pointer
112+
else
113+
VDSO_CFLAGS += -marm
114+
endif
115+
108116
VDSO_AFLAGS := $(VDSO_CAFLAGS)
109117
VDSO_AFLAGS += -D__ASSEMBLY__
110118

drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/* L3C has 8-counters */
3636
#define L3C_NR_COUNTERS 0x8
3737

38-
#define L3C_PERF_CTRL_EN 0x20000
38+
#define L3C_PERF_CTRL_EN 0x10000
3939
#define L3C_EVTYPE_NONE 0xff
4040

4141
/*

kernel/scs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static void scs_check_usage(struct task_struct *tsk)
7474
for (p = task_scs(tsk); p < __scs_magic(tsk); ++p) {
7575
if (!READ_ONCE_NOCHECK(*p))
7676
break;
77-
used++;
77+
used += sizeof(*p);
7878
}
7979

8080
while (used > curr) {

0 commit comments

Comments
 (0)