From: Nadav Amit Date: Thu, 18 Sep 2014 19:39:40 +0000 (+0300) Subject: KVM: x86: Use new is_noncanonical_address in _linearize X-Git-Tag: Ubuntu-5.0.0-8.9~10247^2~114 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=4be4de7ef9fd3a4d77320d4713970299ffecd286;p=mirror_ubuntu-disco-kernel.git KVM: x86: Use new is_noncanonical_address in _linearize Replace the current canonical address check with the new function which is identical. Signed-off-by: Nadav Amit Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 07e9913d6bbb..77041d494052 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -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);