KVM: s390: handle machine checks when guest is running

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, June 11, 2008 - 6:06 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=71cde5...
Commit:     71cde5879f10b639506bc0b9f29a89f58b42a17e
Parent:     74b6b522ec83f9c44fc7743f2adcb24664aa8f45
Author:     Christian Borntraeger <borntraeger@de.ibm.com>
AuthorDate: Wed May 21 13:37:34 2008 +0200
Committer:  Avi Kivity <avi@qumranet.com>
CommitDate: Fri Jun 6 21:08:26 2008 +0300

    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>
---
 arch/s390/kvm/kvm-s390.c |    5 +++++
 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 0ac36a6..40e4f2d 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,
 	return -EINVAL; /* not implemented yet */
 }
 
+extern void s390_handle_mcck(void);
+
 static void __vcpu_run(struct kvm_vcpu *vcpu)
 {
 	memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16);
@@ -430,6 +432,9 @@ static void __vcpu_run(struct kvm_vcpu *vcpu)
 	if (need_resched())
 		schedule();
 
+	if (test_thread_flag(TIF_MCCK_PENDING))
+		s390_handle_mcck();
+
 	vcpu->arch.sie_block->icptcode = 0;
 	local_irq_disable();
 	kvm_guest_enter();
diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c
index 5080f34..5bfbe76 100644
--- a/drivers/s390/s390mach.c
+++ b/drivers/s390/s390mach.c
@@ -207,6 +207,7 @@ s390_handle_mcck(void)
 		do_exit(SIGSEGV);
 	}
 }
+EXPORT_SYMBOL_GPL(s390_handle_mcck);
 
 /*
  * returns 0 if all registers could be validated
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
KVM: s390: handle machine checks when guest is running, Linux Kernel Mailing ..., (Wed Jun 11, 6:06 pm)