KVM: x86: Add support for save/load MSR_SMI_COUNT

This MSR returns the number of #SMIs that occurred on
CPU since boot.

KVM commit 52797bf9a875 ("KVM: x86: Add emulation of MSR_SMI_COUNT")
introduced support for emulating this MSR.

This commit adds support for QEMU to save/load this
MSR for migration purposes.

Backports relevant parts of commit e13713db5b609d9a83c9cfc8ba389d4215d4ba29 from qemu
This commit is contained in:
Liran Alon 2018-03-17 19:02:19 -04:00 committed by Lioncash
parent 624391bdc8
commit 9fbdd8d885
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
2 changed files with 3 additions and 0 deletions

View File

@ -3627,6 +3627,7 @@ static void x86_cpu_reset(CPUState *s)
cpu_x86_update_cr0(env, 0x60000010);
env->a20_mask = ~0x0;
env->smbase = 0x30000;
env->msr_smi_count = 0;
env->idt.limit = 0xffff;
env->gdt.limit = 0xffff;

View File

@ -338,6 +338,7 @@
#define MSR_P6_PERFCTR0 0xc1
#define MSR_IA32_SMBASE 0x9e
#define MSR_SMI_COUNT 0x34
#define MSR_MTRRcap 0xfe
#define MSR_MTRRcap_VCNT 8
#define MSR_MTRRcap_FIXRANGE_SUPPORT (1 << 8)
@ -1079,6 +1080,7 @@ typedef struct CPUX86State {
uint64_t pat;
uint32_t smbase;
uint64_t msr_smi_count;
uint32_t pkru;