aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-07-24 13:59:40 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-07-30 14:00:11 +0200
commit1d3db6bdbb0b541744cc9e008371ec7a37986d8a (patch)
tree429888e80132821ef356f91cd0654457c877a70c /target
parent990e0be2603511560168e1ad61f68294d951c39e (diff)
i386: implement MSR_SMI_COUNT for TCG
This is trivial, so just do it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target')
-rw-r--r--target/i386/misc_helper.c3
-rw-r--r--target/i386/smm_helper.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/target/i386/misc_helper.c b/target/i386/misc_helper.c
index 628f64aad5..78f2020ef2 100644
--- a/target/i386/misc_helper.c
+++ b/target/i386/misc_helper.c
@@ -447,6 +447,9 @@ void helper_rdmsr(CPUX86State *env)
val = env->tsc_aux;
break;
#endif
+ case MSR_SMI_COUNT:
+ val = env->msr_smi_count;
+ break;
case MSR_MTRRphysBase(0):
case MSR_MTRRphysBase(1):
case MSR_MTRRphysBase(2):
diff --git a/target/i386/smm_helper.c b/target/i386/smm_helper.c
index 90621e5977..c1c34a75db 100644
--- a/target/i386/smm_helper.c
+++ b/target/i386/smm_helper.c
@@ -54,6 +54,7 @@ void do_smm_enter(X86CPU *cpu)
qemu_log_mask(CPU_LOG_INT, "SMM: enter\n");
log_cpu_state_mask(CPU_LOG_INT, CPU(cpu), CPU_DUMP_CCOP);
+ env->msr_smi_count++;
env->hflags |= HF_SMM_MASK;
if (env->hflags2 & HF2_NMI_MASK) {
env->hflags2 |= HF2_SMM_INSIDE_NMI_MASK;