powerpc/fadump: Fix endianess issues in firmware assisted dump handling
authorHari Bathini <hbathini@linux.vnet.ibm.com>
Wed, 1 Oct 2014 07:02:30 +0000 (12:32 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 30 Oct 2014 05:52:46 +0000 (16:52 +1100)
commit408cddd96e3b155337f9e3aba2198e92e94c6068
tree6000ae44112cace02d07c253a6b867aaea7b038b
parent94966b712c6875939fcdd83cb2707a797e131a43
powerpc/fadump: Fix endianess issues in firmware assisted dump handling

Firmware-assisted dump (fadump) kernel code is not endian safe. The
below patch fixes this issue. Tested this patch with upstream kernel.
Below output shows crash tool successfully opening LE fadump vmcore.

    # crash vmlinux vmcore
    GNU gdb (GDB) 7.6
    This GDB was configured as "powerpc64le-unknown-linux-gnu"...

          KERNEL: vmlinux
        DUMPFILE: vmcore
     CPUS: 16
     DATE: Wed Dec 31 19:00:00 1969
          UPTIME: 00:03:28
    LOAD AVERAGE: 0.46, 0.86, 0.41
           TASKS: 268
        NODENAME: linux-dhr2
         RELEASE: 3.17.0-rc5-7-default
         VERSION: #6 SMP Tue Sep 30 01:06:34 EDT 2014
         MACHINE: ppc64le  (4116 Mhz)
          MEMORY: 40 GB
           PANIC: "Oops: Kernel access of bad area, sig: 11 [#1]" (check log for details)
      PID: 6223
         COMMAND: "bash"
     TASK: c0000009661b2500  [THREAD_INFO: c000000967ac0000]
      CPU: 2
           STATE: TASK_RUNNING (PANIC)

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
[mpe: Make the comment in pSeries_lpar_hptab_clear() clearer]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/fadump.h
arch/powerpc/kernel/fadump.c
arch/powerpc/platforms/pseries/lpar.c