1. 13 6月, 2018 3 次提交
    • P
      KVM: PPC: Book3S PR: Fix failure status setting in treclaim. emulation · a50623fb
      Paul Mackerras 提交于
      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: NSimon Guo <wei.guo.simon@gmail.com>
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      a50623fb
    • P
      KVM: PPC: Book3S PR: Fix MSR setting when delivering interrupts · 916ccadc
      Paul Mackerras 提交于
      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: NPaul Mackerras <paulus@ozlabs.org>
      916ccadc
    • C
      KVM: PPC: Book3S PR: Handle additional interrupt types · b71dc519
      Cameron Kaiser 提交于
      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: NCameron Kaiser <spectre@floodgap.com>
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      b71dc519
  2. 01 6月, 2018 25 次提交
  3. 31 5月, 2018 3 次提交
    • S
      KVM: PPC: Book3S PR: Move kvmppc_save_tm/kvmppc_restore_tm to separate file · 009c872a
      Simon Guo 提交于
      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: NSimon Guo <wei.guo.simon@gmail.com>
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      009c872a
    • P
      KVM: PPC: Book3S HV: Factor fake-suspend handling out of kvmppc_save/restore_tm · 7b0e827c
      Paul Mackerras 提交于
      This splits out the handling of "fake suspend" mode, part of the
      hypervisor TM assist code for POWER9, and puts almost all of it in
      new kvmppc_save_tm_hv and kvmppc_restore_tm_hv functions.  The new
      functions branch to kvmppc_save/restore_tm if the CPU does not
      require hypervisor TM assistance.
      
      With this, it will be more straightforward to move kvmppc_save_tm and
      kvmppc_restore_tm to another file and use them for transactional
      memory support in PR KVM.  Additionally, it also makes the code a
      bit clearer and reduces the number of feature sections.
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      7b0e827c
    • P
      KVM: PPC: Book3S PR: Allow KVM_PPC_CONFIGURE_V3_MMU to succeed · 9617a0b3
      Paul Mackerras 提交于
      Currently, PR KVM does not implement the configure_mmu operation, and
      so the KVM_PPC_CONFIGURE_V3_MMU ioctl always fails with an EINVAL
      error.  This causes recent kernels to fail to boot as a PR KVM guest
      on POWER9, since recent kernels booted in HPT mode do the
      H_REGISTER_PROC_TBL hypercall, which causes userspace (QEMU) to do
      KVM_PPC_CONFIGURE_V3_MMU, which fails.
      
      This implements a minimal configure_mmu operation for PR KVM.  It
      succeeds only if the MMU is being configured for HPT mode and no
      process table is being registered.  This is enough to get recent
      kernels to boot as a PR KVM guest.
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Tested-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      9617a0b3
  4. 24 5月, 2018 3 次提交
  5. 22 5月, 2018 6 次提交