From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 6/6] KVM: x86: Emulator does not calculate address correctly Date: Wed, 1 Oct 2014 19:21:59 +0200 Message-ID: <20141001172158.GA6372@potion.brq.redhat.com> References: <1412099359-5316-1-git-send-email-namit@cs.technion.ac.il> <1412099359-5316-7-git-send-email-namit@cs.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: pbonzini@redhat.com, kvm@vger.kernel.org, nadav.amit@gmail.com To: Nadav Amit Return-path: Received: from mx1.redhat.com ([209.132.183.28]:8760 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751811AbaJARWH (ORCPT ); Wed, 1 Oct 2014 13:22:07 -0400 Content-Disposition: inline In-Reply-To: <1412099359-5316-7-git-send-email-namit@cs.technion.ac.il> Sender: kvm-owner@vger.kernel.org List-ID: 2014-09-30 20:49+0300, Nadav Amit: > In long-mode, when the address size is 4 bytes, the linear address is= not > truncated as the emulator mistakenly does. Instead, the offset withi= n the > segment (the ea field) should be truncated according to the address s= ize. >=20 > As Intel SDM says: "In 64-bit mode, the effective address components = are added > and the effective address is truncated ... before adding the full 64-= bit > segment base." >=20 > Signed-off-by: Nadav Amit > --- Reviewed-by: Radim Kr=C4=8Dm=C3=A1=C5=99