[PATCH v4 6/9] KVM: arm64: Eagerly restore host fpsimd/sve state in pKVM

Fuad Tabba tabba at google.com
Tue Jun 4 05:03:07 PDT 2024


Hi Mark,

On Mon, Jun 3, 2024 at 4:52 PM Mark Brown <broonie at kernel.org> wrote:
>
> On Mon, Jun 03, 2024 at 01:28:48PM +0100, Fuad Tabba wrote:
>
> > +static void fpsimd_sve_flush(void)
> > +{
> > +     *host_data_ptr(fp_owner) = FP_STATE_HOST_OWNED;
> > +}
>
> My previous comments about this being confusing still stand.

Sorry, I missed this in my reply to v3.

This follows the convention for save/flush in hyp-main.c. Since the
act of flushing the fpsimd/sve state is lazy, i.e., only takes place
if the guest were to use fpsimd/sve, then the only thing that we need
to do to flush is to mark the state as owned by the host.

You suggested inlining this, but since this is static, I think the
compiler would do that. Even though it's only one line, it maintains
symmetry with fpsimd_sve_sync().

Cheers,
/fuad



More information about the linux-arm-kernel mailing list