From: Janosch Frank <frankja@linux.ibm.com>
To: Steffen Eiden <seiden@linux.ibm.com>
Cc: sashiko-reviews@lists.linux.dev,
Alexander Gordeev <agordeev@linux.ibm.com>,
Oliver Upton <oupton@kernel.org>,
kvmarm@lists.linux.dev, kvm@vger.kernel.org,
linux-s390@vger.kernel.org, Marc Zyngier <maz@kernel.org>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [PATCH v2 11/20] KVM: s390: arm64: Query Available Arm features
Date: Tue, 1 Sep 2026 18:36:50 +0200 [thread overview]
Message-ID: <b840a492-f8ba-4a43-9b29-3359cfc98fa3@linux.ibm.com> (raw)
In-Reply-To: <20260901142550.231001-C-seiden@linux.ibm.com>
On 9/1/26 4:25 PM, Steffen Eiden wrote:
> On Tue, Sep 01, 2026 at 01:44:09PM +0200, Janosch Frank wrote:
>> On 8/31/26 9:46 PM, sashiko-bot@kernel.org wrote:
>>> Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
>>> - [Critical] The EX_TABLE entry in the `qaaf` inline assembly incorrectly places the exception fixup label on the non-faulting `lhi` instruction instead of the potentially faulting `.insn` instruction, which will cause unhandled hardware exceptions to panic the kernel.
>>> - [High] `aef_sysfs_init()` unconditionally calls `aef_init_save_area()`, failing to skip it when the AEF facility is not present, causing a crash on older hardware.
>>> - [High] Off-by-two index error when accessing the QAAF registers array in `kvm_qaaf_read_ftr_reg()`, causing KVM to read incorrect memory offsets for all features.
>>> - [High] If QAAF initialization fails, the global capability flag `info.arm_guest_supp` is not cleared, leading KVM to initialize using uninitialized hardware capability data.
>>> --
>>
>> [...]
>>
>>>> diff --git a/arch/s390/kernel/aef.c b/arch/s390/kernel/aef.c
>>>> new file mode 100644
>>>> index 0000000000000..825e2643a8921
>>>> --- /dev/null
>>>> +++ b/arch/s390/kernel/aef.c
>>> [ ... ]
>>>> +static int __init aef_query_info(void)
>>>> +{
>>>> + int ret;
>>>> +
>>>> + if (IS_ENABLED(CONFIG_KVM_S390_ARM64)) {
>>>> + info.sae_avail = sclp.has_aef;
>>>> + info.ptff_avail = ptff_query(PTFF_QAGTO) &&
>>>> + ptff_query(PTFF_QAGPT);
>>>> + info.arm_guest_supp = info.sae_avail && info.ptff_avail;
>>>> + }
Wait, aef_sysfs_init() already early returns if !enabled.
We'll never end up in this function if !enabled.
Generally I'd like to keep it similar to the kernel UV code.
If QAAF is available create the sysfs files and provide qaaf data.
KVM support is separate from the QAAF data.
I'll have a second look tomorrow.
next prev parent reply other threads:[~2026-09-01 16:36 UTC|newest]
Thread overview: 53+ 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-09-01 7:48 ` Marc Zyngier
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-09-01 7:51 ` Marc Zyngier
2026-09-01 9:25 ` Steffen Eiden
2026-09-02 7:49 ` Marc Zyngier
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-09-01 8:08 ` Marc Zyngier
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-09-01 8:15 ` Marc Zyngier
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-09-01 8:17 ` Marc Zyngier
2026-09-01 9:29 ` Steffen Eiden
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-09-01 8:30 ` Marc Zyngier
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-09-01 11:44 ` Janosch Frank
2026-09-01 14:25 ` Steffen Eiden
2026-09-01 16:36 ` Janosch Frank [this message]
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
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=b840a492-f8ba-4a43-9b29-3359cfc98fa3@linux.ibm.com \
--to=frankja@linux.ibm.com \
--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