On 12/20/2024 6:31 AM, Sean Christopherson wrote: >> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c >> index e86b79e975d3..38d546788fc6 100644 >> --- a/arch/x86/kvm/svm/svm.c >> +++ b/arch/x86/kvm/svm/svm.c >> @@ -4425,6 +4425,7 @@ static void svm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu) >> kvm_governed_feature_check_and_set(vcpu, X86_FEATURE_PFTHRESHOLD); >> kvm_governed_feature_check_and_set(vcpu, X86_FEATURE_VGIF); >> kvm_governed_feature_check_and_set(vcpu, X86_FEATURE_VNMI); >> + kvm_governed_feature_check_and_set(vcpu, X86_FEATURE_IDLE_HLT); >> >> svm_recalc_instruction_intercepts(vcpu, svm); >> >> @@ -5228,6 +5229,9 @@ static __init void svm_set_cpu_caps(void) >> if (vnmi) >> kvm_cpu_cap_set(X86_FEATURE_VNMI); >> >> + if (cpu_feature_enabled(X86_FEATURE_IDLE_HLT)) >> + kvm_cpu_cap_set(X86_FEATURE_IDLE_HLT); > > kvm_cpu_cap_check_and_set() does this for you. > Sure. I will use kvm_cpu_cap_check_and_set() in V5. >> + >> /* Nested VM can receive #VMEXIT instead of triggering #GP */ >> kvm_cpu_cap_set(X86_FEATURE_SVME_ADDR_CHK); >> } >> -- >> 2.34.1 >> - Manali