Skip to content

Commit 1ca90f4

Browse files
committed
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: Christian Borntraeger <[email protected]> Acked-by: Janosch Frank <[email protected]> Acked-by: Hendrik Brueckner <[email protected]>
1 parent 0c6294d commit 1ca90f4

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

arch/s390/kvm/interrupt.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2827,6 +2827,12 @@ void kvm_s390_reinject_machine_check(struct kvm_vcpu *vcpu,
28272827
int rc;
28282828

28292829
mci.val = mcck_info->mcic;
2830+
2831+
/* log machine checks being reinjected on all debugs */
2832+
VCPU_EVENT(vcpu, 2, "guest machine check %lx", mci.val);
2833+
KVM_EVENT(2, "guest machine check %lx", mci.val);
2834+
pr_info("guest machine check pid %d: %lx", current->pid, mci.val);
2835+
28302836
if (mci.sr)
28312837
cr14 |= CR14_RECOVERY_SUBMASK;
28322838
if (mci.dg)

arch/s390/kvm/kvm-s390.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4634,7 +4634,6 @@ static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason)
46344634
vcpu->run->s.regs.gprs[15] = vcpu->arch.sie_block->gg15;
46354635

46364636
if (exit_reason == -EINTR) {
4637-
VCPU_EVENT(vcpu, 3, "%s", "machine check");
46384637
sie_page = container_of(vcpu->arch.sie_block,
46394638
struct sie_page, sie_block);
46404639
mcck_info = &sie_page->mcck_info;

arch/s390/kvm/vsie.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,6 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page, struc
11791179
kvm_vcpu_srcu_read_lock(vcpu);
11801180

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

0 commit comments

Comments
 (0)