File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -690,7 +690,9 @@ void kvm_set_cpu_caps(void)
690
690
kvm_cpu_cap_set (X86_FEATURE_TSC_ADJUST );
691
691
kvm_cpu_cap_set (X86_FEATURE_ARCH_CAPABILITIES );
692
692
693
- if (boot_cpu_has (X86_FEATURE_IBPB ) && boot_cpu_has (X86_FEATURE_IBRS ))
693
+ if (boot_cpu_has (X86_FEATURE_AMD_IBPB_RET ) &&
694
+ boot_cpu_has (X86_FEATURE_AMD_IBPB ) &&
695
+ boot_cpu_has (X86_FEATURE_AMD_IBRS ))
694
696
kvm_cpu_cap_set (X86_FEATURE_SPEC_CTRL );
695
697
if (boot_cpu_has (X86_FEATURE_STIBP ))
696
698
kvm_cpu_cap_set (X86_FEATURE_INTEL_STIBP );
@@ -763,8 +765,12 @@ void kvm_set_cpu_caps(void)
763
765
* arch/x86/kernel/cpu/bugs.c is kind enough to
764
766
* record that in cpufeatures so use them.
765
767
*/
766
- if (boot_cpu_has (X86_FEATURE_IBPB ))
768
+ if (boot_cpu_has (X86_FEATURE_IBPB )) {
767
769
kvm_cpu_cap_set (X86_FEATURE_AMD_IBPB );
770
+ if (boot_cpu_has (X86_FEATURE_SPEC_CTRL ) &&
771
+ !boot_cpu_has_bug (X86_BUG_EIBRS_PBRSB ))
772
+ kvm_cpu_cap_set (X86_FEATURE_AMD_IBPB_RET );
773
+ }
768
774
if (boot_cpu_has (X86_FEATURE_IBRS ))
769
775
kvm_cpu_cap_set (X86_FEATURE_AMD_IBRS );
770
776
if (boot_cpu_has (X86_FEATURE_STIBP ))
You can’t perform that action at this time.
0 commit comments