summaryrefslogtreecommitdiff
path: root/arch/s390/kvm/kvm-s390.h
diff options
context:
space:
mode:
authorMichael Mueller <mimu@linux.vnet.ibm.com>2013-06-28 13:30:24 +0200
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-01-17 13:12:01 +0100
commit7feb6bb8e6dbd129c11fc93bf206daa156bf1c0f (patch)
tree383c77a8523822b940c68a42a323d4da949697d2 /arch/s390/kvm/kvm-s390.h
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/kvm-s390.h')
-rw-r--r--arch/s390/kvm/kvm-s390.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
index 095cf51b16ec..f9559b0bd620 100644
--- a/arch/s390/kvm/kvm-s390.h
+++ b/arch/s390/kvm/kvm-s390.h
@@ -26,6 +26,12 @@ extern unsigned long *vfacilities;
int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu);
+/* Transactional Memory Execution related macros */
+#define IS_TE_ENABLED(vcpu) ((vcpu->arch.sie_block->ecb & 0x10))
+#define TDB_ADDR 0x1800UL
+#define TDB_FORMAT1 1
+#define IS_ITDB_VALID(vcpu) ((*(char *)vcpu->arch.sie_block->itdba == TDB_FORMAT1))
+
#define VM_EVENT(d_kvm, d_loglevel, d_string, d_args...)\
do { \
debug_sprintf_event(d_kvm->arch.dbf, d_loglevel, d_string "\n", \