• Paul Mackerras's avatar
    KVM: PPC: Book3S: Treat VTB as a per-subcore register, not per-thread · 469a46b4
    Paul Mackerras authored
    commit 88b02cf9 upstream.
    
    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.
    Reported-by: default avatarThomas Huth <thuth@redhat.com>
    Tested-by: default avatarThomas Huth <thuth@redhat.com>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    [bwh: Backported to 3.16:
     - Adjust filenames, context
     - Drop changes to kvmppc_core_emulate_mfspr_pr(), can_piggyback_subcore(),
       kvmppc_copy_from_svcpu()]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    469a46b4
kvm_book3s.h 10 KB