Skip to content

Commit

Permalink
x86/zhaoxin: Use common IA32_FEAT_CTL MSR initialization
Browse files Browse the repository at this point in the history
Use the recently added IA32_FEAT_CTL MSR initialization sequence to
opportunistically enable VMX support when running on a Zhaoxin CPU.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20191221044513.21680-8-sean.j.christopherson@intel.com
  • Loading branch information
Sean Christopherson authored and Borislav Petkov committed Jan 13, 2020
1 parent 5014449 commit 7d37953
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/Kconfig.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ config X86_DEBUGCTLMSR

config IA32_FEAT_CTL
def_bool y
depends on CPU_SUP_INTEL || CPU_SUP_CENTAUR
depends on CPU_SUP_INTEL || CPU_SUP_CENTAUR || CPU_SUP_ZHAOXIN

menuconfig PROCESSOR_SELECT
bool "Supported processor vendors" if EXPERT
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/cpu/zhaoxin.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ static void init_zhaoxin(struct cpuinfo_x86 *c)
set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
#endif

init_ia32_feat_ctl(c);

if (cpu_has(c, X86_FEATURE_VMX))
zhaoxin_detect_vmx_virtcap(c);
}
Expand Down

0 comments on commit 7d37953

Please sign in to comment.