]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: s390: log machine checks more aggressively
authorChristian Borntraeger <borntraeger@linux.ibm.com>
Fri, 6 Mar 2026 10:25:40 +0000 (11:25 +0100)
committerChristian Borntraeger <borntraeger@linux.ibm.com>
Mon, 16 Mar 2026 15:56:39 +0000 (16:56 +0100)
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: Christian Borntraeger <borntraeger@linux.ibm.com>
Acked-by: Janosch Frank <frankja@linux.ibm.com>
Acked-by: Hendrik Brueckner <brueckner@linux.ibm.com>
arch/s390/kvm/interrupt.c
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/vsie.c

index 1a702e8ef574c1db348bed6dd7c94866c104f9d5..7cb8ce833b625448fdc0a9329f9743a3b76d83ac 100644 (file)
@@ -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)
index bc7d6fa66eafd83f98957fec07f1b7914b64d365..1668580008c6d0af24b8fdff532017dd4011c9c7 100644 (file)
@@ -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;
index d249b10044eb7595295fc20e9287e0629958d896..c0d36afd4023f315e3eb69e208878ccba968a6b9 100644 (file)
@@ -1179,7 +1179,6 @@ skip_sie:
        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;
        }