Merge tag 'signed-for-3.16' of git://github.com/agraf/linux-2.6 into kvm-master
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Jul 2014 10:08:58 +0000 (12:08 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Jul 2014 10:08:58 +0000 (12:08 +0200)
Patch queue for 3.16 - 2014-07-08

A few bug fixes to make 3.16 work well with KVM on PowerPC:

  - Fix ppc32 module builds
  - Fix Little Endian hosts
  - Fix Book3S HV HPTE lookup with huge pages in guest
  - Fix BookE lock leak

1  2 
arch/powerpc/kvm/book3s_hv_rmhandlers.S

index 868347ef09fd48bcf8bfd343becb49f6898887c5,8d9c5d21179d2a91d241f90eb49324a0761a0dc5..558a67df8126434eb427c7ca24eebabb82676cac
@@@ -48,7 -48,7 +48,7 @@@
   *
   * LR = return address to continue at after eventually re-enabling MMU
   */
- _GLOBAL(kvmppc_hv_entry_trampoline)
+ _GLOBAL_TOC(kvmppc_hv_entry_trampoline)
        mflr    r0
        std     r0, PPC_LR_STKOFF(r1)
        stdu    r1, -112(r1)
@@@ -2257,28 -2257,15 +2257,28 @@@ machine_check_realmode
        mr      r3, r9          /* get vcpu pointer */
        bl      kvmppc_realmode_machine_check
        nop
 -      cmpdi   r3, 0           /* continue exiting from guest? */
 +      cmpdi   r3, 0           /* Did we handle MCE ? */
        ld      r9, HSTATE_KVM_VCPU(r13)
        li      r12, BOOK3S_INTERRUPT_MACHINE_CHECK
 -      beq     mc_cont
 +      /*
 +       * Deliver unhandled/fatal (e.g. UE) MCE errors to guest through
 +       * machine check interrupt (set HSRR0 to 0x200). And for handled
 +       * errors (no-fatal), just go back to guest execution with current
 +       * HSRR0 instead of exiting guest. This new approach will inject
 +       * machine check to guest for fatal error causing guest to crash.
 +       *
 +       * The old code used to return to host for unhandled errors which
 +       * was causing guest to hang with soft lockups inside guest and
 +       * makes it difficult to recover guest instance.
 +       */
 +      ld      r10, VCPU_PC(r9)
 +      ld      r11, VCPU_MSR(r9)
 +      bne     2f      /* Continue guest execution. */
        /* If not, deliver a machine check.  SRR0/1 are already set */
        li      r10, BOOK3S_INTERRUPT_MACHINE_CHECK
        ld      r11, VCPU_MSR(r9)
        bl      kvmppc_msr_interrupt
 -      b       fast_interrupt_c_return
 +2:    b       fast_interrupt_c_return
  
  /*
   * Check the reason we woke from nap, and take appropriate action.