KVM: PPC: Book3S PR: Add guard code to prevent returning to guest with PR=0 and Trans...
authorSimon Guo <wei.guo.simon@gmail.com>
Wed, 23 May 2018 07:02:06 +0000 (15:02 +0800)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 1 Jun 2018 00:30:39 +0000 (10:30 +1000)
commit68ab07b985764ec5be816e7054a84b7ad121afc7
treeffbbcc23ebd5a6dff17e29fd1b0da97fc0b40f00
parent26798f88d58dff1b61abf04becf5055e6f860d4f
KVM: PPC: Book3S PR: Add guard code to prevent returning to guest with PR=0 and Transactional state

Currently PR KVM doesn't support transaction memory in guest privileged
state.

This patch adds a check at setting guest msr, so that we can never return
to guest with PR=0 and TS=0b10. A tabort will be emulated to indicate
this and fail transaction immediately.

[paulus@ozlabs.org - don't change the TM_CAUSE_MISC definition, instead
 use TM_CAUSE_KVM_FAC_UNAV.]

Signed-off-by: Simon Guo <wei.guo.simon@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s.h
arch/powerpc/kvm/book3s_emulate.c
arch/powerpc/kvm/book3s_pr.c