Skip to content

Commit 3e15325

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: "The trickle of arm64 fixes continues to come in. Nothing that's the end of the world, but we've got a fix for PCI IO port accesses, an accidental naked "asm goto" and a fix to the vmcoreinfo PT_NOTE merged this time around which we'd like to get sorted before it becomes ABI. - Fix ioport_map() mapping the wrong physical address for some I/O BARs - Remove direct use of "asm goto", since some compilers don't like that - Ensure kimage_voffset is always present in vmcoreinfo PT_NOTE" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: asm-generic: io: Fix ioport_map() for !CONFIG_GENERIC_IOMAP && CONFIG_INDIRECT_PIO arm64: kernel: arch_crash_save_vmcoreinfo() should depend on CONFIG_CRASH_CORE arm64: jump_label.h: use asm_volatile_goto macro instead of "asm goto"
2 parents f3c0b8c + 500dd23 commit 3e15325

File tree

5 files changed

+24
-14
lines changed

5 files changed

+24
-14
lines changed

arch/arm64/include/asm/jump_label.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
3030
{
31-
asm goto("1: nop\n\t"
31+
asm_volatile_goto("1: nop\n\t"
3232
".pushsection __jump_table, \"aw\"\n\t"
3333
".align 3\n\t"
3434
".quad 1b, %l[l_yes], %c0\n\t"
@@ -42,7 +42,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
4242

4343
static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
4444
{
45-
asm goto("1: b %l[l_yes]\n\t"
45+
asm_volatile_goto("1: b %l[l_yes]\n\t"
4646
".pushsection __jump_table, \"aw\"\n\t"
4747
".align 3\n\t"
4848
".quad 1b, %l[l_yes], %c0\n\t"

arch/arm64/kernel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ arm64-obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o \
5454
arm64-obj-$(CONFIG_ARM64_RELOC_TEST) += arm64-reloc-test.o
5555
arm64-reloc-test-y := reloc_test_core.o reloc_test_syms.o
5656
arm64-obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
57+
arm64-obj-$(CONFIG_CRASH_CORE) += crash_core.o
5758
arm64-obj-$(CONFIG_ARM_SDE_INTERFACE) += sdei.o
5859
arm64-obj-$(CONFIG_ARM64_SSBD) += ssbd.o
5960

arch/arm64/kernel/crash_core.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright (C) Linaro.
4+
* Copyright (C) Huawei Futurewei Technologies.
5+
*/
6+
7+
#include <linux/crash_core.h>
8+
#include <asm/memory.h>
9+
10+
void arch_crash_save_vmcoreinfo(void)
11+
{
12+
VMCOREINFO_NUMBER(VA_BITS);
13+
/* Please note VMCOREINFO_NUMBER() uses "%d", not "%x" */
14+
vmcoreinfo_append_str("NUMBER(kimage_voffset)=0x%llx\n",
15+
kimage_voffset);
16+
vmcoreinfo_append_str("NUMBER(PHYS_OFFSET)=0x%llx\n",
17+
PHYS_OFFSET);
18+
vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset());
19+
}

arch/arm64/kernel/machine_kexec.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -358,14 +358,3 @@ void crash_free_reserved_phys_range(unsigned long begin, unsigned long end)
358358
}
359359
}
360360
#endif /* CONFIG_HIBERNATION */
361-
362-
void arch_crash_save_vmcoreinfo(void)
363-
{
364-
VMCOREINFO_NUMBER(VA_BITS);
365-
/* Please note VMCOREINFO_NUMBER() uses "%d", not "%x" */
366-
vmcoreinfo_append_str("NUMBER(kimage_voffset)=0x%llx\n",
367-
kimage_voffset);
368-
vmcoreinfo_append_str("NUMBER(PHYS_OFFSET)=0x%llx\n",
369-
PHYS_OFFSET);
370-
vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset());
371-
}

include/asm-generic/io.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,8 @@ static inline void __iomem *ioremap_wt(phys_addr_t offset, size_t size)
10261026
#define ioport_map ioport_map
10271027
static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
10281028
{
1029-
return PCI_IOBASE + (port & MMIO_UPPER_LIMIT);
1029+
port &= IO_SPACE_LIMIT;
1030+
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
10301031
}
10311032
#endif
10321033

0 commit comments

Comments
 (0)