aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/intercept.c
diff options
context:
space:
mode:
authorMichael Mueller <mimu@linux.vnet.ibm.com>2013-06-28 07:30:24 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-01-17 07:12:01 -0500
commit7feb6bb8e6dbd129c11fc93bf206daa156bf1c0f (patch)
tree383c77a8523822b940c68a42a323d4da949697d2 /arch/s390/kvm/intercept.c
parent26a865f4aa8e66a6d94958de7656f7f1b03c6c56 (diff)
KVM: s390: enable Transactional Execution
This patch enables transactional execution for KVM guests on s390 systems zec12 or later. We rework the allocation of the page containing the sie_block to also back the Interception Transaction Diagnostic Block. If available the TE facilities will be enabled. Setting bit 73 and 50 in vfacilities bitmask reveals the HW facilities Transactional Memory and Constraint Transactional Memory respectively to the KVM guest. Furthermore, the patch restores the Program-Interruption TDB from the Interception TDB in case a program interception has occurred and the ITDB has a valid format. Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/intercept.c')
-rw-r--r--arch/s390/kvm/intercept.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
index 5ddbbde6f65c..eeb1ac7d8fa4 100644
--- a/arch/s390/kvm/intercept.c
+++ b/arch/s390/kvm/intercept.c
@@ -112,6 +112,17 @@ static int handle_instruction(struct kvm_vcpu *vcpu)
112static int handle_prog(struct kvm_vcpu *vcpu) 112static int handle_prog(struct kvm_vcpu *vcpu)
113{ 113{
114 vcpu->stat.exit_program_interruption++; 114 vcpu->stat.exit_program_interruption++;
115
116 /* Restore ITDB to Program-Interruption TDB in guest memory */
117 if (IS_TE_ENABLED(vcpu) &&
118 !(current->thread.per_flags & PER_FLAG_NO_TE) &&
119 IS_ITDB_VALID(vcpu)) {
120 copy_to_guest(vcpu, TDB_ADDR, vcpu->arch.sie_block->itdba,
121 sizeof(struct kvm_s390_itdb));
122 memset((void *) vcpu->arch.sie_block->itdba, 0,
123 sizeof(struct kvm_s390_itdb));
124 }
125
115 trace_kvm_s390_intercept_prog(vcpu, vcpu->arch.sie_block->iprcc); 126 trace_kvm_s390_intercept_prog(vcpu, vcpu->arch.sie_block->iprcc);
116 return kvm_s390_inject_program_int(vcpu, vcpu->arch.sie_block->iprcc); 127 return kvm_s390_inject_program_int(vcpu, vcpu->arch.sie_block->iprcc);
117} 128}