Re: [PATCH v2 2/2] KVM: arm64: Reuse struct cpu_fp_state to track the guest FP state

From: Marc Zyngier
Date: Sat Mar 02 2024 - 06:31:01 EST


On Thu, 29 Feb 2024 21:47:35 +0000,
Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> At present we store the various bits of floating point state individually
> in struct kvm_vcpu_arch and construct a struct cpu_fp_state to share with
> the host each time we exit the guest. Let's simplify this a little by
> having a struct cpu_fp_state in the struct kvm_vcpu_arch and initialising
> this while initialising the guest.

This structure is only useful to the physical CPU we run on, and does
not capture anything that is related to the guest state. Why should it
live in the vcpu structure, duplicating things we already have?

This is just making things even more opaque.

If you need to add such a structure so that you can know what to
save/restore on context switch, then attach it to the per-CPU data
structure we already have.

M.

--
Without deviation from the norm, progress is not possible.