]> git.karo-electronics.de Git - mv-sheeva.git/commit
KVM: PPC: Make the H_ENTER hcall more reliable
authorPaul Mackerras <paulus@samba.org>
Mon, 12 Dec 2011 12:30:16 +0000 (12:30 +0000)
committerAvi Kivity <avi@redhat.com>
Mon, 5 Mar 2012 12:52:36 +0000 (14:52 +0200)
commit075295dd322b0c0de0c9ecf8e0cb19ee813438ed
tree5e87ae30e3d74feaf2f39f919529f21518e6e17a
parent93e602490c1da83162a8b6ba86b4b48a7a0f0c9e
KVM: PPC: Make the H_ENTER hcall more reliable

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: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/include/asm/kvm_book3s_64.h
arch/powerpc/kvm/book3s_hv_rm_mmu.c