Lines 75-80
static bool has_msr_star;
Link Here
|
75 |
static bool has_msr_hsave_pa; |
75 |
static bool has_msr_hsave_pa; |
76 |
static bool has_msr_tsc_aux; |
76 |
static bool has_msr_tsc_aux; |
77 |
static bool has_msr_tsc_adjust; |
77 |
static bool has_msr_tsc_adjust; |
|
|
78 |
static bool has_msr_spec_ctrl; |
78 |
static bool has_msr_tsc_deadline; |
79 |
static bool has_msr_tsc_deadline; |
79 |
static bool has_msr_feature_control; |
80 |
static bool has_msr_feature_control; |
80 |
static bool has_msr_misc_enable; |
81 |
static bool has_msr_misc_enable; |
Lines 1096-1101
static int kvm_get_supported_msrs(KVMState *s)
Link Here
|
1096 |
has_msr_tsc_adjust = true; |
1097 |
has_msr_tsc_adjust = true; |
1097 |
continue; |
1098 |
continue; |
1098 |
} |
1099 |
} |
|
|
1100 |
if (kvm_msr_list->indices[i] == MSR_IA32_SPEC_CTRL) { |
1101 |
has_msr_spec_ctrl = true; |
1102 |
continue; |
1103 |
} |
1099 |
if (kvm_msr_list->indices[i] == MSR_IA32_TSCDEADLINE) { |
1104 |
if (kvm_msr_list->indices[i] == MSR_IA32_TSCDEADLINE) { |
1100 |
has_msr_tsc_deadline = true; |
1105 |
has_msr_tsc_deadline = true; |
1101 |
continue; |
1106 |
continue; |
Lines 1667-1672
static int kvm_put_msrs(X86CPU *cpu, int level)
Link Here
|
1667 |
if (has_msr_xss) { |
1672 |
if (has_msr_xss) { |
1668 |
kvm_msr_entry_add(cpu, MSR_IA32_XSS, env->xss); |
1673 |
kvm_msr_entry_add(cpu, MSR_IA32_XSS, env->xss); |
1669 |
} |
1674 |
} |
|
|
1675 |
if (has_msr_spec_ctrl) { |
1676 |
kvm_msr_entry_add(cpu, MSR_IA32_SPEC_CTRL, env->spec_ctrl); |
1677 |
} |
1670 |
#ifdef TARGET_X86_64 |
1678 |
#ifdef TARGET_X86_64 |
1671 |
if (lm_capable_kernel) { |
1679 |
if (lm_capable_kernel) { |
1672 |
kvm_msr_entry_add(cpu, MSR_CSTAR, env->cstar); |
1680 |
kvm_msr_entry_add(cpu, MSR_CSTAR, env->cstar); |
Lines 2081-2087
static int kvm_get_msrs(X86CPU *cpu)
Link Here
|
2081 |
if (has_msr_xss) { |
2089 |
if (has_msr_xss) { |
2082 |
kvm_msr_entry_add(cpu, MSR_IA32_XSS, 0); |
2090 |
kvm_msr_entry_add(cpu, MSR_IA32_XSS, 0); |
2083 |
} |
2091 |
} |
2084 |
|
2092 |
if (has_msr_spec_ctrl) { |
|
|
2093 |
kvm_msr_entry_add(cpu, MSR_IA32_SPEC_CTRL, 0); |
2094 |
} |
2085 |
|
2095 |
|
2086 |
if (!env->tsc_valid) { |
2096 |
if (!env->tsc_valid) { |
2087 |
kvm_msr_entry_add(cpu, MSR_IA32_TSC, 0); |
2097 |
kvm_msr_entry_add(cpu, MSR_IA32_TSC, 0); |
Lines 2303-2308
static int kvm_get_msrs(X86CPU *cpu)
Link Here
|
2303 |
case MSR_IA32_XSS: |
2313 |
case MSR_IA32_XSS: |
2304 |
env->xss = msrs[i].data; |
2314 |
env->xss = msrs[i].data; |
2305 |
break; |
2315 |
break; |
|
|
2316 |
case MSR_IA32_SPEC_CTRL: |
2317 |
env->spec_ctrl = msrs[i].data; |
2318 |
break; |
2306 |
default: |
2319 |
default: |
2307 |
if (msrs[i].index >= MSR_MC0_CTL && |
2320 |
if (msrs[i].index >= MSR_MC0_CTL && |
2308 |
msrs[i].index < MSR_MC0_CTL + (env->mcg_cap & 0xff) * 4) { |
2321 |
msrs[i].index < MSR_MC0_CTL + (env->mcg_cap & 0xff) * 4) { |