aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorBandan Das <bsd@redhat.com>2014-04-16 12:46:12 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-07-11 03:14:00 -0400
commitc44b4c6ab80eef3a9c52c7b3f0c632942e6489aa (patch)
tree0ac6d21a724a39f8b87767011b25466336096fcf /arch/x86/kvm
parent02357bdc8c30a60cd33dd438f851c1306c34f435 (diff)
KVM: emulate: clean up initializations in init_decode_cache
A lot of initializations are unnecessary as they get set to appropriate values before actually being used. Optimize placement of fields in x86_emulate_ctxt Signed-off-by: Bandan Das <bsd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/emulate.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 94f5f8b94ce9..3e9bbdc4c76a 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4534,14 +4534,11 @@ static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *))
4534 4534
4535void init_decode_cache(struct x86_emulate_ctxt *ctxt) 4535void init_decode_cache(struct x86_emulate_ctxt *ctxt)
4536{ 4536{
4537 memset(&ctxt->opcode_len, 0, 4537 memset(&ctxt->has_seg_override, 0,
4538 (void *)&ctxt->_regs - (void *)&ctxt->opcode_len); 4538 (void *)&ctxt->modrm - (void *)&ctxt->has_seg_override);
4539 4539
4540 ctxt->fetch.start = 0;
4541 ctxt->fetch.end = 0;
4542 ctxt->io_read.pos = 0; 4540 ctxt->io_read.pos = 0;
4543 ctxt->io_read.end = 0; 4541 ctxt->io_read.end = 0;
4544 ctxt->mem_read.pos = 0;
4545 ctxt->mem_read.end = 0; 4542 ctxt->mem_read.end = 0;
4546} 4543}
4547 4544