diff options
Diffstat (limited to 'arch/s390/kvm/kvm-s390.h')
-rw-r--r-- | arch/s390/kvm/kvm-s390.h | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index 3c1e2274d9ea..9b5680d1f6cc 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h | |||
@@ -28,7 +28,6 @@ int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu); | |||
28 | 28 | ||
29 | /* Transactional Memory Execution related macros */ | 29 | /* Transactional Memory Execution related macros */ |
30 | #define IS_TE_ENABLED(vcpu) ((vcpu->arch.sie_block->ecb & 0x10)) | 30 | #define IS_TE_ENABLED(vcpu) ((vcpu->arch.sie_block->ecb & 0x10)) |
31 | #define TDB_ADDR 0x1800UL | ||
32 | #define TDB_FORMAT1 1 | 31 | #define TDB_FORMAT1 1 |
33 | #define IS_ITDB_VALID(vcpu) ((*(char *)vcpu->arch.sie_block->itdba == TDB_FORMAT1)) | 32 | #define IS_ITDB_VALID(vcpu) ((*(char *)vcpu->arch.sie_block->itdba == TDB_FORMAT1)) |
34 | 33 | ||
@@ -130,6 +129,7 @@ void kvm_s390_tasklet(unsigned long parm); | |||
130 | void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu); | 129 | void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu); |
131 | void kvm_s390_deliver_pending_machine_checks(struct kvm_vcpu *vcpu); | 130 | void kvm_s390_deliver_pending_machine_checks(struct kvm_vcpu *vcpu); |
132 | void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu); | 131 | void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu); |
132 | void kvm_s390_clear_float_irqs(struct kvm *kvm); | ||
133 | int __must_check kvm_s390_inject_vm(struct kvm *kvm, | 133 | int __must_check kvm_s390_inject_vm(struct kvm *kvm, |
134 | struct kvm_s390_interrupt *s390int); | 134 | struct kvm_s390_interrupt *s390int); |
135 | int __must_check kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, | 135 | int __must_check kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, |
@@ -137,6 +137,8 @@ int __must_check kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, | |||
137 | int __must_check kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code); | 137 | int __must_check kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code); |
138 | struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm, | 138 | struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm, |
139 | u64 cr6, u64 schid); | 139 | u64 cr6, u64 schid); |
140 | void kvm_s390_reinject_io_int(struct kvm *kvm, | ||
141 | struct kvm_s390_interrupt_info *inti); | ||
140 | int kvm_s390_mask_adapter(struct kvm *kvm, unsigned int id, bool masked); | 142 | int kvm_s390_mask_adapter(struct kvm *kvm, unsigned int id, bool masked); |
141 | 143 | ||
142 | /* implemented in priv.c */ | 144 | /* implemented in priv.c */ |
@@ -145,6 +147,7 @@ int kvm_s390_handle_e5(struct kvm_vcpu *vcpu); | |||
145 | int kvm_s390_handle_01(struct kvm_vcpu *vcpu); | 147 | int kvm_s390_handle_01(struct kvm_vcpu *vcpu); |
146 | int kvm_s390_handle_b9(struct kvm_vcpu *vcpu); | 148 | int kvm_s390_handle_b9(struct kvm_vcpu *vcpu); |
147 | int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu); | 149 | int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu); |
150 | int kvm_s390_handle_stctl(struct kvm_vcpu *vcpu); | ||
148 | int kvm_s390_handle_lctl(struct kvm_vcpu *vcpu); | 151 | int kvm_s390_handle_lctl(struct kvm_vcpu *vcpu); |
149 | int kvm_s390_handle_eb(struct kvm_vcpu *vcpu); | 152 | int kvm_s390_handle_eb(struct kvm_vcpu *vcpu); |
150 | 153 | ||
@@ -158,14 +161,64 @@ void s390_vcpu_block(struct kvm_vcpu *vcpu); | |||
158 | void s390_vcpu_unblock(struct kvm_vcpu *vcpu); | 161 | void s390_vcpu_unblock(struct kvm_vcpu *vcpu); |
159 | void exit_sie(struct kvm_vcpu *vcpu); | 162 | void exit_sie(struct kvm_vcpu *vcpu); |
160 | void exit_sie_sync(struct kvm_vcpu *vcpu); | 163 | void exit_sie_sync(struct kvm_vcpu *vcpu); |
161 | /* are we going to support cmma? */ | 164 | int kvm_s390_vcpu_setup_cmma(struct kvm_vcpu *vcpu); |
162 | bool kvm_enabled_cmma(void); | 165 | void kvm_s390_vcpu_unsetup_cmma(struct kvm_vcpu *vcpu); |
166 | /* is cmma enabled */ | ||
167 | bool kvm_s390_cmma_enabled(struct kvm *kvm); | ||
168 | int test_vfacility(unsigned long nr); | ||
169 | |||
163 | /* implemented in diag.c */ | 170 | /* implemented in diag.c */ |
164 | int kvm_s390_handle_diag(struct kvm_vcpu *vcpu); | 171 | int kvm_s390_handle_diag(struct kvm_vcpu *vcpu); |
172 | /* implemented in interrupt.c */ | ||
173 | int kvm_s390_inject_prog_irq(struct kvm_vcpu *vcpu, | ||
174 | struct kvm_s390_pgm_info *pgm_info); | ||
175 | |||
176 | /** | ||
177 | * kvm_s390_inject_prog_cond - conditionally inject a program check | ||
178 | * @vcpu: virtual cpu | ||
179 | * @rc: original return/error code | ||
180 | * | ||
181 | * This function is supposed to be used after regular guest access functions | ||
182 | * failed, to conditionally inject a program check to a vcpu. The typical | ||
183 | * pattern would look like | ||
184 | * | ||
185 | * rc = write_guest(vcpu, addr, data, len); | ||
186 | * if (rc) | ||
187 | * return kvm_s390_inject_prog_cond(vcpu, rc); | ||
188 | * | ||
189 | * A negative return code from guest access functions implies an internal error | ||
190 | * like e.g. out of memory. In these cases no program check should be injected | ||
191 | * to the guest. | ||
192 | * A positive value implies that an exception happened while accessing a guest's | ||
193 | * memory. In this case all data belonging to the corresponding program check | ||
194 | * has been stored in vcpu->arch.pgm and can be injected with | ||
195 | * kvm_s390_inject_prog_irq(). | ||
196 | * | ||
197 | * Returns: - the original @rc value if @rc was negative (internal error) | ||
198 | * - zero if @rc was already zero | ||
199 | * - zero or error code from injecting if @rc was positive | ||
200 | * (program check injected to @vcpu) | ||
201 | */ | ||
202 | static inline int kvm_s390_inject_prog_cond(struct kvm_vcpu *vcpu, int rc) | ||
203 | { | ||
204 | if (rc <= 0) | ||
205 | return rc; | ||
206 | return kvm_s390_inject_prog_irq(vcpu, &vcpu->arch.pgm); | ||
207 | } | ||
165 | 208 | ||
166 | /* implemented in interrupt.c */ | 209 | /* implemented in interrupt.c */ |
167 | int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu); | 210 | int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu); |
168 | int psw_extint_disabled(struct kvm_vcpu *vcpu); | 211 | int psw_extint_disabled(struct kvm_vcpu *vcpu); |
169 | void kvm_s390_destroy_adapters(struct kvm *kvm); | 212 | void kvm_s390_destroy_adapters(struct kvm *kvm); |
170 | 213 | ||
214 | /* implemented in guestdbg.c */ | ||
215 | void kvm_s390_backup_guest_per_regs(struct kvm_vcpu *vcpu); | ||
216 | void kvm_s390_restore_guest_per_regs(struct kvm_vcpu *vcpu); | ||
217 | void kvm_s390_patch_guest_per_regs(struct kvm_vcpu *vcpu); | ||
218 | int kvm_s390_import_bp_data(struct kvm_vcpu *vcpu, | ||
219 | struct kvm_guest_debug *dbg); | ||
220 | void kvm_s390_clear_bp_data(struct kvm_vcpu *vcpu); | ||
221 | void kvm_s390_prepare_debug_exit(struct kvm_vcpu *vcpu); | ||
222 | void kvm_s390_handle_per_event(struct kvm_vcpu *vcpu); | ||
223 | |||
171 | #endif | 224 | #endif |