public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: s390: log machine checks more aggressively
@ 2026-03-09 11:59 Christian Borntraeger
  2026-03-09 13:25 ` Janosch Frank
  2026-03-10 13:05 ` Hendrik Brueckner
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Borntraeger @ 2026-03-09 11:59 UTC (permalink / raw)
  To: KVM
  Cc: Christian Borntraeger, Janosch Frank, David Hildenbrand,
	linux-s390, Thomas Huth, Claudio Imbrenda, Heiko Carstens,
	Vasily Gorbik, Alexander Gordeev, Sven Schnelle

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>
---

 arch/s390/kvm/interrupt.c | 6 ++++++
 arch/s390/kvm/kvm-s390.c  | 1 -
 arch/s390/kvm/vsie.c      | 1 -
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 18932a65ca68..9885d4bcb6ae 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -2824,6 +2824,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)
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index bc7d6fa66eaf..1668580008c6 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -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;
diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
index d249b10044eb..c0d36afd4023 100644
--- a/arch/s390/kvm/vsie.c
+++ b/arch/s390/kvm/vsie.c
@@ -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;
 	}
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: s390: log machine checks more aggressively
  2026-03-09 11:59 [PATCH] KVM: s390: log machine checks more aggressively Christian Borntraeger
@ 2026-03-09 13:25 ` Janosch Frank
  2026-03-10 13:05 ` Hendrik Brueckner
  1 sibling, 0 replies; 3+ messages in thread
From: Janosch Frank @ 2026-03-09 13:25 UTC (permalink / raw)
  To: Christian Borntraeger, KVM
  Cc: David Hildenbrand, linux-s390, Thomas Huth, Claudio Imbrenda,
	Heiko Carstens, Vasily Gorbik, Alexander Gordeev, Sven Schnelle

On 3/9/26 12:59, Christian Borntraeger wrote:
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: s390: log machine checks more aggressively
  2026-03-09 11:59 [PATCH] KVM: s390: log machine checks more aggressively Christian Borntraeger
  2026-03-09 13:25 ` Janosch Frank
@ 2026-03-10 13:05 ` Hendrik Brueckner
  1 sibling, 0 replies; 3+ messages in thread
From: Hendrik Brueckner @ 2026-03-10 13:05 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: KVM, Janosch Frank, David Hildenbrand, linux-s390, Thomas Huth,
	Claudio Imbrenda, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Sven Schnelle

On Mon, Mar 09, 2026 at 12:59:04PM +0100, Christian Borntraeger wrote:
> 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: Hendrik Brueckner <brueckner@linux.ibm.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-10 13:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 11:59 [PATCH] KVM: s390: log machine checks more aggressively Christian Borntraeger
2026-03-09 13:25 ` Janosch Frank
2026-03-10 13:05 ` Hendrik Brueckner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox