Commit 2b27106c authored by Nadav Amit's avatar Nadav Amit Committed by Jiri Slaby

KVM: x86: Use new is_noncanonical_address in _linearize

commit 4be4de7e upstream.

Replace the current canonical address check with the new function which is
identical.
Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent e4bcfa44
......@@ -664,7 +664,7 @@ static int __linearize(struct x86_emulate_ctxt *ctxt,
la = seg_base(ctxt, addr.seg) + addr.ea;
switch (ctxt->mode) {
case X86EMUL_MODE_PROT64:
if (((signed long)la << 16) >> 16 != la)
if (is_noncanonical_address(la))
return emulate_gp(ctxt, 0);
break;
default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment