1. 12 Jun, 2018 5 commits
    • Paul Mackerras's avatar
      KVM: PPC: Book3S PR: Enable use on POWER9 bare-metal hosts in HPT mode · db96a04a
      Paul Mackerras authored
      It turns out that PR KVM has no dependency on the format of HPTEs,
      because it uses functions pointed to by mmu_hash_ops which do all
      the formatting and interpretation of HPTEs.  Thus we can allow PR
      KVM to load on POWER9 bare-metal hosts as long as they are running
      in HPT mode.
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      db96a04a
    • Paul Mackerras's avatar
      KVM: PPC: Book3S PR: Don't let PAPR guest set MSR hypervisor bit · 4f169d21
      Paul Mackerras authored
      PAPR guests run in supervisor mode and should not be able to set the
      MSR HV (hypervisor mode) bit or clear the ME (machine check enable)
      bit by mtmsrd or any other means.  To enforce this, we force MSR_HV
      off and MSR_ME on in kvmppc_set_msr_pr.  Without this, the guest
      can appear to be in hypervisor mode to itself and to userspace.
      This has been observed to cause a crash in QEMU when it tries to
      deliver a system reset interrupt to the guest.
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      4f169d21
    • Paul Mackerras's avatar
      KVM: PPC: Book3S PR: Fix failure status setting in treclaim. emulation · a50623fb
      Paul Mackerras authored
      The treclaim. emulation needs to record failure status in the TEXASR
      register if the transaction had not previously failed.  However, the
      current code first does kvmppc_save_tm_pr() (which does a treclaim.
      itself) and then checks the failure summary bit in TEXASR after that.
      Since treclaim. itself causes transaction failure, the FS bit is
      always set, so we were never updating TEXASR with the failure cause
      supplied by the guest as the RA parameter to the treclaim. instruction.
      This caused the tm-unavailable test in tools/testing/selftests/powerpc/tm
      to fail.
      
      To fix this, we need to read TEXASR before calling kvmppc_save_tm_pr(),
      and base the final value of TEXASR on that value.
      
      Fixes: 03c81682 ("KVM: PPC: Book3S PR: Add emulation for treclaim.")
      Reviewed-by: default avatarSimon Guo <wei.guo.simon@gmail.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      a50623fb
    • Paul Mackerras's avatar
      KVM: PPC: Book3S PR: Fix MSR setting when delivering interrupts · 916ccadc
      Paul Mackerras authored
      This makes sure that MSR "partial-function" bits are not transferred
      to SRR1 when delivering an interrupt.  This was causing failures in
      guests running kernels that include commit f3d96e69 ("powerpc/mm:
      Overhaul handling of bad page faults", 2017-07-19), which added code
      to check bits of SRR1 on instruction storage interrupts (ISIs) that
      indicate a bad page fault.  The symptom was that a guest user program
      that handled a signal and attempted to return from the signal handler
      would get a SIGBUS signal and die.
      
      The code that generated ISIs and some other interrupts would
      previously set bits in the guest MSR to indicate the interrupt status
      and then call kvmppc_book3s_queue_irqprio().  This technique no
      longer works now that kvmppc_inject_interrupt() is masking off those
      bits.  Instead we make kvmppc_core_queue_data_storage() and
      kvmppc_core_queue_inst_storage() call kvmppc_inject_interrupt()
      directly, and make sure that all the places that generate ISIs or
      DSIs call kvmppc_core_queue_{data,inst}_storage instead of
      kvmppc_book3s_queue_irqprio().
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      916ccadc
    • Cameron Kaiser's avatar
      KVM: PPC: Book3S PR: Handle additional interrupt types · b71dc519
      Cameron Kaiser authored
      This adds trivial handling for additional interrupt types that KVM-PR must
      support for proper virtualization on a POWER9 host in HPT mode, as a further
      prerequisite to enabling KVM-PR on that configuration.
      Signed-off-by: default avatarCameron Kaiser <spectre@floodgap.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      b71dc519
  2. 01 Jun, 2018 25 commits
  3. 31 May, 2018 1 commit
    • Simon Guo's avatar
      KVM: PPC: Book3S PR: Move kvmppc_save_tm/kvmppc_restore_tm to separate file · 009c872a
      Simon Guo authored
      It is a simple patch just for moving kvmppc_save_tm/kvmppc_restore_tm()
      functionalities to tm.S. There is no logic change. The reconstruct of
      those APIs will be done in later patches to improve readability.
      
      It is for preparation of reusing those APIs on both HV/PR PPC KVM.
      
      Some slight change during move the functions includes:
      - surrounds some HV KVM specific code with CONFIG_KVM_BOOK3S_HV_POSSIBLE
      for compilation.
      - use _GLOBAL() to define kvmppc_save_tm/kvmppc_restore_tm()
      
      [paulus@ozlabs.org - rebased on top of 7b0e827c ("KVM: PPC: Book3S HV:
       Factor fake-suspend handling out of kvmppc_save/restore_tm", 2018-05-30)]
      Signed-off-by: default avatarSimon Guo <wei.guo.simon@gmail.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      009c872a
  4. 30 May, 2018 3 commits
  5. 24 May, 2018 3 commits
  6. 22 May, 2018 3 commits