1. 05 Aug, 2011 12 commits
    • Anton Blanchard's avatar
      powerpc: Make KVM_GUEST default to n · 643ba4e3
      Anton Blanchard authored
      KVM_GUEST adds a 1 MB array to the kernel (kvm_tmp) which grew
      my kernel enough to cause it to fail to boot.
      
      Dynamically allocating or reducing the size of this array is a
      good idea, but in the meantime I think it makes sense to make
      KVM_GUEST default to n in order to minimise surprises.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      643ba4e3
    • Nishanth Aravamudan's avatar
      powerpc/kvm: Fix build errors with older toolchains · 2c740c58
      Nishanth Aravamudan authored
      On a box with gcc 4.3.2, I see errors like:
      
      arch/powerpc/kvm/book3s_hv_rmhandlers.S:1254: Error: Unrecognized opcode: stxvd2x
      arch/powerpc/kvm/book3s_hv_rmhandlers.S:1316: Error: Unrecognized opcode: lxvd2x
      Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2c740c58
    • Anton Blanchard's avatar
      powerpc: Lack of ibm,io-events not that important! · 53876e38
      Anton Blanchard authored
      The ibm,io-events code is a bit verbose with its error messages.
      Reverse the reporting so we only print when we successfully enable
      I/O event interrupts.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      53876e38
    • Anton Blanchard's avatar
      powerpc: Move kdump default base address to half RMO size on 64bit · 8aa6d359
      Anton Blanchard authored
      We are seeing boot failures on some very large boxes even with
      commit b5416ca9 (powerpc: Move kdump default base address to
      64MB on 64bit).
      
      This patch halves the RMO so both kernels get about the same
      amount of RMO memory. On large machines this region will be
      at least 256MB, so each kernel will get 128MB.
      
      We cap it at 256MB (small SLB size) since some early allocations need
      to be in the bolted SLB region. We could relax this on machines with
      1TB SLBs in a future patch.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8aa6d359
    • David Ahern's avatar
      powerpc/perf: Disable pagefaults during callchain stack read · b59a1bfc
      David Ahern authored
      Panic observed on an older kernel when collecting call chains for
      the context-switch software event:
      
       [<b0180e00>]rb_erase+0x1b4/0x3e8
       [<b00430f4>]__dequeue_entity+0x50/0xe8
       [<b0043304>]set_next_entity+0x178/0x1bc
       [<b0043440>]pick_next_task_fair+0xb0/0x118
       [<b02ada80>]schedule+0x500/0x614
       [<b02afaa8>]rwsem_down_failed_common+0xf0/0x264
       [<b02afca0>]rwsem_down_read_failed+0x34/0x54
       [<b02aed4c>]down_read+0x3c/0x54
       [<b0023b58>]do_page_fault+0x114/0x5e8
       [<b001e350>]handle_page_fault+0xc/0x80
       [<b0022dec>]perf_callchain+0x224/0x31c
       [<b009ba70>]perf_prepare_sample+0x240/0x2fc
       [<b009d760>]__perf_event_overflow+0x280/0x398
       [<b009d914>]perf_swevent_overflow+0x9c/0x10c
       [<b009db54>]perf_swevent_ctx_event+0x1d0/0x230
       [<b009dc38>]do_perf_sw_event+0x84/0xe4
       [<b009dde8>]perf_sw_event_context_switch+0x150/0x1b4
       [<b009de90>]perf_event_task_sched_out+0x44/0x2d4
       [<b02ad840>]schedule+0x2c0/0x614
       [<b0047dc0>]__cond_resched+0x34/0x90
       [<b02adcc8>]_cond_resched+0x4c/0x68
       [<b00bccf8>]move_page_tables+0xb0/0x418
       [<b00d7ee0>]setup_arg_pages+0x184/0x2a0
       [<b0110914>]load_elf_binary+0x394/0x1208
       [<b00d6e28>]search_binary_handler+0xe0/0x2c4
       [<b00d834c>]do_execve+0x1bc/0x268
       [<b0015394>]sys_execve+0x84/0xc8
       [<b001df10>]ret_from_syscall+0x0/0x3c
      
      A page fault occurred walking the callchain while creating a perf
      sample for the context-switch event. To handle the page fault the
      mmap_sem is needed, but it is currently held by setup_arg_pages.
      (setup_arg_pages calls shift_arg_pages with the mmap_sem held.
      shift_arg_pages then calls move_page_tables which has a cond_resched
      at the top of its for loop - hitting that cond_resched is what caused
      the context switch.)
      
      This is an extension of Anton's proposed patch:
      https://lkml.org/lkml/2011/7/24/151
      adding case for 32-bit ppc.
      
      Tested on the system that first generated the panic and then again
      with latest kernel using a PPC VM. I am not able to test the 64-bit
      path - I do not have H/W for it and 64-bit PPC VMs (qemu on Intel)
      is horribly slow.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b59a1bfc
    • Peter Zijlstra's avatar
      ppc: Remove duplicate definition of PV_POWER7 · 501d2386
      Peter Zijlstra authored
      One definition of PV_POWER7 seems enough to me.
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      501d2386
    • Anton Blanchard's avatar
      powerpc: pseries: Fix kexec on machines with more than 4TB of RAM · bed9a315
      Anton Blanchard authored
      On a box with 8TB of RAM the MMU hashtable is 64GB in size. That
      means we have 4G PTEs. pSeries_lpar_hptab_clear was using a signed
      int to store the index which will overflow at 2G.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Cc: <stable@kernel.org>
      Acked-by: default avatarMichael Neuling <mikey@neuling.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      bed9a315
    • Anton Blanchard's avatar
      powerpc: Jump label misalignment causes oops at boot · c113a3ae
      Anton Blanchard authored
      I hit an oops at boot on the first instruction of timer_cpu_notify:
      
      NIP [c000000000722f88] .timer_cpu_notify+0x0/0x388
      
      The code should look like:
      
      c000000000722f78:       eb e9 00 30     ld      r31,48(r9)
      c000000000722f7c:       2f bf 00 00     cmpdi   cr7,r31,0
      c000000000722f80:       40 9e ff 44     bne+    cr7,c000000000722ec4
      c000000000722f84:       4b ff ff 74     b       c000000000722ef8
      
      c000000000722f88 <.timer_cpu_notify>:
      c000000000722f88:       7c 08 02 a6     mflr    r0
      c000000000722f8c:       2f a4 00 07     cmpdi   cr7,r4,7
      c000000000722f90:       fb c1 ff f0     std     r30,-16(r1)
      c000000000722f94:       fb 61 ff d8     std     r27,-40(r1)
      
      But the oops output shows:
      
      eb61ffd8 eb81ffe0 eba1ffe8 ebc1fff0 7c0803a6 ebe1fff8 4e800020
      00000000 ebe90030 c0000000 00ad0a28 00000000 2fa40007 fbc1fff0 fb61ffd8
      
      So we scribbled over our instructions with c000000000ad0a28, which
      is an address inside the jump_table ELF section.
      
      It turns out the jump_table section is only aligned to 8 bytes but
      we are aligning our entries within the section to 16 bytes. This
      means our entries are offset from the table:
      
      c000000000acd4a8 <__start___jump_table>:
              ...
      c000000000ad0a10:       c0 00 00 00     lfs     f0,0(0)
      c000000000ad0a14:       00 70 cd 5c     .long 0x70cd5c
      c000000000ad0a18:       c0 00 00 00     lfs     f0,0(0)
      c000000000ad0a1c:       00 70 cd 90     .long 0x70cd90
      c000000000ad0a20:       c0 00 00 00     lfs     f0,0(0)
      c000000000ad0a24:       00 ac a4 20     .long 0xaca420
      
      And the jump table sort code gets very confused and writes into the
      wrong spot. Remove the alignment, and also remove the padding since
      we it saves some space and we shouldn't need it.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      c113a3ae
    • Anton Blanchard's avatar
      powerpc: Clean up some panic messages in prom_init · fbafd728
      Anton Blanchard authored
      Add a newline to the panic messages in make_room. Also fix a
      comment that suggested our chunk size is 4Mb. It's 1MB.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      fbafd728
    • Anton Blanchard's avatar
      powerpc: Fix device tree claim code · 966728dd
      Anton Blanchard authored
      I have a box that fails in OF during boot with:
      
      DEFAULT CATCH!, exception-handler=fff00400
      at   %SRR0: 49424d2c4c6f6768   %SRR1: 800000004000b002
      
      ie "IBM,Logh". OF got corrupted with a device tree string.
      
      Looking at make_room and alloc_up, we claim the first chunk (1 MB)
      but we never claim any more. mem_end is always set to alloc_top
      which is the top of our available address space, guaranteeing we will
      never call alloc_up and claim more memory.
      
      Also alloc_up wasn't setting alloc_bottom to the bottom of the
      available address space.
      
      This doesn't help the box to boot, but we at least fail with
      an obvious error. We could relocate the device tree in a future
      patch.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      966728dd
    • Scott Wood's avatar
      powerpc: Return the_cpu_ spec from identify_cpu · 26ee9767
      Scott Wood authored
      Commit af9eef3c caused cpu_setup to see
      the_cpu_spec, rather than the source struct.  However, on 32-bit, the
      return value of identify_cpu was being used for feature fixups, and
      identify_cpu was returning the source struct.  So if cpu_setup patches
      the feature bits, the update won't affect the fixups.
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      26ee9767
    • Scott Wood's avatar
      powerpc: mtspr/mtmsr should take an unsigned long · 326ed6a9
      Scott Wood authored
      Add a cast in case the caller passes in a different type, as it would
      if mtspr/mtmsr were functions.
      
      Previously, if a 64-bit type was passed in on 32-bit, GCC would bind the
      constraint to a pair of registers, and would substitute the first register
      in the pair in the asm code.  This corresponds to the upper half of the
      64-bit register, which is generally not the desired behavior.
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      326ed6a9
  2. 04 Aug, 2011 28 commits