From: Heiko Carstens <hca@linux.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
imbrenda@linux.ibm.com, borntraeger@linux.ibm.com
Subject: Re: [PATCH 1/2] KVM: s390: Fix lpsw/e breaking event handling
Date: Wed, 15 Apr 2026 12:59:25 +0200 [thread overview]
Message-ID: <20260415105925.10321B18-hca@linux.ibm.com> (raw)
In-Reply-To: <20260323153637.3683-2-frankja@linux.ibm.com>
On Mon, Mar 23, 2026 at 03:35:22PM +0000, Janosch Frank wrote:
> LPSW and LPSWE need to set the gbea on completion but currently don't.
> Time to fix this up.
>
> LPSWEY was designed to not set the bear.
>
> Fixes: 48a3e950f4cee ("KVM: s390: Add support for machine checks.")
> Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
> 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 a3250ad83a8e..cc0553da14cb 100644
> --- a/arch/s390/kvm/priv.c
> +++ b/arch/s390/kvm/priv.c
> @@ -714,12 +714,13 @@ int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu)
> {
> psw_t *gpsw = &vcpu->arch.sie_block->gpsw;
> psw32_t new_psw;
> - u64 addr;
> + u64 addr, iaddr;
> int rc;
> u8 ar;
>
> vcpu->stat.instruction_lpsw++;
>
> + iaddr = gpsw->addr - kvm_s390_get_ilen(vcpu);
> if (gpsw->mask & PSW_MASK_PSTATE)
> return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);
>
> @@ -737,18 +738,20 @@ int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu)
> gpsw->addr = new_psw.addr & ~PSW32_ADDR_AMODE;
> if (!is_valid_psw(gpsw))
> return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
> + vcpu->arch.sie_block->gbea = iaddr;
> return 0;
This doesn't look correct to me: even if there is an early specification
exception the PSW is still replaced, and hence the breaking event address
needs to be updated. Read: the gbea assignment should be moved before
the is_valid_psw() check.
> static int handle_lpswe(struct kvm_vcpu *vcpu)
> {
> psw_t new_psw;
> - u64 addr;
> + u64 addr, iaddr;
> int rc;
This breaks reverse x-mas style. :)
> @@ -761,6 +764,7 @@ static int handle_lpswe(struct kvm_vcpu *vcpu)
> vcpu->arch.sie_block->gpsw = new_psw;
> 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;
Like above, I believe this is not correct.
next prev parent reply other threads:[~2026-04-15 10:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 15:35 [PATCH 0/2] KVM: s390: Fix lpsw/e breaking event handling Janosch Frank
2026-03-23 15:35 ` [PATCH 1/2] " Janosch Frank
2026-03-25 7:51 ` Christian Borntraeger
2026-03-25 12:00 ` Claudio Imbrenda
2026-04-15 10:59 ` Heiko Carstens [this message]
2026-04-15 11:45 ` Janosch Frank
2026-03-23 15:35 ` [PATCH 2/2] KVM: s390: selftests: Add load psw bear test Janosch Frank
2026-03-25 8:49 ` Christian Borntraeger
2026-03-25 10:29 ` Christian Borntraeger
2026-03-25 13:15 ` Janosch Frank
2026-03-25 13:19 ` [PATCH v2] " 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=20260415105925.10321B18-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=frankja@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