OSDN Git Service

KVM: PPC: Book3S PR: Sync TM bits to shadow msr for problem state guest
authorSimon Guo <wei.guo.simon@gmail.com>
Wed, 23 May 2018 07:01:53 +0000 (15:01 +0800)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 1 Jun 2018 00:29:33 +0000 (10:29 +1000)
commit95757bfc72e9f08905bf6b68d5b8903db205e681
tree769f08fc7ac63104cfb3df5893c0302ff094727d
parent901938add3bd598bf641672a85e644ac07e77e9a
KVM: PPC: Book3S PR: Sync TM bits to shadow msr for problem state guest

MSR TS bits can be modified with non-privileged instruction such as
tbegin./tend.  That means guest can change MSR value "silently" without
notifying host.

It is necessary to sync the TM bits to host so that host can calculate
shadow msr correctly.

Note, privileged mode in the guest will always fail transactions so we
only take care of problem state mode in the guest.

The logic is put into kvmppc_copy_from_svcpu() so that
kvmppc_handle_exit_pr() can use correct MSR TM bits even when preemption
occurs.

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