diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2008-05-21 07:37:34 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-06-06 14:08:26 -0400 |
commit | 71cde5879f10b639506bc0b9f29a89f58b42a17e (patch) | |
tree | 5e8e8da042eede41ef4b9b74fd14e959e61f5b4a | |
parent | 74b6b522ec83f9c44fc7743f2adcb24664aa8f45 (diff) |
KVM: s390: handle machine checks when guest is running
The low-level interrupt handler on s390 checks for _TIF_WORK_INT and
exits the guest context, if work is pending.
TIF_WORK_INT is defined as_TIF_SIGPENDING | _TIF_NEED_RESCHED |
_TIF_MCCK_PENDING. Currently the sie loop checks for signals and
reschedule, but it does not check for machine checks. That means that
we exit the guest context if a machine check is pending, but we do not
handle the machine check.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
CC: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 5 | ||||
-rw-r--r-- | drivers/s390/s390mach.c | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 0ac36a649eba..40e4f2de7320 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -423,6 +423,8 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, | |||
423 | return -EINVAL; /* not implemented yet */ | 423 | return -EINVAL; /* not implemented yet */ |
424 | } | 424 | } |
425 | 425 | ||
426 | extern void s390_handle_mcck(void); | ||
427 | |||
426 | static void __vcpu_run(struct kvm_vcpu *vcpu) | 428 | static void __vcpu_run(struct kvm_vcpu *vcpu) |
427 | { | 429 | { |
428 | memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16); | 430 | memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16); |
@@ -430,6 +432,9 @@ static void __vcpu_run(struct kvm_vcpu *vcpu) | |||
430 | if (need_resched()) | 432 | if (need_resched()) |
431 | schedule(); | 433 | schedule(); |
432 | 434 | ||
435 | if (test_thread_flag(TIF_MCCK_PENDING)) | ||
436 | s390_handle_mcck(); | ||
437 | |||
433 | vcpu->arch.sie_block->icptcode = 0; | 438 | vcpu->arch.sie_block->icptcode = 0; |
434 | local_irq_disable(); | 439 | local_irq_disable(); |
435 | kvm_guest_enter(); | 440 | kvm_guest_enter(); |
diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c index 5080f343ad74..5bfbe7659830 100644 --- a/drivers/s390/s390mach.c +++ b/drivers/s390/s390mach.c | |||
@@ -207,6 +207,7 @@ s390_handle_mcck(void) | |||
207 | do_exit(SIGSEGV); | 207 | do_exit(SIGSEGV); |
208 | } | 208 | } |
209 | } | 209 | } |
210 | EXPORT_SYMBOL_GPL(s390_handle_mcck); | ||
210 | 211 | ||
211 | /* | 212 | /* |
212 | * returns 0 if all registers could be validated | 213 | * returns 0 if all registers could be validated |