aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/kvm-s390.h
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2015-11-04 07:47:58 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-02-10 07:12:49 -0500
commit0e8bc06a2fbb4d6b688baa8e2416cd07f9453595 (patch)
treea601f7da3506be80b6fe38304b36d4c02d48fc39 /arch/s390/kvm/kvm-s390.h
parent6fd8e67dd83437118cf46a4a9c224142004c3d51 (diff)
KVM: s390: PSW forwarding / rewinding / ilc rework
We have some confusion about ilc vs. ilen in our current code. So let's correctly use the term ilen when dealing with (ilc << 1). Program irq injection didn't take care of the correct ilc in case of irqs triggered by EXECUTE functions, let's provide one function kvm_s390_get_ilen() to take care of all that. Also, manually specifying in intercept handlers the size of the instruction (and sometimes overwriting that value for EXECUTE internally) doesn't make too much sense. So also provide the functions: - kvm_s390_retry_instr to retry the currently intercepted instruction - kvm_s390_rewind_psw to rewind the PSW without internal overwrites - kvm_s390_forward_psw to forward the PSW Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@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.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
index df1abada1f36..1c756c7dd0c2 100644
--- a/arch/s390/kvm/kvm-s390.h
+++ b/arch/s390/kvm/kvm-s390.h
@@ -19,6 +19,7 @@
19#include <linux/kvm.h> 19#include <linux/kvm.h>
20#include <linux/kvm_host.h> 20#include <linux/kvm_host.h>
21#include <asm/facility.h> 21#include <asm/facility.h>
22#include <asm/processor.h>
22 23
23typedef int (*intercept_handler_t)(struct kvm_vcpu *vcpu); 24typedef int (*intercept_handler_t)(struct kvm_vcpu *vcpu);
24 25
@@ -212,8 +213,22 @@ int kvm_s390_reinject_io_int(struct kvm *kvm,
212int kvm_s390_mask_adapter(struct kvm *kvm, unsigned int id, bool masked); 213int kvm_s390_mask_adapter(struct kvm *kvm, unsigned int id, bool masked);
213 214
214/* implemented in intercept.c */ 215/* implemented in intercept.c */
215void kvm_s390_rewind_psw(struct kvm_vcpu *vcpu, int ilc); 216u8 kvm_s390_get_ilen(struct kvm_vcpu *vcpu);
216int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu); 217int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu);
218static inline void kvm_s390_rewind_psw(struct kvm_vcpu *vcpu, int ilen)
219{
220 struct kvm_s390_sie_block *sie_block = vcpu->arch.sie_block;
221
222 sie_block->gpsw.addr = __rewind_psw(sie_block->gpsw, ilen);
223}
224static inline void kvm_s390_forward_psw(struct kvm_vcpu *vcpu, int ilen)
225{
226 kvm_s390_rewind_psw(vcpu, -ilen);
227}
228static inline void kvm_s390_retry_instr(struct kvm_vcpu *vcpu)
229{
230 kvm_s390_rewind_psw(vcpu, kvm_s390_get_ilen(vcpu));
231}
217 232
218/* implemented in priv.c */ 233/* implemented in priv.c */
219int is_valid_psw(psw_t *psw); 234int is_valid_psw(psw_t *psw);