From: Marc Zyngier <maz@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: "Oliver Upton" <oupton@kernel.org>, kvmarm@lists.linux.dev
Subject: Re: [PATCH 4/4] KVM: arm64: vgic-v5: Correctly handle host ISTE __le32 conversion
Date: Sat, 19 Sep 2026 16:50:35 +0100 [thread overview]
Message-ID: <87cxu944vo.wl-maz@kernel.org> (raw)
In-Reply-To: <20260919123905.515941F000FF@smtp.kernel.org>
On Sat, 19 Sep 2026 13:39:04 +0100,
sashiko-bot@kernel.org wrote:
>
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] kvm: arm64: code and commit message mismatch regarding h_iste type
> --
>
> commit a916f514228ceaaf50a5546f6df29cea59ab15f1
> Author: Marc Zyngier <maz@kernel.org>
>
> KVM: arm64: vgic-v5: Correctly handle host ISTE __le32 conversion
>
> This commit addresses a sparse warning by modifying the endianness
> conversion of the host ISTE. The intent is to define h_iste as a u32
> instead of __le32, doing the conversion at the point of access.
>
> Closes: https://lore.kernel.org/oe-kbuild-all/202609191215.to1MBYak-lkp@intel.com/
>
> > diff --git a/arch/arm64/kvm/vgic/vgic-v5-tables.c b/arch/arm64/kvm/vgic/vgic-v5-tables.c
> > index 2c8d0f360506c..aae5cf05f3907 100644
> > --- a/arch/arm64/kvm/vgic/vgic-v5-tables.c
> > +++ b/arch/arm64/kvm/vgic/vgic-v5-tables.c
>
> [ ... ]
>
> > @@ -1520,7 +1520,7 @@ static int vgic_v5_save_two_level_ist(const struct vgic_v5_ist_desc *ist,
> > h_iste = *(__le32 *)(h_l2_ist_base +
> > h_l2_index * ist->iste_size);
> >
> > - ret = put_user(h_iste, uaddr);
> > + ret = put_user(le32_to_cpu(h_iste), uaddr);
> > if (ret)
> > return ret;
>
> [Severity: Medium]
> Is the refactoring in vgic_v5_save_two_level_ist() incomplete?
>
> The commit message explicitly states "define h_iste as a u32", and this
> pattern was applied to the other three functions modified in the file.
> However, in vgic_v5_save_two_level_ist(), the h_iste variable retains
> its __le32 type at the top of the function, and the conversion is instead
> done inline within the put_user() call.
>
> Does this variable also need to be redefined as a u32 to remain consistent
> with the commit description and the rest of the patch?
I'll add this to this patch.
M.
diff --git a/arch/arm64/kvm/vgic/vgic-v5-tables.c b/arch/arm64/kvm/vgic/vgic-v5-tables.c
index aae5cf05f3907..d577e485ebe9e 100644
--- a/arch/arm64/kvm/vgic/vgic-v5-tables.c
+++ b/arch/arm64/kvm/vgic/vgic-v5-tables.c
@@ -1490,7 +1490,6 @@ static int vgic_v5_save_two_level_ist(const struct vgic_v5_ist_desc *ist,
struct vgic_v5_two_level_ist_shape shape;
size_t h_l1_index, h_l2_index;
void *h_l2_ist_base;
- __le32 h_iste;
int ret;
shape = vgic_v5_two_level_ist_shape(ist);
@@ -1517,10 +1516,10 @@ static int vgic_v5_save_two_level_ist(const struct vgic_v5_ist_desc *ist,
shape.l2_entries * ist->iste_size);
for (h_l2_index = 0; h_l2_index < shape.l2_entries; h_l2_index++) {
- h_iste = *(__le32 *)(h_l2_ist_base +
- h_l2_index * ist->iste_size);
+ void *h_iste_addr = h_l2_ist_base + h_l2_index * ist->iste_size;
+ u32 h_iste = le32_to_cpu(*(__le32 *)h_iste_addr);
- ret = put_user(le32_to_cpu(h_iste), uaddr);
+ ret = put_user(h_iste, uaddr);
if (ret)
return ret;
--
Jazz isn't dead. It just smells funny.
next prev parent reply other threads:[~2026-09-19 15:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 12:31 [PATCH 0/4] KVM: arm64: vgic-v5: Random sparse fixes Marc Zyngier
2026-09-19 12:31 ` [PATCH 1/4] KVM: arm64: vgic-v5: Drop __iomem attribute from {vmd,vpet}_base Marc Zyngier
2026-09-20 14:43 ` Fuad Tabba
2026-09-19 12:31 ` [PATCH 2/4] KVM: arm64: vgic-v5: Correctly reset h_lpi_ist to NULL Marc Zyngier
2026-09-20 14:42 ` Fuad Tabba
2026-09-19 12:31 ` [PATCH 3/4] KVM: arm64: vgic-v5: Tidy-up programming of vpe descriptor address Marc Zyngier
2026-09-20 14:42 ` Fuad Tabba
2026-09-19 12:31 ` [PATCH 4/4] KVM: arm64: vgic-v5: Correctly handle host ISTE __le32 conversion Marc Zyngier
2026-09-19 12:39 ` sashiko-bot
2026-09-19 15:50 ` Marc Zyngier [this message]
2026-09-20 14:42 ` Fuad Tabba
2026-09-20 14:36 ` [PATCH 0/4] KVM: arm64: vgic-v5: Random sparse fixes Fuad Tabba
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=87cxu944vo.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=oupton@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.