aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2013-11-27 05:47:10 -0500
committerCornelia Huck <cornelia.huck@de.ibm.com>2013-12-11 13:04:58 -0500
commitcc92d6dea11cd43842e20cd05c066963de586417 (patch)
tree3aeef11204eb6555301f5ce6062431a982d9c4e4 /arch/s390
parentb13d3580ee47ba3b2814e90b8a9b8241f7a4ba83 (diff)
KVM: s390: Reworked SIGP RESTART order
When SIGP RESTART detected an illegal CPU address, there is no need to drop to userspace, we can return CC3 to the guest directly instead. Also renamed __sigp_restart() to sigp_check_callable() (since this is a better description of what the function is really doing) and moved a string specific to RESTART to the calling place instead, so that this function gets usable by other SIGP orders, too. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kvm/sigp.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index eee1402349f2..509547d4fca1 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -363,7 +363,8 @@ static int __sigp_sense_running(struct kvm_vcpu *vcpu, u16 cpu_addr,
363 return rc; 363 return rc;
364} 364}
365 365
366static int __sigp_restart(struct kvm_vcpu *vcpu, u16 cpu_addr) 366/* Test whether the destination CPU is available and not busy */
367static int sigp_check_callable(struct kvm_vcpu *vcpu, u16 cpu_addr)
367{ 368{
368 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; 369 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
369 struct kvm_s390_local_interrupt *li; 370 struct kvm_s390_local_interrupt *li;
@@ -382,9 +383,6 @@ static int __sigp_restart(struct kvm_vcpu *vcpu, u16 cpu_addr)
382 spin_lock_bh(&li->lock); 383 spin_lock_bh(&li->lock);
383 if (li->action_bits & ACTION_STOP_ON_STOP) 384 if (li->action_bits & ACTION_STOP_ON_STOP)
384 rc = SIGP_CC_BUSY; 385 rc = SIGP_CC_BUSY;
385 else
386 VCPU_EVENT(vcpu, 4, "sigp restart %x to handle userspace",
387 cpu_addr);
388 spin_unlock_bh(&li->lock); 386 spin_unlock_bh(&li->lock);
389out: 387out:
390 spin_unlock(&fi->lock); 388 spin_unlock(&fi->lock);
@@ -459,10 +457,15 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu)
459 break; 457 break;
460 case SIGP_RESTART: 458 case SIGP_RESTART:
461 vcpu->stat.instruction_sigp_restart++; 459 vcpu->stat.instruction_sigp_restart++;
462 rc = __sigp_restart(vcpu, cpu_addr); 460 rc = sigp_check_callable(vcpu, cpu_addr);
463 if (rc == SIGP_CC_BUSY) 461 if (rc == SIGP_CC_ORDER_CODE_ACCEPTED) {
464 break; 462 VCPU_EVENT(vcpu, 4,
465 /* user space must know about restart */ 463 "sigp restart %x to handle userspace",
464 cpu_addr);
465 /* user space must know about restart */
466 rc = -EOPNOTSUPP;
467 }
468 break;
466 default: 469 default:
467 return -EOPNOTSUPP; 470 return -EOPNOTSUPP;
468 } 471 }