Re: [PATCH v7 07/12] KVM: arm64: arm_spe: Give SPE enabled state to KVM
From: Oliver Upton
Date: Wed Nov 20 2024 - 04:19:33 EST
Hi James,
On Tue, Nov 12, 2024 at 10:37:06AM +0000, James Clark wrote:
> Currently in nVHE, KVM has to check if SPE is enabled on every guest
> switch even if it was never used. Because it's a debug feature and is
> more likely to not be used than used, give KVM the SPE buffer status to
> allow a much simpler and faster do-nothing path in the hyp.
>
> This is always called with preemption disabled except for probe/hotplug
> which gets wrapped with preempt_disable().
Unless the performance penalty of checking if SPE is measurably bad, I'd
rather we keep things as-is.
Folks that want to go fast are probably using VHE to begin with. As you
note below, we need the hypervisor to decide if SPE is enabled based on
hardware in protected mode anyway. Using a common flow for protected and
non-protected configs keeps complexity down and increases the likelihood
SPE save/restore code actually gets tested.
--
Thanks,
Oliver