1. 01 6月, 2018 5 次提交
  2. 20 4月, 2017 1 次提交
  3. 27 9月, 2016 2 次提交
    • T
      KVM: PPC: Book3s PR: Allow access to unprivileged MMCR2 register · fa73c3b2
      Thomas Huth 提交于
      The MMCR2 register is available twice, one time with number 785
      (privileged access), and one time with number 769 (unprivileged,
      but it can be disabled completely). In former times, the Linux
      kernel was using the unprivileged register 769 only, but since
      commit 8dd75ccb ("powerpc: Use privileged SPR number
      for MMCR2"), it uses the privileged register 785 instead.
      The KVM-PR code then of course also switched to use the SPR 785,
      but this is causing older guest kernels to crash, since these
      kernels still access 769 instead. So to support older kernels
      with KVM-PR again, we have to support register 769 in KVM-PR, too.
      
      Fixes: 8dd75ccb
      Cc: stable@vger.kernel.org # v3.10+
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      fa73c3b2
    • P
      KVM: PPC: Book3S: Treat VTB as a per-subcore register, not per-thread · 88b02cf9
      Paul Mackerras 提交于
      POWER8 has one virtual timebase (VTB) register per subcore, not one
      per CPU thread.  The HV KVM code currently treats VTB as a per-thread
      register, which can lead to spurious soft lockup messages from guests
      which use the VTB as the time source for the soft lockup detector.
      (CPUs before POWER8 did not have the VTB register.)
      
      For HV KVM, this fixes the problem by making only the primary thread
      in each virtual core save and restore the VTB value.  With this,
      the VTB state becomes part of the kvmppc_vcore structure.  This
      also means that "piggybacking" of multiple virtual cores onto one
      subcore is not possible on POWER8, because then the virtual cores
      would share a single VTB register.
      
      PR KVM emulates a VTB register, which is per-vcpu because PR KVM
      has no notion of CPU threads or SMT.  For PR KVM we move the VTB
      state into the kvmppc_vcpu_book3s struct.
      
      Cc: stable@vger.kernel.org # v3.14+
      Reported-by: NThomas Huth <thuth@redhat.com>
      Tested-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
      88b02cf9
  4. 22 8月, 2015 1 次提交
    • T
      KVM: PPC: Fix warnings from sparse · 5358a963
      Thomas Huth 提交于
      When compiling the KVM code for POWER with "make C=1", sparse
      complains about functions missing proper prototypes and a 64-bit
      constant missing the ULL prefix. Let's fix this by making the
      functions static or by including the proper header with the
      prototypes, and by appending a ULL prefix to the constant
      PPC_MPPE_ADDRESS_MASK.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      5358a963
  5. 31 7月, 2014 1 次提交
    • A
      KVM: PPC: PR: Handle FSCR feature deselects · 8e6afa36
      Alexander Graf 提交于
      We handle FSCR feature bits (well, TAR only really today) lazily when the guest
      starts using them. So when a guest activates the bit and later uses that feature
      we enable it for real in hardware.
      
      However, when the guest stops using that bit we don't stop setting it in
      hardware. That means we can potentially lose a trap that the guest expects to
      happen because it thinks a feature is not active.
      
      This patch adds support to drop TAR when then guest turns it off in FSCR. While
      at it it also restricts FSCR access to 64bit systems - 32bit ones don't have it.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8e6afa36
  6. 28 7月, 2014 2 次提交
  7. 06 7月, 2014 1 次提交
  8. 30 5月, 2014 9 次提交
  9. 17 10月, 2013 3 次提交
    • A
      kvm: powerpc: book3s: Support building HV and PR KVM as module · 2ba9f0d8
      Aneesh Kumar K.V 提交于
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      [agraf: squash in compile fix]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      2ba9f0d8
    • A
      kvm: powerpc: Add kvmppc_ops callback · 3a167bea
      Aneesh Kumar K.V 提交于
      This patch add a new callback kvmppc_ops. This will help us in enabling
      both HV and PR KVM together in the same kernel. The actual change to
      enable them together is done in the later patch in the series.
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      [agraf: squash in booke changes]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3a167bea
    • P
      KVM: PPC: Book3S PR: Keep volatile reg values in vcpu rather than shadow_vcpu · a2d56020
      Paul Mackerras 提交于
      Currently PR-style KVM keeps the volatile guest register values
      (R0 - R13, CR, LR, CTR, XER, PC) in a shadow_vcpu struct rather than
      the main kvm_vcpu struct.  For 64-bit, the shadow_vcpu exists in two
      places, a kmalloc'd struct and in the PACA, and it gets copied back
      and forth in kvmppc_core_vcpu_load/put(), because the real-mode code
      can't rely on being able to access the kmalloc'd struct.
      
      This changes the code to copy the volatile values into the shadow_vcpu
      as one of the last things done before entering the guest.  Similarly
      the values are copied back out of the shadow_vcpu to the kvm_vcpu
      immediately after exiting the guest.  We arrange for interrupts to be
      still disabled at this point so that we can't get preempted on 64-bit
      and end up copying values from the wrong PACA.
      
      This means that the accessor functions in kvm_book3s.h for these
      registers are greatly simplified, and are same between PR and HV KVM.
      In places where accesses to shadow_vcpu fields are now replaced by
      accesses to the kvm_vcpu, we can also remove the svcpu_get/put pairs.
      Finally, on 64-bit, we don't need the kmalloc'd struct at all any more.
      
      With this, the time to read the PVR one million times in a loop went
      from 567.7ms to 575.5ms (averages of 6 values), an increase of about
      1.4% for this worse-case test for guest entries and exits.  The
      standard deviation of the measurements is about 11ms, so the
      difference is only marginally significant statistically.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a2d56020
  10. 08 7月, 2013 1 次提交
  11. 27 4月, 2013 2 次提交
  12. 10 1月, 2013 2 次提交
  13. 06 12月, 2012 1 次提交
  14. 06 5月, 2012 2 次提交
    • A
      KVM: PPC: Emulator: clean up SPR reads and writes · 54771e62
      Alexander Graf 提交于
      When reading and writing SPRs, every SPR emulation piece had to read
      or write the respective GPR the value was read from or stored in itself.
      
      This approach is pretty prone to failure. What if we accidentally
      implement mfspr emulation where we just do "break" and nothing else?
      Suddenly we would get a random value in the return register - which is
      always a bad idea.
      
      So let's consolidate the generic code paths and only give the core
      specific SPR handling code readily made variables to read/write from/to.
      
      Functionally, this patch doesn't change anything, but it increases the
      readability of the code and makes is less prone to bugs.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      54771e62
    • A
      KVM: PPC: Emulator: clean up instruction parsing · c46dc9a8
      Alexander Graf 提交于
      Instructions on PPC are pretty similarly encoded. So instead of
      every instruction emulation code decoding the instruction fields
      itself, we can move that code to more generic places and rely on
      the compiler to optimize the unused bits away.
      
      This has 2 advantages. It makes the code smaller and it makes the
      code less error prone, as the instruction fields are always
      available, so accidental misusage is reduced.
      
      Functionally, this patch doesn't change anything.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      c46dc9a8
  15. 02 4月, 2012 1 次提交
  16. 05 3月, 2012 1 次提交
  17. 26 9月, 2011 2 次提交
  18. 24 10月, 2010 3 次提交