intercept.c (04b41acd060541fa76407d4de1e0acf0edd57c2a) intercept.c (383d0b050106abecb82f43101cac94fa423af5cd)
1/*
2 * in-kernel handling for sie intercepts
3 *
4 * Copyright IBM Corp. 2008, 2014
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2 only)
8 * as published by the Free Software Foundation.

--- 243 unchanged lines hidden (view full) ---

252 * This interception only occurs if the CPUSTAT_EXT_INT bit was set, or if
253 * the new PSW does not have external interrupts disabled. In the first case,
254 * we've got to deliver the interrupt manually, and in the second case, we
255 * drop to userspace to handle the situation there.
256 */
257static int handle_external_interrupt(struct kvm_vcpu *vcpu)
258{
259 u16 eic = vcpu->arch.sie_block->eic;
1/*
2 * in-kernel handling for sie intercepts
3 *
4 * Copyright IBM Corp. 2008, 2014
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2 only)
8 * as published by the Free Software Foundation.

--- 243 unchanged lines hidden (view full) ---

252 * This interception only occurs if the CPUSTAT_EXT_INT bit was set, or if
253 * the new PSW does not have external interrupts disabled. In the first case,
254 * we've got to deliver the interrupt manually, and in the second case, we
255 * drop to userspace to handle the situation there.
256 */
257static int handle_external_interrupt(struct kvm_vcpu *vcpu)
258{
259 u16 eic = vcpu->arch.sie_block->eic;
260 struct kvm_s390_interrupt irq;
260 struct kvm_s390_irq irq;
261 psw_t newpsw;
262 int rc;
263
264 vcpu->stat.exit_external_interrupt++;
265
266 rc = read_guest_lc(vcpu, __LC_EXT_NEW_PSW, &newpsw, sizeof(psw_t));
267 if (rc)
268 return rc;

--- 8 unchanged lines hidden (view full) ---

277 break;
278 case EXT_IRQ_CPU_TIMER:
279 irq.type = KVM_S390_INT_CPU_TIMER;
280 break;
281 case EXT_IRQ_EXTERNAL_CALL:
282 if (kvm_s390_si_ext_call_pending(vcpu))
283 return 0;
284 irq.type = KVM_S390_INT_EXTERNAL_CALL;
261 psw_t newpsw;
262 int rc;
263
264 vcpu->stat.exit_external_interrupt++;
265
266 rc = read_guest_lc(vcpu, __LC_EXT_NEW_PSW, &newpsw, sizeof(psw_t));
267 if (rc)
268 return rc;

--- 8 unchanged lines hidden (view full) ---

277 break;
278 case EXT_IRQ_CPU_TIMER:
279 irq.type = KVM_S390_INT_CPU_TIMER;
280 break;
281 case EXT_IRQ_EXTERNAL_CALL:
282 if (kvm_s390_si_ext_call_pending(vcpu))
283 return 0;
284 irq.type = KVM_S390_INT_EXTERNAL_CALL;
285 irq.parm = vcpu->arch.sie_block->extcpuaddr;
285 irq.u.extcall.code = vcpu->arch.sie_block->extcpuaddr;
286 break;
287 default:
288 return -EOPNOTSUPP;
289 }
290
291 return kvm_s390_inject_vcpu(vcpu, &irq);
292}
293

--- 72 unchanged lines hidden ---
286 break;
287 default:
288 return -EOPNOTSUPP;
289 }
290
291 return kvm_s390_inject_vcpu(vcpu, &irq);
292}
293

--- 72 unchanged lines hidden ---