aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-02-19 13:38:07 -0500
committerAvi Kivity <avi@redhat.com>2010-04-25 05:38:28 -0400
commit48005f64d0ea965d454e38b5181af4aba9bdef5b (patch)
tree15aa4fe79716e3089893c8e9d48d7e0b898d2693 /arch/x86/include
parent03b82a30ea8b26199901b219848d706dbd70c609 (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/include')
-rw-r--r--arch/x86/include/asm/kvm.h7
-rw-r--r--arch/x86/include/asm/kvm_emulate.h3
2 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/include/asm/kvm.h b/arch/x86/include/asm/kvm.h
index f46b79f6c16c..fb6117063ea3 100644
--- a/arch/x86/include/asm/kvm.h
+++ b/arch/x86/include/asm/kvm.h
@@ -257,6 +257,11 @@ struct kvm_reinject_control {
257/* When set in flags, include corresponding fields on KVM_SET_VCPU_EVENTS */ 257/* When set in flags, include corresponding fields on KVM_SET_VCPU_EVENTS */
258#define KVM_VCPUEVENT_VALID_NMI_PENDING 0x00000001 258#define KVM_VCPUEVENT_VALID_NMI_PENDING 0x00000001
259#define KVM_VCPUEVENT_VALID_SIPI_VECTOR 0x00000002 259#define KVM_VCPUEVENT_VALID_SIPI_VECTOR 0x00000002
260#define KVM_VCPUEVENT_VALID_SHADOW 0x00000004
261
262/* Interrupt shadow states */
263#define KVM_X86_SHADOW_INT_MOV_SS 0x01
264#define KVM_X86_SHADOW_INT_STI 0x02
260 265
261/* for KVM_GET/SET_VCPU_EVENTS */ 266/* for KVM_GET/SET_VCPU_EVENTS */
262struct kvm_vcpu_events { 267struct kvm_vcpu_events {
@@ -271,7 +276,7 @@ struct kvm_vcpu_events {
271 __u8 injected; 276 __u8 injected;
272 __u8 nr; 277 __u8 nr;
273 __u8 soft; 278 __u8 soft;
274 __u8 pad; 279 __u8 shadow;
275 } interrupt; 280 } interrupt;
276 struct { 281 struct {
277 __u8 injected; 282 __u8 injected;
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index 7a6f54fa13ba..2666d7ac3229 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -153,9 +153,6 @@ struct decode_cache {
153 struct fetch_cache fetch; 153 struct fetch_cache fetch;
154}; 154};
155 155
156#define X86_SHADOW_INT_MOV_SS 1
157#define X86_SHADOW_INT_STI 2
158
159struct x86_emulate_ctxt { 156struct x86_emulate_ctxt {
160 /* Register state before/after emulation. */ 157 /* Register state before/after emulation. */
161 struct kvm_vcpu *vcpu; 158 struct kvm_vcpu *vcpu;