Skip to content

Commit

Permalink
KVM: x86: Use new is_noncanonical_address in _linearize
Browse files Browse the repository at this point in the history
Replace the current canonical address check with the new function which is
identical.

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 3, 2014
1 parent d09155d commit 4be4de7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ static __always_inline int __linearize(struct x86_emulate_ctxt *ctxt,
*max_size = 0;
switch (ctxt->mode) {
case X86EMUL_MODE_PROT64:
if (((signed long)la << 16) >> 16 != la)
if (is_noncanonical_address(la))
return emulate_gp(ctxt, 0);

*max_size = min_t(u64, ~0u, (1ull << 48) - la);
Expand Down

0 comments on commit 4be4de7

Please sign in to comment.