Re: [PATCH v7 4/8] KVM: arm64: Move PSCI helper functions to a shared header

Fuad Tabba <[email protected]> Wed, 29 Jul 2026 14:33:40 +0100
Newsgroups dev.linux.lists.sashiko-reviews,dev.linux.lists.kvmarm
Message-ID <CA+EHjTw8zvPuMMefpGCMFnDRNawVkc_+XdW8pDxj40g=AFQ_sg@mail.gmail.com>
On Wed, 29 Jul 2026 at 14:31, <[email protected]> wrote:
>
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] Missing header dependencies in include/kvm/arm_psci.h

nope:

https://lore.kernel.org/all/CA+EHjTwpB2fmoYGfkP5RVZcB4sgbVPQ0=QR5dyUJnpQ_VQa+pA@mail.gmail.com/

/fuad

> --
>
> --- Patch [4]: [PATCH v7 4/8] KVM: arm64: Move PSCI helper functions to a shared header ---
> commit 4d648c3ac7ab8549b7dcf7d52de4756db87e329c
> Author: Fuad Tabba <[email protected]>
>
> KVM: arm64: Move PSCI helper functions to a shared header
>
> This commit moves several PSCI helper functions from psci.c to the shared
> include/kvm/arm_psci.h header. This makes them available for upcoming
> protected-guest PSCI calls at EL2.
>
> > diff --git a/include/kvm/arm_psci.h b/include/kvm/arm_psci.h
> > index cbaec804eb839..f86a006d67136 100644
> > --- a/include/kvm/arm_psci.h
> > +++ b/include/kvm/arm_psci.h
>
> [ ... ]
>
> > +/* Narrow the PSCI register arguments (r1 to r3) to 32 bits. */
> > +static inline void kvm_psci_narrow_to_32bit(struct kvm_vcpu *vcpu)
> > +{
> > +     int i;
> > +
> > +     /*
> > +      * Zero the input registers' upper 32 bits. They will be fully
> > +      * zeroed on exit, so we're fine changing them in place.
> > +      */
> > +     for (i = 1; i < 4; i++)
> > +             vcpu_set_reg(vcpu, i, lower_32_bits(vcpu_get_reg(vcpu, i)));
> > +}
>
> [Severity: Low]
> Does this header need to include additional dependencies to remain
> self-contained?
>
> This inline function uses vcpu_set_reg() and vcpu_get_reg(), which are defined
> in <asm/kvm_emulate.h>, as well as lower_32_bits() from <linux/wordpart.h>.
> If a new C file includes <kvm/arm_psci.h> without first including those
> dependencies, it looks like it could trigger a build failure.
>
> --
> Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=4