On Fri, Nov 07, 2025 at 02:21:24PM +0530, Naveen N Rao wrote: > On Thu, Nov 06, 2025 at 01:09:37PM +0100, Markus Armbruster wrote: > > Pardon my ignorance... > > > > "Naveen N Rao (AMD)" <[email protected]> writes: > > > > > Add support for configuring the TSC frequency when Secure TSC is enabled > > > in SEV-SNP guests through a new "tsc-frequency" property on SEV-SNP > > > guest objects, similar to the vCPU-specific property used by regular > > > guests and TDX. > > > > Which property exactly? > > Same name: tsc-frequency specified with '-cpu' > > > > > > A new property is needed since SEV-SNP guests require > > > the TSC frequency to be specified during early SNP_LAUNCH_START command > > > before any vCPUs are created. > > > > Sounds awkward. > > > > Do the two properties set the same thing at different times? > > Yes. For regular guests, TSC frequency is set using a vCPU ioctl. > However, TDX and SEV-SNP (with Secure TSC) require the TSC frequency to > be set as a VM property (there is a VM ioctl for this purpose).
The '-cpu' arg is global to the VM, so even though the ioctl is per-VCPU, a single '-cpu ...,tsc-frequency=NNN' argument applies universally to all the vCPUs in regular guests. > This was Tom's question too (see v2): is there any way to re-use > 'tsc-frequency' specified with '-cpu' for Secure TSC. I see no reason why we can't simply use the existing '-cpu tsc-frequency' value. Fetch the CPU 0 object and query its "tsc-frequency" property, and just assume all non-0 CPUs have the same tsc-frequency, since we don't provide a way to set it differently per-CPU IIUC. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
