aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/interrupt.c
diff options
context:
space:
mode:
authorJens Freimann <jfrei@linux.vnet.ibm.com>2014-12-01 11:05:39 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-12-04 10:39:00 -0500
commit99e20009aeee47049900ac152d7a88d4f68697d3 (patch)
tree6d6d2b7131d650525c342dd1c853ce89ce23e164 /arch/s390/kvm/interrupt.c
parent9185124e8754e54f3ae03ef3b3eab628aa066ef6 (diff)
KVM: s390: clean up return code handling in irq delivery code
Instead of returning a possibly random or'ed together value, let's always return -EFAULT if rc is set. Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/interrupt.c')
-rw-r--r--arch/s390/kvm/interrupt.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 86bc89a2c6e6..f00f31e66cd8 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -287,7 +287,7 @@ static int __must_check __deliver_cpu_timer(struct kvm_vcpu *vcpu)
287 rc |= read_guest_lc(vcpu, __LC_EXT_NEW_PSW, 287 rc |= read_guest_lc(vcpu, __LC_EXT_NEW_PSW,
288 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 288 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
289 clear_bit(IRQ_PEND_EXT_CPU_TIMER, &li->pending_irqs); 289 clear_bit(IRQ_PEND_EXT_CPU_TIMER, &li->pending_irqs);
290 return rc; 290 return rc ? -EFAULT : 0;
291} 291}
292 292
293static int __must_check __deliver_ckc(struct kvm_vcpu *vcpu) 293static int __must_check __deliver_ckc(struct kvm_vcpu *vcpu)
@@ -306,7 +306,7 @@ static int __must_check __deliver_ckc(struct kvm_vcpu *vcpu)
306 rc |= read_guest_lc(vcpu, __LC_EXT_NEW_PSW, 306 rc |= read_guest_lc(vcpu, __LC_EXT_NEW_PSW,
307 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 307 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
308 clear_bit(IRQ_PEND_EXT_CLOCK_COMP, &li->pending_irqs); 308 clear_bit(IRQ_PEND_EXT_CLOCK_COMP, &li->pending_irqs);
309 return rc; 309 return rc ? -EFAULT : 0;
310} 310}
311 311
312static int __must_check __deliver_pfault_init(struct kvm_vcpu *vcpu) 312static int __must_check __deliver_pfault_init(struct kvm_vcpu *vcpu)
@@ -334,7 +334,7 @@ static int __must_check __deliver_pfault_init(struct kvm_vcpu *vcpu)
334 rc |= read_guest_lc(vcpu, __LC_EXT_NEW_PSW, 334 rc |= read_guest_lc(vcpu, __LC_EXT_NEW_PSW,
335 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 335 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
336 rc |= put_guest_lc(vcpu, ext.ext_params2, (u64 *) __LC_EXT_PARAMS2); 336 rc |= put_guest_lc(vcpu, ext.ext_params2, (u64 *) __LC_EXT_PARAMS2);
337 return rc; 337 return rc ? -EFAULT : 0;
338} 338}
339 339
340static int __must_check __deliver_machine_check(struct kvm_vcpu *vcpu) 340static int __must_check __deliver_machine_check(struct kvm_vcpu *vcpu)
@@ -371,7 +371,7 @@ static int __must_check __deliver_machine_check(struct kvm_vcpu *vcpu)
371 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 371 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
372 rc |= read_guest_lc(vcpu, __LC_MCK_NEW_PSW, 372 rc |= read_guest_lc(vcpu, __LC_MCK_NEW_PSW,
373 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 373 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
374 return rc; 374 return rc ? -EFAULT : 0;
375} 375}
376 376
377static int __must_check __deliver_restart(struct kvm_vcpu *vcpu) 377static int __must_check __deliver_restart(struct kvm_vcpu *vcpu)
@@ -389,7 +389,7 @@ static int __must_check __deliver_restart(struct kvm_vcpu *vcpu)
389 rc |= read_guest_lc(vcpu, offsetof(struct _lowcore, restart_psw), 389 rc |= read_guest_lc(vcpu, offsetof(struct _lowcore, restart_psw),
390 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 390 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
391 clear_bit(IRQ_PEND_RESTART, &li->pending_irqs); 391 clear_bit(IRQ_PEND_RESTART, &li->pending_irqs);
392 return rc; 392 return rc ? -EFAULT : 0;
393} 393}
394 394
395static int __must_check __deliver_stop(struct kvm_vcpu *vcpu) 395static int __must_check __deliver_stop(struct kvm_vcpu *vcpu)
@@ -450,7 +450,7 @@ static int __must_check __deliver_emergency_signal(struct kvm_vcpu *vcpu)
450 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 450 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
451 rc |= read_guest_lc(vcpu, __LC_EXT_NEW_PSW, 451 rc |= read_guest_lc(vcpu, __LC_EXT_NEW_PSW,
452 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 452 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
453 return rc; 453 return rc ? -EFAULT : 0;
454} 454}
455 455
456static int __must_check __deliver_external_call(struct kvm_vcpu *vcpu) 456static int __must_check __deliver_external_call(struct kvm_vcpu *vcpu)
@@ -478,7 +478,7 @@ static int __must_check __deliver_external_call(struct kvm_vcpu *vcpu)
478 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 478 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
479 rc |= read_guest_lc(vcpu, __LC_EXT_NEW_PSW, &vcpu->arch.sie_block->gpsw, 479 rc |= read_guest_lc(vcpu, __LC_EXT_NEW_PSW, &vcpu->arch.sie_block->gpsw,
480 sizeof(psw_t)); 480 sizeof(psw_t));
481 return rc; 481 return rc ? -EFAULT : 0;
482} 482}
483 483
484static int __must_check __deliver_prog(struct kvm_vcpu *vcpu) 484static int __must_check __deliver_prog(struct kvm_vcpu *vcpu)
@@ -572,7 +572,7 @@ static int __must_check __deliver_prog(struct kvm_vcpu *vcpu)
572 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 572 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
573 rc |= read_guest_lc(vcpu, __LC_PGM_NEW_PSW, 573 rc |= read_guest_lc(vcpu, __LC_PGM_NEW_PSW,
574 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 574 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
575 return rc; 575 return rc ? -EFAULT : 0;
576} 576}
577 577
578static int __must_check __deliver_service(struct kvm_vcpu *vcpu, 578static int __must_check __deliver_service(struct kvm_vcpu *vcpu,
@@ -594,7 +594,7 @@ static int __must_check __deliver_service(struct kvm_vcpu *vcpu,
594 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 594 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
595 rc |= put_guest_lc(vcpu, inti->ext.ext_params, 595 rc |= put_guest_lc(vcpu, inti->ext.ext_params,
596 (u32 *)__LC_EXT_PARAMS); 596 (u32 *)__LC_EXT_PARAMS);
597 return rc; 597 return rc ? -EFAULT : 0;
598} 598}
599 599
600static int __must_check __deliver_pfault_done(struct kvm_vcpu *vcpu, 600static int __must_check __deliver_pfault_done(struct kvm_vcpu *vcpu,
@@ -614,7 +614,7 @@ static int __must_check __deliver_pfault_done(struct kvm_vcpu *vcpu,
614 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 614 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
615 rc |= put_guest_lc(vcpu, inti->ext.ext_params2, 615 rc |= put_guest_lc(vcpu, inti->ext.ext_params2,
616 (u64 *)__LC_EXT_PARAMS2); 616 (u64 *)__LC_EXT_PARAMS2);
617 return rc; 617 return rc ? -EFAULT : 0;
618} 618}
619 619
620static int __must_check __deliver_virtio(struct kvm_vcpu *vcpu, 620static int __must_check __deliver_virtio(struct kvm_vcpu *vcpu,
@@ -639,7 +639,7 @@ static int __must_check __deliver_virtio(struct kvm_vcpu *vcpu,
639 (u32 *)__LC_EXT_PARAMS); 639 (u32 *)__LC_EXT_PARAMS);
640 rc |= put_guest_lc(vcpu, inti->ext.ext_params2, 640 rc |= put_guest_lc(vcpu, inti->ext.ext_params2,
641 (u64 *)__LC_EXT_PARAMS2); 641 (u64 *)__LC_EXT_PARAMS2);
642 return rc; 642 return rc ? -EFAULT : 0;
643} 643}
644 644
645static int __must_check __deliver_io(struct kvm_vcpu *vcpu, 645static int __must_check __deliver_io(struct kvm_vcpu *vcpu,
@@ -667,7 +667,7 @@ static int __must_check __deliver_io(struct kvm_vcpu *vcpu,
667 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 667 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
668 rc |= read_guest_lc(vcpu, __LC_IO_NEW_PSW, 668 rc |= read_guest_lc(vcpu, __LC_IO_NEW_PSW,
669 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 669 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
670 return rc; 670 return rc ? -EFAULT : 0;
671} 671}
672 672
673static int __must_check __deliver_mchk_floating(struct kvm_vcpu *vcpu, 673static int __must_check __deliver_mchk_floating(struct kvm_vcpu *vcpu,
@@ -692,7 +692,7 @@ static int __must_check __deliver_mchk_floating(struct kvm_vcpu *vcpu,
692 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 692 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
693 rc |= read_guest_lc(vcpu, __LC_MCK_NEW_PSW, 693 rc |= read_guest_lc(vcpu, __LC_MCK_NEW_PSW,
694 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 694 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
695 return rc; 695 return rc ? -EFAULT : 0;
696} 696}
697 697
698typedef int (*deliver_irq_t)(struct kvm_vcpu *vcpu); 698typedef int (*deliver_irq_t)(struct kvm_vcpu *vcpu);