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>
This commit is contained in:

committed by
Paolo Bonzini

parent
02357bdc8c
commit
c44b4c6ab8
@@ -4534,14 +4534,11 @@ static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *))
|
||||
|
||||
void init_decode_cache(struct x86_emulate_ctxt *ctxt)
|
||||
{
|
||||
memset(&ctxt->opcode_len, 0,
|
||||
(void *)&ctxt->_regs - (void *)&ctxt->opcode_len);
|
||||
memset(&ctxt->has_seg_override, 0,
|
||||
(void *)&ctxt->modrm - (void *)&ctxt->has_seg_override);
|
||||
|
||||
ctxt->fetch.start = 0;
|
||||
ctxt->fetch.end = 0;
|
||||
ctxt->io_read.pos = 0;
|
||||
ctxt->io_read.end = 0;
|
||||
ctxt->mem_read.pos = 0;
|
||||
ctxt->mem_read.end = 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user