Re: [PATCH v2 5/5] KVM: arm64: Exclude FP ownership from kvm_vcpu_arch

Mark Brown
2024-03-22T17:52:50Z

[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]

On Fri, Mar 22, 2024 at 05:09:45PM +0000, Marc Zyngier wrote:
> In retrospect, it is fairly obvious that the FP state ownership
> is only meaningful for a given CPU, and that locating this
> information in the vcpu was just a mistake.
>
> Move the ownership tracking into the host data structure, and
> rename it from fp_state to fp_owner, which is a better description
> (name suggested by Mark Brown).

There's still the thing with the interaction with SME support - to
summarise what I think you're asking for the userspace ABI there:

- Create a requirement for userspace to set SVCR prior to setting any
vector impacted register to ensure the correct format and that data
isn't zeroed when SVCR is set.
- Use the value of SVCR.SM and the guest maximum SVE and SME VLs to
select the currently visible vector length for the Z, P and FFR
registers, and if FFR can be accessed if not available in streaming
mode.
- Changes to SVCR.SM zero register data in the same way writes to the
physical register do.
- This also implies discarding or failing all writes to ZA and ZT0
unless SVCR.ZA is set for consistency.
- Add support for the V registers in the sysreg interface when SVE is
enabled.

then the implementation can do what it likes to achieve that, the most
obvious thing being to store in native format for the current hardware
mode based on SVCR.{SM,ZA}. Does that sound about right?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]