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

Mark Brown broonie at kernel.org
Tue Jun 4 06:13:16 PDT 2024


On Tue, Jun 04, 2024 at 01:03:07PM +0100, Fuad Tabba wrote:
> 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.

I think this needs a comment mentioning what's going on here.

> 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().

The reason I was suggesting inlining was that it removes the need to
name the function.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240604/cd52a1b5/attachment.sig>


More information about the linux-arm-kernel mailing list