aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2013-09-22 10:44:51 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2013-10-30 13:54:39 -0400
commit1ce19dc16ce9136cccb6087e4a383ec9321980d9 (patch)
treee93153a04096bf907dee183cc4b2260c5752991f /arch/x86/kvm/x86.c
parent9c15bb1d0a8411f9bb3395d21d5309bde7da0c1c (diff)
kvm, emulator: Use opcode length
Add a field to the current emulation context which contains the instruction opcode length. This will streamline handling of opcodes of different length. Signed-off-by: Borislav Petkov <bp@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 3d1e3ee8b39e..d00d88455fef 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4789,8 +4789,8 @@ static void inject_emulated_exception(struct kvm_vcpu *vcpu)
4789 4789
4790static void init_decode_cache(struct x86_emulate_ctxt *ctxt) 4790static void init_decode_cache(struct x86_emulate_ctxt *ctxt)
4791{ 4791{
4792 memset(&ctxt->twobyte, 0, 4792 memset(&ctxt->opcode_len, 0,
4793 (void *)&ctxt->_regs - (void *)&ctxt->twobyte); 4793 (void *)&ctxt->_regs - (void *)&ctxt->opcode_len);
4794 4794
4795 ctxt->fetch.start = 0; 4795 ctxt->fetch.start = 0;
4796 ctxt->fetch.end = 0; 4796 ctxt->fetch.end = 0;