]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S PR: Correct errors in H_ENTER implementation
authorPaul Mackerras <paulus@samba.org>
Fri, 20 Sep 2013 04:52:47 +0000 (14:52 +1000)
committerAlexander Graf <agraf@suse.de>
Thu, 17 Oct 2013 12:45:04 +0000 (14:45 +0200)
commit52e0d83c7f728ab8e310ff343b91ad21349f7b84
tree94037f1b656b8a029749061660a7575a8941dd5e
parentcfa8c8d502b43d5da3f50f7f534173e21fe05183
KVM: PPC: Book3S PR: Correct errors in H_ENTER implementation

The implementation of H_ENTER in PR KVM has some errors:

* With H_EXACT not set, if the HPTEG is full, we return H_PTEG_FULL
  as the return value of kvmppc_h_pr_enter, but the caller is expecting
  one of the EMULATE_* values.  The H_PTEG_FULL needs to go in the
  guest's R3 instead.

* With H_EXACT set, if the selected HPTE is already valid, the H_ENTER
  call should return a H_PTEG_FULL error.

This fixes these errors and also makes it write only the selected HPTE,
not the whole group, since only the selected HPTE has been modified.
This also micro-optimizes the calculations involving pte_index and i.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/book3s_pr_papr.c