android_kernel_oneplus_msm8998/arch/parisc/kernel
John David Anglin 7d39307dd6 parisc: Fix address in HPMC IVA
commit 1138b6718ff74d2a934459643e3754423d23b5e2 upstream.

Helge noticed that the address of the os_hpmc handler was not being
correctly calculated in the hpmc macro.  As a result, PDCE_CHECK would
fail to call os_hpmc:

<Cpu2> e800009802e00000  0000000000000000  CC_ERR_CHECK_HPMC
<Cpu2> 37000f7302e00000  8040004000000000  CC_ERR_CPU_CHECK_SUMMARY
<Cpu2> f600105e02e00000  fffffff0f0c00000  CC_MC_HPMC_MONARCH_SELECTED
<Cpu2> 140003b202e00000  000000000000000b  CC_ERR_HPMC_STATE_ENTRY
<Cpu2> 5600100b02e00000  00000000000001a0  CC_MC_OS_HPMC_LEN_ERR
<Cpu2> 5600106402e00000  fffffff0f0438e70  CC_MC_BR_TO_OS_HPMC_FAILED
<Cpu2> e800009802e00000  0000000000000000  CC_ERR_CHECK_HPMC
<Cpu2> 37000f7302e00000  8040004000000000  CC_ERR_CPU_CHECK_SUMMARY
<Cpu2> 4000109f02e00000  0000000000000000  CC_MC_HPMC_INITIATED
<Cpu2> 4000101902e00000  0000000000000000  CC_MC_MULTIPLE_HPMCS
<Cpu2> 030010d502e00000  0000000000000000  CC_CPU_STOP

The address problem can be seen by dumping the fault vector:

0000000040159000 <fault_vector_20>:
    40159000:   63 6f 77 73     stb r15,-2447(dp)
    40159004:   20 63 61 6e     ldil L%b747000,r3
    40159008:   20 66 6c 79     ldil L%-1c3b3000,r3
        ...
    40159020:   08 00 02 40     nop
    40159024:   20 6e 60 02     ldil L%15d000,r3
    40159028:   34 63 00 00     ldo 0(r3),r3
    4015902c:   e8 60 c0 02     bv,n r0(r3)
    40159030:   08 00 02 40     nop
    40159034:   00 00 00 00     break 0,0
    40159038:   c0 00 70 00     bb,*< r0,sar,40159840 <fault_vector_20+0x840>
    4015903c:   00 00 00 00     break 0,0

Location 40159038 should contain the physical address of os_hpmc:

000000004015d000 <os_hpmc>:
    4015d000:   08 1a 02 43     copy r26,r3
    4015d004:   01 c0 08 a4     mfctl iva,r4
    4015d008:   48 85 00 68     ldw 34(r4),r5

This patch moves the address setup into initialize_ivt to resolve the
above problem.  I tested the change by dumping the HPMC entry after setup:

0000000040209020:  8000240
0000000040209024: 206a2004
0000000040209028: 34630ac0
000000004020902c: e860c002
0000000040209030:  8000240
0000000040209034: 1bdddce6
0000000040209038:   15d000
000000004020903c:      1a0

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-21 09:27:30 +01:00
..
.gitignore
asm-offsets.c parisc: Unbreak handling exceptions from kernel modules 2016-04-20 15:41:52 +09:00
audit.c
binfmt_elf32.c
cache.c parisc: Fix TLB related boot crash on SMP machines 2016-12-15 08:49:22 -08:00
compat_audit.c
drivers.c parisc: Fix out of array access in match_pci_device() 2018-04-24 09:32:03 +02:00
entry.S parisc: Fix address in HPMC IVA 2018-11-21 09:27:30 +01:00
firmware.c
ftrace.c
hardware.c
head.S parisc: Increase initial kernel mapping to 32MB on 64bit kernel 2015-11-22 12:22:53 +01:00
hpmc.S
inventory.c
irq.c parisc: Filter out spurious interrupts in PA-RISC irq handler 2015-09-08 15:31:16 +02:00
Makefile
module.c mm: vmalloc: pass additional vm_flags to __vmalloc_node_range() 2015-02-13 21:21:42 -08:00
pa7300lc.c
pacache.S parisc: Define mb() and add memory barriers to assembler unlock sequences 2018-08-15 17:42:05 +02:00
parisc_ksyms.c parisc: Avoid function pointers for kernel exception routines 2016-04-20 15:41:52 +09:00
pci-dma.c parisc: Fix race in pci-dma.c 2016-12-02 09:09:01 +01:00
pci.c parisc: Remove unused pcibios_init_bus() 2015-12-12 16:07:35 +01:00
pdc_chassis.c
pdc_cons.c parisc: don't use module_init for non-modular core pdc_cons code 2015-06-16 14:12:30 -04:00
perf.c parisc: perf: Fix potential NULL pointer dereference 2017-10-08 10:14:19 +02:00
perf_asm.S
perf_images.h
process.c parisc: copy_thread(): rename 'arg' argument to 'kthread_arg' 2015-04-24 13:45:55 +02:00
processor.c
ptrace.c parisc: Fix ptrace syscall number and return value modification 2016-03-09 15:34:50 -08:00
real2.S
setup.c parisc: Fix races in parisc_setup_cache_timing() 2016-12-02 09:09:01 +01:00
signal.c parisc: Fix syscall restarts 2015-12-21 10:16:18 +01:00
signal32.c
signal32.h
smp.c parisc: Remove unused function 2015-02-17 10:41:19 +01:00
stacktrace.c
sys_parisc.c mm: larger stack guard gap, between vmas 2017-06-26 07:13:11 +02:00
sys_parisc32.c
syscall.S parisc: Remove ordered stores from syscall.S 2018-08-24 13:27:00 +02:00
syscall_table.S parisc: use compat_sys_keyctl() 2017-07-21 07:44:56 +02:00
time.c parisc: Use platform_device_register_simple("rtc-generic") 2015-09-08 17:53:48 +02:00
topology.c
traps.c parisc: Fix address in HPMC IVA 2018-11-21 09:27:30 +01:00
unaligned.c parisc: Fix pagefault crash in unaligned __get_user() call 2016-06-24 10:18:20 -07:00
unwind.c
vmlinux.lds.S parisc: Fix kernel memory layout regarding position of __gp 2016-10-28 03:01:27 -04:00