From: sashiko-bot@kernel.org
To: "Steffen Eiden" <seiden@linux.ibm.com>
Cc: kvmarm@lists.linux.dev, "Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Oliver Upton" <oupton@kernel.org>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
kvm@vger.kernel.org, linux-s390@vger.kernel.org,
"Heiko Carstens" <hca@linux.ibm.com>,
"Marc Zyngier" <maz@kernel.org>
Subject: Re: [PATCH v2 16/20] KVM: s390: arm64: Implement exception injection
Date: Mon, 31 Aug 2026 21:38:37 +0000 [thread overview]
Message-ID: <20260831213838.3C0AB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260831145536.913567-17-seiden@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Synthesized ESR_ELx for injected exceptions (Aborts and Unknown exceptions) conditionally sets the IL bit, violating architectural requirements.
--
commit 0f2bf8b10fedf69578d14536aed0e0dc39a725b4
Author: Steffen Eiden <seiden@linux.ibm.com>
KVM: s390: arm64: Implement exception injection
This commit adds core exception entry and fault injection mechanisms for the
s390 KVM arm64 architecture, enabling guest exception handling.
> diff --git a/arch/s390/kvm/arm64/inject_fault.c b/arch/s390/kvm/arm64/inject_fault.c
> index 425dbeaa421c6..7ecf91f86d901 100644
> --- a/arch/s390/kvm/arm64/inject_fault.c
> +++ b/arch/s390/kvm/arm64/inject_fault.c
[ ... ]
> +static void inject_abt64(struct kvm_vcpu *vcpu, bool is_iabt, unsigned long addr)
> +{
> + unsigned long cpsr = *vcpu_cpsr(vcpu);
> + bool is_aarch32 = vcpu_mode_is_32bit(vcpu);
> + u64 esr = 0;
> +
> + if (kvm_vcpu_abt_iss1tw(vcpu))
> + esr |= ESR_ELx_FSC_SEA_TTW(kvm_vcpu_abt_gltl(vcpu));
> + else
> + esr |= ESR_ELx_FSC_EXTABT;
> +
> + pend_sync_exception(vcpu);
> +
> + if (kvm_vcpu_trap_il_is32bit(vcpu))
> + esr |= ESR_ELx_IL;
[Severity: High]
Does this code conditionally omit the IL bit for injected aborts when the
trapped instruction is 16-bit?
The ARM architecture requires the IL bit in ESR_ELx to be unconditionally set
to 1 for injected Instruction and Data Aborts, regardless of the trapping
instruction's length.
Could this cause the guest kernel to receive an architecturally incorrect
ESR_ELx value (IL=0 instead of IL=1) and potentially break guest exception
handlers if it traps on a 16-bit instruction?
> +
> + if (is_aarch32 || (cpsr & PSR_MODE_MASK) == PSR_MODE_EL0t)
> + esr |= (ESR_ELx_EC_IABT_LOW << ESR_ELx_EC_SHIFT);
> + else
> + esr |= (ESR_ELx_EC_IABT_CUR << ESR_ELx_EC_SHIFT);
[ ... ]
> void kvm_inject_undefined(struct kvm_vcpu *vcpu)
> {
> - /* Stub until s390 supports arm64 sysregs TODO sysregs*/
> + u64 esr = (ESR_ELx_EC_UNKNOWN << ESR_ELx_EC_SHIFT);
> +
> + /*
> + * Build an unknown exception, depending on the instruction
> + * set.
> + */
> + if (kvm_vcpu_trap_il_is32bit(vcpu))
> + esr |= ESR_ELx_IL;
[Severity: High]
Similar to the abort injection above, does this code conditionally omit the IL
bit for an injected Unknown exception?
The architecture also requires the IL bit to be unconditionally set to 1 for
Unknown exceptions.
> +
> + kvm_inject_sync(vcpu, esr);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260831145536.913567-1-seiden@linux.ibm.com?part=16
next prev parent reply other threads:[~2026-08-31 21:38 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 14:55 [PATCH v2 00/20] KVM: arm64 on s390 System Register Handling Steffen Eiden
2026-08-31 14:55 ` [PATCH v2 01/20] KVM: arm64: Refactor idreg caching into dedicated structure Steffen Eiden
2026-08-31 18:06 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 02/20] KVM: arm64: Extract number of sys_reg_desc into a constant Steffen Eiden
2026-08-31 18:08 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 03/20] arm64: sysreg: Define OSLSR_EL1_OSLK_MASK Steffen Eiden
2026-08-31 18:18 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 04/20] arm64: Share more arm64 headers with s390 Steffen Eiden
2026-08-31 18:31 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 05/20] KVM: s390: arm64: Prepare for sharing more arm64 code Steffen Eiden
2026-08-31 18:42 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 06/20] KVM: arm64: Prepare sys_regs.c for sharing with s390 Steffen Eiden
2026-08-31 18:45 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 07/20] KVM: arm64: Share more arm64 code " Steffen Eiden
2026-08-31 19:01 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 08/20] s390: tools: Allow sharing arm64/kvm headers Steffen Eiden
2026-08-31 19:03 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 09/20] s390: Introduce read/write ARM sysreg instructions Steffen Eiden
2026-08-31 19:16 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 10/20] s390: Add functions to query arm guest time Steffen Eiden
2026-08-31 19:24 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 11/20] KVM: s390: arm64: Query Available Arm features Steffen Eiden
2026-08-31 19:46 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 12/20] KVM: s390: arm64: Implement feature sanitisation Steffen Eiden
2026-08-31 20:11 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 13/20] KVM: s390: arm64: Implement arm sysreg managing infrastructure Steffen Eiden
2026-08-31 20:33 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 14/20] KVM: s390: arm64: Integrate sysreg into the host Steffen Eiden
2026-08-31 21:15 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 15/20] KVM: s390: arm64: Use QAAF init save area Steffen Eiden
2026-08-31 21:32 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 16/20] KVM: s390: arm64: Implement exception injection Steffen Eiden
2026-08-31 21:38 ` sashiko-bot [this message]
2026-08-31 14:55 ` [PATCH v2 17/20] KVM: s390: arm64: Finalize page fault handling Steffen Eiden
2026-08-31 21:52 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 18/20] KVM: s390: arm64: Implement SVE for arm guests Steffen Eiden
2026-08-31 22:16 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 19/20] KVM: s390: arm64: Promote PTRAUTH capability Steffen Eiden
2026-08-31 22:35 ` sashiko-bot
2026-08-31 14:55 ` [PATCH v2 20/20] s390: Report AEF features to sysfs Steffen Eiden
2026-08-31 22:43 ` sashiko-bot
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=20260831213838.3C0AB1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-s390@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=seiden@linux.ibm.com \
/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