Skip to content

Commit

Permalink
KVM: x86: Move __linearize masking of la into switch
Browse files Browse the repository at this point in the history
In __linearize there is check of the condition whether to check if masking of
the linear address is needed.  It occurs immediately after switch that
evaluates the same condition.  Merge them.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Nadav Amit authored and Paolo Bonzini committed Nov 19, 2014
1 parent abc7d8a commit 31ff648
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,9 @@ static __always_inline int __linearize(struct x86_emulate_ctxt *ctxt,
}
if (size > *max_size)
goto bad;
la &= (u32)-1;
break;
}
if (ctxt->mode != X86EMUL_MODE_PROT64)
la &= (u32)-1;
if (insn_aligned(ctxt, size) && ((la & (size - 1)) != 0))
return emulate_gp(ctxt, 0);
*linear = la;
Expand Down

0 comments on commit 31ff648

Please sign in to comment.