On Fri, Mar 22, 2024 at 12:36:40PM +1300,
"Huang, Kai" <kai.huang@xxxxxxxxx> wrote:
So how about:Thanks for it. I'll update the commit message with some minor fixes.
"^'s
TDX has its own mechanism to control the maximum number of VCPUs that the
TDX guest can use. When creating a TDX guest, the maximum number of vcpus
needs to be passed to the TDX module as part of the measurement of the
guest.
Because the value is part of the measurement, thus part of attestation, it
better to allow the userspace to be able to configure it. E.g. the usersthe userspace to configure it ^,
may want to precisely control the maximum number of vcpus their precious VMsper-VM maximum number of vcpus
can use.
The actual control itself must be done via the TDH.MNG.INIT SEAMCALL itself,
where the number of maximum cpus is an input to the TDX module, but KVM
needs to support the "per-VM number of maximum vcpus" and reflect that in
the KVM_CAP_MAX_VCPUS.maximum number of vcpus
Currently, the KVM x86 always reports KVM_MAX_VCPUS for all VMs but doesn't
allow to enable KVM_CAP_MAX_VCPUS to configure the number of maximum vcpus
on VM-basis.used
Add "per-VM maximum vcpus" to KVM x86/TDX to accommodate TDX's needs.
The userspace-configured value then can be verified when KVM is actually
creating the TDX guest.
"