Re: [PATCH] KVM: x86: Expose Predictive Store Forwarding Disable

From: Paolo Bonzini
Date: Mon Sep 27 2021 - 08:54:16 EST


On 27/09/21 14:28, Borislav Petkov wrote:
On Mon, Sep 27, 2021 at 02:14:52PM +0200, Paolo Bonzini wrote:
Right, not which MSR to write but which value to write. It doesn't know
that the PSF disable bit is valid unless the corresponding CPUID bit is set.

There's no need for the separate PSF CPUID bit yet. We have decided for
now to not control PSF separately but disable it through SSB. Please
follow this thread:

There are other guests than Linux. This patch is just telling userspace that KVM knows what the PSFD bit is. It is also possible to expose the bit in KVM without having any #define in cpufeatures.h or without the kernel using it. For example KVM had been exposing FSGSBASE long before Linux supported it.

That said, the patch is incomplete because it should also add the new CPUID bit to guest_has_spec_ctrl_msr (what KVM *really* cares about is not the individual bits, only whether SPEC_CTRL exists at all).

Paolo