From c44b4c6ab80eef3a9c52c7b3f0c632942e6489aa Mon Sep 17 00:00:00 2001 From: Bandan Das Date: Wed, 16 Apr 2014 12:46:12 -0400 Subject: 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 Signed-off-by: Paolo Bonzini --- arch/x86/kvm/emulate.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'arch/x86/kvm') 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 *)) 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; } -- cgit v1.2.3