diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2019-03-01 22:56:36 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-03-02 00:25:47 +1100 |
commit | bd3524feac214f0ab9693c6d4c0cb5be8e1318b9 (patch) | |
tree | f76d1cc11bc6fbb35a1aa36019efc8e2bf64d3f6 /arch/powerpc | |
parent | 11f5acce2fa43b015a8120fa7620fa4efd0a2952 (diff) | |
download | linux-bd3524feac214f0ab9693c6d4c0cb5be8e1318b9.tar.bz2 |
powerpc/64s: Fix unrelocated interrupt trampoline address test
The recent commit got this test wrong, it declared the assembler
symbols the wrong way, and also used the wrong symbol name
(xxx_start rather than start_xxx, see asm/head-64.h).
Fixes: ccd477028a ("powerpc/64s: Fix HV NMI vs HV interrupt recoverability test")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/asm-prototypes.h | 8 | ||||
-rw-r--r-- | arch/powerpc/include/asm/sections.h | 7 | ||||
-rw-r--r-- | arch/powerpc/kernel/exceptions-64s.S | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/traps.c | 9 |
4 files changed, 16 insertions, 16 deletions
diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h index effdd096fa4c..296584e6dd55 100644 --- a/arch/powerpc/include/asm/asm-prototypes.h +++ b/arch/powerpc/include/asm/asm-prototypes.h @@ -49,14 +49,6 @@ int exit_vmx_usercopy(void); int enter_vmx_ops(void); void *exit_vmx_ops(void *dest); -/* Exceptions */ -#ifdef CONFIG_PPC_POWERNV -extern unsigned long real_trampolines_start; -extern unsigned long real_trampolines_end; -extern unsigned long virt_trampolines_start; -extern unsigned long virt_trampolines_end; -#endif - /* Traps */ long machine_check_early(struct pt_regs *regs); long hmi_exception_realmode(struct pt_regs *regs); diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h index e335a8f846af..4a1664a8658d 100644 --- a/arch/powerpc/include/asm/sections.h +++ b/arch/powerpc/include/asm/sections.h @@ -17,6 +17,13 @@ extern char __end_interrupts[]; extern char __prom_init_toc_start[]; extern char __prom_init_toc_end[]; +#ifdef CONFIG_PPC_POWERNV +extern char start_real_trampolines[]; +extern char end_real_trampolines[]; +extern char start_virt_trampolines[]; +extern char end_virt_trampolines[]; +#endif + static inline int in_kernel_text(unsigned long addr) { if (addr >= (unsigned long)_stext && addr < (unsigned long)__init_end) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 99312328ee66..a5b8fbae56a0 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -70,10 +70,10 @@ OPEN_FIXED_SECTION(virt_vectors, 0x4000, 0x5900) OPEN_FIXED_SECTION(virt_trampolines, 0x5900, 0x7000) #ifdef CONFIG_PPC_POWERNV - .globl real_trampolines_start - .globl real_trampolines_end - .globl virt_trampolines_start - .globl virt_trampolines_end + .globl start_real_trampolines + .globl end_real_trampolines + .globl start_virt_trampolines + .globl end_virt_trampolines #endif #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index a5757bef03cd..a21200c6aaea 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -419,12 +419,13 @@ void hv_nmi_check_nonrecoverable(struct pt_regs *regs) goto nonrecoverable; if ((nip >= 0xf80 && nip < 0xfa0) || (nip >= 0x4f80 && nip < 0x4fa0)) goto nonrecoverable; + /* Trampoline code runs un-relocated so subtract kbase. */ - if (nip >= real_trampolines_start - kbase && - nip < real_trampolines_end - kbase) + if (nip >= (unsigned long)(start_real_trampolines - kbase) && + nip < (unsigned long)(end_real_trampolines - kbase)) goto nonrecoverable; - if (nip >= virt_trampolines_start - kbase && - nip < virt_trampolines_end - kbase) + if (nip >= (unsigned long)(start_virt_trampolines - kbase) && + nip < (unsigned long)(end_virt_trampolines - kbase)) goto nonrecoverable; return; |