From: Janosch Frank <frankja@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
imbrenda@linux.ibm.com, borntraeger@linux.ibm.com
Subject: Re: [PATCH 3/3] kvm: s390: Fix lpsw/e spec exception ilc reporting
Date: Thu, 23 Apr 2026 16:12:33 +0200 [thread overview]
Message-ID: <7941e4ad-9b99-4cae-a590-22d94ee0baa8@linux.ibm.com> (raw)
In-Reply-To: <20260423133602.10371F31-hca@linux.ibm.com>
On 4/23/26 15:36, Heiko Carstens wrote:
> On Thu, Apr 23, 2026 at 12:36:04PM +0000, Janosch Frank wrote:
>> On early PSW specification exception the ILC has to be 0 according to
>> architecture.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> Fixes: 48a3e950f4cee ("KVM: s390: Add support for machine checks.")
>> ---
>> arch/s390/kvm/priv.c | 16 ++++++++++++----
>> 1 file changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
>> index 56e63679f9d1..9fd7d3f1d1e8 100644
>> --- a/arch/s390/kvm/priv.c
>> +++ b/arch/s390/kvm/priv.c
>> @@ -713,6 +713,7 @@ int is_valid_psw(psw_t *psw)
>> int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu)
>> {
>> psw_t *gpsw = &vcpu->arch.sie_block->gpsw;
>> + struct kvm_s390_pgm_info info = {};
>> psw32_t new_psw;
>> u64 addr, iaddr;
>> int rc;
>> @@ -738,14 +739,18 @@ int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu)
>> 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);
>> + if (!is_valid_psw(gpsw)) {
>> + info.code = PGM_SPECIFICATION;
>> + info.flags = KVM_S390_PGM_FLAGS_ILC_VALID;
>> + return kvm_s390_inject_prog_irq(vcpu, &info);
>> + }
>
> Hmm... looking at the architecture: an odd instruction address in the PSW
> does not result in an early specification exception, but a "normal"
> specification exception. is_valid_psw() however also checks for an odd
> instruction address. So I guess this is still not entirely correct.
>
> I'm also wondering if the above implementation is correct if PER is enabled
> when the specification happens...
Well, we're hopefully slowly getting there one patch at a time.
>
> Btw.: you may want to have consistent short descriptions for your two
> patches. That is consistently use upper or lower case for "LPSW/E".
Will fix
I'll also have to rename the bear test to lpsw since we're now testing
way more things.
prev parent reply other threads:[~2026-04-23 14:12 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 ` [PATCH 2/3] kvm: s390: Fix LPSW/E early exception bear behavior Janosch Frank
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 [this message]
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=7941e4ad-9b99-4cae-a590-22d94ee0baa8@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