提交 71cde587 编写于 作者: C Christian Borntraeger 提交者: Avi Kivity

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: NChristian Borntraeger <borntraeger@de.ibm.com>
CC: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NCarsten Otte <cotte@de.ibm.com>
Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 74b6b522
...@@ -423,6 +423,8 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, ...@@ -423,6 +423,8 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
return -EINVAL; /* not implemented yet */ return -EINVAL; /* not implemented yet */
} }
extern void s390_handle_mcck(void);
static void __vcpu_run(struct kvm_vcpu *vcpu) static void __vcpu_run(struct kvm_vcpu *vcpu)
{ {
memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16); 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,6 +432,9 @@ static void __vcpu_run(struct kvm_vcpu *vcpu)
if (need_resched()) if (need_resched())
schedule(); schedule();
if (test_thread_flag(TIF_MCCK_PENDING))
s390_handle_mcck();
vcpu->arch.sie_block->icptcode = 0; vcpu->arch.sie_block->icptcode = 0;
local_irq_disable(); local_irq_disable();
kvm_guest_enter(); kvm_guest_enter();
......
...@@ -207,6 +207,7 @@ s390_handle_mcck(void) ...@@ -207,6 +207,7 @@ s390_handle_mcck(void)
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
} }
EXPORT_SYMBOL_GPL(s390_handle_mcck);
/* /*
* returns 0 if all registers could be validated * returns 0 if all registers could be validated
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册