Re: [PATCH v11 8/8] KVM: SVM: Enable Secure TSC for SNP guests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 8/20/2025 5:18 AM, Sean Christopherson wrote:
> From: Nikunj A Dadhania <nikunj@xxxxxxx>
> 
> @@ -2195,6 +2206,12 @@ static int snp_launch_start(struct kvm *kvm, struct kvm_sev_cmd *argp)
>  
>  	start.gctx_paddr = __psp_pa(sev->snp_context);
>  	start.policy = params.policy;
> +
> +	if (snp_is_secure_tsc_enabled(kvm)) {
> +		WARN_ON_ONCE(!kvm->arch.default_tsc_khz);

Any particular reason to drop the the following change: 

+		if (WARN_ON(!kvm->arch.default_tsc_khz)) {
+			rc = -EINVAL;
+			goto e_free_context;
+		}

As this is an unsupported configuration as per the SEV SNP Firmware ABI Specification: 

8.16 SNP_LAUNCH_START

DESIRED_TSC_FREQ
Hypervisor-desired mean TSC frequency in KHz of the guest. This field has no effect if guests
do not enable Secure TSC in the VMSA. The hypervisor should set this field to 0h if it 
*does not support Secure TSC* for this guest.

> +		start.desired_tsc_khz = kvm->arch.default_tsc_khz;
> +	}
> +
Regards,Nikunj




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux