[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <607a10e4-6678-4148-9d5e-ec030b742207@sirena.org.uk>
Date: Mon, 4 Mar 2024 16:27:22 +0000
From: Mark Brown <broonie@...nel.org>
To: Marc Zyngier <maz@...nel.org>
Cc: Oliver Upton <oliver.upton@...ux.dev>,
James Morse <james.morse@....com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, linux-arm-kernel@...ts.infradead.org,
kvmarm@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] KVM: arm64: Reuse struct cpu_fp_state to track
the guest FP state
On Sat, Mar 02, 2024 at 11:30:51AM +0000, Marc Zyngier wrote:
> Mark Brown <broonie@...nel.org> 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?
You were previously complaining that we were having to bind too much
floating point state each time we bind a guest to a CPU, the goal here
is to address this concern by filling in the structure at startup and
then reusing it. As noted in the commit log given that this state
includes system registers there are difficulties in trying to rearrange
things so everything is in a single structure, I'm not sure that having
to special case the FP registers would be a win there.
> 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.
I'm having a hard time understanding what you're thinking of here, this
is mainly about addressing whatever it is that's concering you but I'm
not sure I have a good handle on what that is other than just a general
concern that there's a lot of FP state which needs binding. If we put
something in the per-CPU state without reorganising the data a lot it'll
look very similar to the code you were complaining about, the current
code is doing roughly what you suggest already.
Personally I'm not overly concerned about the current state of the
world and find it to be a reasonable tradeoff given what's going on,
this is trying to address your feedback.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists