diff options
author | Sheng Yang <sheng@linux.intel.com> | 2010-06-30 00:25:15 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-08-01 03:47:21 -0400 |
commit | f5f48ee15c2ee3e44cf429e34b16c6fa9b900246 (patch) | |
tree | 75496197219d9aeedd3317fa007cc3b2e414c5da /arch/x86/kvm/emulate.c | |
parent | cf3e3d3e19868ca01da163200bbfc687523df0fc (diff) |
KVM: VMX: Execute WBINVD to keep data consistency with assigned devices
Some guest device driver may leverage the "Non-Snoop" I/O, and explicitly
WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD or
CLFLUSH, we need to maintain data consistency either by:
1: flushing cache (wbinvd) when the guest is scheduled out if there is no
wbinvd exit, or
2: execute wbinvd on all dirty physical CPUs when guest wbinvd exits.
Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com>
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index abb8cec420a2..e8bdddc4509e 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -3138,8 +3138,11 @@ twobyte_insn: | |||
3138 | emulate_clts(ctxt->vcpu); | 3138 | emulate_clts(ctxt->vcpu); |
3139 | c->dst.type = OP_NONE; | 3139 | c->dst.type = OP_NONE; |
3140 | break; | 3140 | break; |
3141 | case 0x08: /* invd */ | ||
3142 | case 0x09: /* wbinvd */ | 3141 | case 0x09: /* wbinvd */ |
3142 | kvm_emulate_wbinvd(ctxt->vcpu); | ||
3143 | c->dst.type = OP_NONE; | ||
3144 | break; | ||
3145 | case 0x08: /* invd */ | ||
3143 | case 0x0d: /* GrpP (prefetch) */ | 3146 | case 0x0d: /* GrpP (prefetch) */ |
3144 | case 0x18: /* Grp16 (prefetch/nop) */ | 3147 | case 0x18: /* Grp16 (prefetch/nop) */ |
3145 | c->dst.type = OP_NONE; | 3148 | c->dst.type = OP_NONE; |