From: Janosch Frank <frankja@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com,
borntraeger@linux.ibm.com, hca@linux.ibm.com
Subject: [PATCH 2/3] kvm: s390: Fix LPSW/E early exception bear behavior
Date: Thu, 23 Apr 2026 12:36:03 +0000 [thread overview]
Message-ID: <20260423123902.14663-3-frankja@linux.ibm.com> (raw)
In-Reply-To: <20260423123902.14663-1-frankja@linux.ibm.com>
When loading a PSW a lot of specification exceptions are recognized
after the PSW has been loaded. In these cases the load PSW(E) succeeds
but the loaded PSW was invalid. Since the load completed we need to
set the bear.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Fixes: 1653545abc68 ("KVM: s390: Fix lpsw/e breaking event handling")
---
arch/s390/kvm/priv.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index cc0553da14cb..56e63679f9d1 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -736,9 +736,11 @@ int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu)
gpsw->mask = (new_psw.mask & ~PSW32_MASK_BASE) << 32;
gpsw->mask |= new_psw.addr & PSW32_ADDR_AMODE;
gpsw->addr = new_psw.addr & ~PSW32_ADDR_AMODE;
+ vcpu->arch.sie_block->gbea = iaddr;
+
if (!is_valid_psw(gpsw))
return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
- vcpu->arch.sie_block->gbea = iaddr;
+
return 0;
}
@@ -762,9 +764,11 @@ static int handle_lpswe(struct kvm_vcpu *vcpu)
if (rc)
return kvm_s390_inject_prog_cond(vcpu, rc);
vcpu->arch.sie_block->gpsw = new_psw;
+ vcpu->arch.sie_block->gbea = iaddr;
+
if (!is_valid_psw(&vcpu->arch.sie_block->gpsw))
return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
- vcpu->arch.sie_block->gbea = iaddr;
+
return 0;
}
--
2.51.0
next prev parent reply other threads:[~2026-04-23 12:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 12:36 [PATCH 0/3] KVM: s390: Additional LPSW/E fixes Janosch Frank
2026-04-23 12:36 ` [PATCH 1/3] KVM: s390: selftests: Add load psw bear test Janosch Frank
2026-04-23 12:36 ` Janosch Frank [this message]
2026-04-23 12:36 ` [PATCH 3/3] kvm: s390: Fix lpsw/e spec exception ilc reporting Janosch Frank
2026-04-23 13:36 ` Heiko Carstens
2026-04-23 14:12 ` Janosch Frank
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260423123902.14663-3-frankja@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox