Commit 1ca90f4a authored by Christian Borntraeger's avatar Christian Borntraeger
Browse files

KVM: s390: log machine checks more aggressively



KVM will reinject machine checks that happen during guest activity.
From a host perspective this machine check is no longer visible
and even for the guest, the guest might decide to only kill a
userspace program or even ignore the machine check.
As this can be a disruptive event nevertheless, we should log this
not only in the VM debug event (that gets lost after guest shutdown)
but also on the global KVM event as well as syslog.
Consolidate the logging and log with loglevel 2 and higher.

Signed-off-by: default avatarChristian Borntraeger <borntraeger@linux.ibm.com>
Acked-by: default avatarJanosch Frank <frankja@linux.ibm.com>
Acked-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
parent 0c6294d9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2827,6 +2827,12 @@ void kvm_s390_reinject_machine_check(struct kvm_vcpu *vcpu,
	int rc;

	mci.val = mcck_info->mcic;

	/* log machine checks being reinjected on all debugs */
	VCPU_EVENT(vcpu, 2, "guest machine check %lx", mci.val);
	KVM_EVENT(2, "guest machine check %lx", mci.val);
	pr_info("guest machine check pid %d: %lx", current->pid, mci.val);

	if (mci.sr)
		cr14 |= CR14_RECOVERY_SUBMASK;
	if (mci.dg)
+0 −1
Original line number Diff line number Diff line
@@ -4634,7 +4634,6 @@ static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason)
	vcpu->run->s.regs.gprs[15] = vcpu->arch.sie_block->gg15;

	if (exit_reason == -EINTR) {
		VCPU_EVENT(vcpu, 3, "%s", "machine check");
		sie_page = container_of(vcpu->arch.sie_block,
					struct sie_page, sie_block);
		mcck_info = &sie_page->mcck_info;
+0 −1
Original line number Diff line number Diff line
@@ -1179,7 +1179,6 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page, struc
	kvm_vcpu_srcu_read_lock(vcpu);

	if (rc == -EINTR) {
		VCPU_EVENT(vcpu, 3, "%s", "machine check");
		kvm_s390_reinject_machine_check(vcpu, &vsie_page->mcck_info);
		return 0;
	}