diff options
author | Michael Neuling | 2014-03-25 00:47:02 +0100 |
---|---|---|
committer | Paul Mackerras | 2014-03-29 09:58:02 +0100 |
commit | e4e38121507a27d2ccc4b28d9e7fc4818a12c44c (patch) | |
tree | dc4779cee60b960a59bbd246d6a68faac292fc2a /arch/powerpc/kvm/book3s_64_mmu_hv.c | |
parent | KVM: PPC: Book3S HV: Fix KVM hang with CONFIG_KVM_XICS=n (diff) | |
download | kernel-qcow2-linux-e4e38121507a27d2ccc4b28d9e7fc4818a12c44c.tar.gz kernel-qcow2-linux-e4e38121507a27d2ccc4b28d9e7fc4818a12c44c.tar.xz kernel-qcow2-linux-e4e38121507a27d2ccc4b28d9e7fc4818a12c44c.zip |
KVM: PPC: Book3S HV: Add transactional memory support
This adds saving of the transactional memory (TM) checkpointed state
on guest entry and exit. We only do this if we see that the guest has
an active transaction.
It also adds emulation of the TM state changes when delivering IRQs
into the guest. According to the architecture, if we are
transactional when an IRQ occurs, the TM state is changed to
suspended, otherwise it's left unchanged.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/kvm/book3s_64_mmu_hv.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_64_mmu_hv.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 303ece75b8e4..fb25ebc0af0c 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c @@ -262,7 +262,14 @@ int kvmppc_mmu_hv_init(void) static void kvmppc_mmu_book3s_64_hv_reset_msr(struct kvm_vcpu *vcpu) { - kvmppc_set_msr(vcpu, vcpu->arch.intr_msr); + unsigned long msr = vcpu->arch.intr_msr; + + /* If transactional, change to suspend mode on IRQ delivery */ + if (MSR_TM_TRANSACTIONAL(vcpu->arch.shregs.msr)) + msr |= MSR_TS_S; + else + msr |= vcpu->arch.shregs.msr & MSR_TS_MASK; + kvmppc_set_msr(vcpu, msr); } /* |