diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-03-18 09:20:14 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:16:11 -0400 |
commit | a41ffb7540cb37426759e688083502d6463421b2 (patch) | |
tree | ed71c38eb0af69cfbb412a1a6a0e8c1221b6c66d /arch/x86/kvm | |
parent | fd5253658b403d51fc19e56ecb44c54a3071fded (diff) |
KVM: x86 emulator: If LOCK prefix is used dest arg should be memory.
If LOCK prefix is used dest arg should be memory, otherwise instruction
should generate #UD.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/emulate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index b89a8f217332..46a7ee3040a0 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -1842,7 +1842,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) | |||
1842 | } | 1842 | } |
1843 | 1843 | ||
1844 | /* LOCK prefix is allowed only with some instructions */ | 1844 | /* LOCK prefix is allowed only with some instructions */ |
1845 | if (c->lock_prefix && !(c->d & Lock)) { | 1845 | if (c->lock_prefix && (!(c->d & Lock) || c->dst.type != OP_MEM)) { |
1846 | kvm_queue_exception(ctxt->vcpu, UD_VECTOR); | 1846 | kvm_queue_exception(ctxt->vcpu, UD_VECTOR); |
1847 | goto done; | 1847 | goto done; |
1848 | } | 1848 | } |