diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2010-02-19 13:38:07 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-04-25 05:38:28 -0400 |
commit | 48005f64d0ea965d454e38b5181af4aba9bdef5b (patch) | |
tree | 15aa4fe79716e3089893c8e9d48d7e0b898d2693 /arch/x86/kvm/emulate.c | |
parent | 03b82a30ea8b26199901b219848d706dbd70c609 (diff) |
KVM: x86: Save&restore interrupt shadow mask
The interrupt shadow created by STI or MOV-SS-like operations is part of
the VCPU state and must be preserved across migration. Transfer it in
the spare padding field of kvm_vcpu_events.interrupt.
As a side effect we now have to make vmx_set_interrupt_shadow robust
against both shadow types being set. Give MOV SS a higher priority and
skip STI in that case to avoid that VMX throws a fault on next entry.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 35f7acd4a91f..c9f604b0819c 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2128,7 +2128,7 @@ special_insn: | |||
2128 | } | 2128 | } |
2129 | 2129 | ||
2130 | if (c->modrm_reg == VCPU_SREG_SS) | 2130 | if (c->modrm_reg == VCPU_SREG_SS) |
2131 | toggle_interruptibility(ctxt, X86_SHADOW_INT_MOV_SS); | 2131 | toggle_interruptibility(ctxt, KVM_X86_SHADOW_INT_MOV_SS); |
2132 | 2132 | ||
2133 | rc = kvm_load_segment_descriptor(ctxt->vcpu, sel, c->modrm_reg); | 2133 | rc = kvm_load_segment_descriptor(ctxt->vcpu, sel, c->modrm_reg); |
2134 | 2134 | ||
@@ -2366,7 +2366,7 @@ special_insn: | |||
2366 | if (emulator_bad_iopl(ctxt)) | 2366 | if (emulator_bad_iopl(ctxt)) |
2367 | kvm_inject_gp(ctxt->vcpu, 0); | 2367 | kvm_inject_gp(ctxt->vcpu, 0); |
2368 | else { | 2368 | else { |
2369 | toggle_interruptibility(ctxt, X86_SHADOW_INT_STI); | 2369 | toggle_interruptibility(ctxt, KVM_X86_SHADOW_INT_STI); |
2370 | ctxt->eflags |= X86_EFLAGS_IF; | 2370 | ctxt->eflags |= X86_EFLAGS_IF; |
2371 | c->dst.type = OP_NONE; /* Disable writeback. */ | 2371 | c->dst.type = OP_NONE; /* Disable writeback. */ |
2372 | } | 2372 | } |