• Paul Mackerras's avatar
    KVM: PPC: Make the H_ENTER hcall more reliable · 075295dd
    Paul Mackerras authored
    At present, our implementation of H_ENTER only makes one try at locking
    each slot that it looks at, and doesn't even retry the ldarx/stdcx.
    atomic update sequence that it uses to attempt to lock the slot.  Thus
    it can return the H_PTEG_FULL error unnecessarily, particularly when
    the H_EXACT flag is set, meaning that the caller wants a specific PTEG
    slot.
    
    This improves the situation by making a second pass when no free HPTE
    slot is found, where we spin until we succeed in locking each slot in
    turn and then check whether it is full while we hold the lock.  If the
    second pass fails, then we return H_PTEG_FULL.
    
    This also moves lock_hpte to a header file (since later commits in this
    series will need to use it from other source files) and renames it to
    try_lock_hpte, which is a somewhat less misleading name.
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    075295dd
kvm_book3s_64.h 2.85 KB