hvf: support PAT msr

This commit is contained in:
espes 2018-10-06 17:52:32 +10:00
parent 99cfb38552
commit 7d500c46e6
2 changed files with 11 additions and 1 deletions

View File

@ -698,6 +698,9 @@ void simulate_rdmsr(struct CPUState *cpu)
case MSR_CSTAR:
abort();
break;
case MSR_PAT:
val = env->pat;
break;
case MSR_IA32_MISC_ENABLE:
val = env->msr_ia32_misc_enable;
break;
@ -742,7 +745,7 @@ void simulate_rdmsr(struct CPUState *cpu)
val = env->mtrr_deftype;
break;
default:
/* fprintf(stderr, "%s: unknown msr 0x%x\n", __func__, msr); */
fprintf(stderr, "%s: unknown msr 0x%x\n", __func__, msr);
val = 0;
break;
}
@ -798,6 +801,9 @@ void simulate_wrmsr(struct CPUState *cpu)
hv_vcpu_invalidate_tlb(cpu->hvf_fd);
}
break;
case MSR_PAT:
env->pat = data;
break;
case MSR_MTRRphysBase(0):
case MSR_MTRRphysBase(1):
case MSR_MTRRphysBase(2):

View File

@ -141,6 +141,8 @@ void hvf_put_msrs(CPUState *cpu_state)
hv_vcpu_write_msr(cpu_state->hvf_fd, MSR_IA32_SYSENTER_EIP,
env->sysenter_eip);
hv_vcpu_write_msr(cpu_state->hvf_fd, MSR_PAT, env->pat);
hv_vcpu_write_msr(cpu_state->hvf_fd, MSR_STAR, env->star);
#ifdef TARGET_X86_64
@ -231,6 +233,8 @@ void hvf_get_msrs(CPUState *cpu_state)
hv_vcpu_read_msr(cpu_state->hvf_fd, MSR_IA32_SYSENTER_EIP, &tmp);
env->sysenter_eip = tmp;
hv_vcpu_read_msr(cpu_state->hvf_fd, MSR_PAT, &env->pat);
hv_vcpu_read_msr(cpu_state->hvf_fd, MSR_STAR, &env->star);
#ifdef TARGET_X86_64