Lines Matching refs:c
23 static void init_vmx_capabilities(struct cpuinfo_x86 *c) in init_vmx_capabilities() argument
40 c->vmx_capability[PRIMARY_CTLS] = supported; in init_vmx_capabilities()
43 c->vmx_capability[SECONDARY_CTLS] = supported; in init_vmx_capabilities()
57 c->vmx_capability[MISC_FEATURES] = (supported & 0xffff) | in init_vmx_capabilities()
63 c->vmx_capability[MISC_FEATURES] |= VMX_F(EPT_EXECUTE_ONLY); in init_vmx_capabilities()
65 c->vmx_capability[MISC_FEATURES] |= VMX_F(EPT_AD); in init_vmx_capabilities()
67 c->vmx_capability[MISC_FEATURES] |= VMX_F(EPT_1GB); in init_vmx_capabilities()
70 if ((c->vmx_capability[PRIMARY_CTLS] & VMX_F(VIRTUAL_TPR)) && in init_vmx_capabilities()
71 (c->vmx_capability[SECONDARY_CTLS] & VMX_F(VIRT_APIC_ACCESSES))) in init_vmx_capabilities()
72 c->vmx_capability[MISC_FEATURES] |= VMX_F(FLEXPRIORITY); in init_vmx_capabilities()
74 if ((c->vmx_capability[PRIMARY_CTLS] & VMX_F(VIRTUAL_TPR)) && in init_vmx_capabilities()
75 (c->vmx_capability[SECONDARY_CTLS] & VMX_F(APIC_REGISTER_VIRT)) && in init_vmx_capabilities()
76 (c->vmx_capability[SECONDARY_CTLS] & VMX_F(VIRT_INTR_DELIVERY)) && in init_vmx_capabilities()
77 (c->vmx_capability[MISC_FEATURES] & VMX_F(POSTED_INTR))) in init_vmx_capabilities()
78 c->vmx_capability[MISC_FEATURES] |= VMX_F(APICV); in init_vmx_capabilities()
81 if (c->vmx_capability[PRIMARY_CTLS] & VMX_F(VIRTUAL_TPR)) in init_vmx_capabilities()
82 set_cpu_cap(c, X86_FEATURE_TPR_SHADOW); in init_vmx_capabilities()
83 if (c->vmx_capability[MISC_FEATURES] & VMX_F(FLEXPRIORITY)) in init_vmx_capabilities()
84 set_cpu_cap(c, X86_FEATURE_FLEXPRIORITY); in init_vmx_capabilities()
85 if (c->vmx_capability[MISC_FEATURES] & VMX_F(VIRTUAL_NMIS)) in init_vmx_capabilities()
86 set_cpu_cap(c, X86_FEATURE_VNMI); in init_vmx_capabilities()
87 if (c->vmx_capability[SECONDARY_CTLS] & VMX_F(EPT)) in init_vmx_capabilities()
88 set_cpu_cap(c, X86_FEATURE_EPT); in init_vmx_capabilities()
89 if (c->vmx_capability[MISC_FEATURES] & VMX_F(EPT_AD)) in init_vmx_capabilities()
90 set_cpu_cap(c, X86_FEATURE_EPT_AD); in init_vmx_capabilities()
91 if (c->vmx_capability[MISC_FEATURES] & VMX_F(VPID)) in init_vmx_capabilities()
92 set_cpu_cap(c, X86_FEATURE_VPID); in init_vmx_capabilities()
96 void init_ia32_feat_ctl(struct cpuinfo_x86 *c) in init_ia32_feat_ctl() argument
102 clear_cpu_cap(c, X86_FEATURE_VMX); in init_ia32_feat_ctl()
120 if (cpu_has(c, X86_FEATURE_VMX) && IS_ENABLED(CONFIG_KVM_INTEL)) { in init_ia32_feat_ctl()
130 set_cpu_cap(c, X86_FEATURE_MSR_IA32_FEAT_CTL); in init_ia32_feat_ctl()
132 if (!cpu_has(c, X86_FEATURE_VMX)) in init_ia32_feat_ctl()
140 clear_cpu_cap(c, X86_FEATURE_VMX); in init_ia32_feat_ctl()
143 init_vmx_capabilities(c); in init_ia32_feat_ctl()