aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/kvm-s390.h
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2014-11-12 11:13:29 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-11-28 06:32:56 -0500
commit04b41acd060541fa76407d4de1e0acf0edd57c2a (patch)
tree2672c0911920ece6247afb7d0be6631ee4e45258 /arch/s390/kvm/kvm-s390.h
parenta02689fecdbc36503b1496a5d36707bb4559db63 (diff)
KVM: s390: Fix rewinding of the PSW pointing to an EXECUTE instruction
A couple of our interception handlers rewind the PSW to the beginning of the instruction to run the intercepted instruction again during the next SIE entry. This normally works fine, but there is also the possibility that the instruction did not get run directly but via an EXECUTE instruction. In this case, the PSW does not point to the instruction that caused the interception, but to the EXECUTE instruction! So we've got to rewind the PSW to the beginning of the EXECUTE instruction instead. This is now accomplished with a new helper function kvm_s390_rewind_psw(). Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.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, 4 insertions, 2 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
index 244d02303182..ff8d9775b758 100644
--- a/arch/s390/kvm/kvm-s390.h
+++ b/arch/s390/kvm/kvm-s390.h
@@ -24,8 +24,6 @@ typedef int (*intercept_handler_t)(struct kvm_vcpu *vcpu);
24/* declare vfacilities extern */ 24/* declare vfacilities extern */
25extern unsigned long *vfacilities; 25extern unsigned long *vfacilities;
26 26
27int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu);
28
29/* Transactional Memory Execution related macros */ 27/* Transactional Memory Execution related macros */
30#define IS_TE_ENABLED(vcpu) ((vcpu->arch.sie_block->ecb & 0x10)) 28#define IS_TE_ENABLED(vcpu) ((vcpu->arch.sie_block->ecb & 0x10))
31#define TDB_FORMAT1 1 29#define TDB_FORMAT1 1
@@ -152,6 +150,10 @@ void kvm_s390_reinject_io_int(struct kvm *kvm,
152 struct kvm_s390_interrupt_info *inti); 150 struct kvm_s390_interrupt_info *inti);
153int kvm_s390_mask_adapter(struct kvm *kvm, unsigned int id, bool masked); 151int kvm_s390_mask_adapter(struct kvm *kvm, unsigned int id, bool masked);
154 152
153/* implemented in intercept.c */
154void kvm_s390_rewind_psw(struct kvm_vcpu *vcpu, int ilc);
155int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu);
156
155/* implemented in priv.c */ 157/* implemented in priv.c */
156int is_valid_psw(psw_t *psw); 158int is_valid_psw(psw_t *psw);
157int kvm_s390_handle_b2(struct kvm_vcpu *vcpu); 159int kvm_s390_handle_b2(struct kvm_vcpu *vcpu);