From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 5/5] KVM: x86: Fix wrong masking on relative jump/call Date: Wed, 07 May 2014 17:59:39 +0200 Message-ID: <536A586B.2060200@redhat.com> References: <1399465972-4026-1-git-send-email-namit@cs.technion.ac.il> <1399465972-4026-6-git-send-email-namit@cs.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: gleb@kernel.org, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Nadav Amit , mtosatti@redhat.com, hpa@zytor.com Return-path: In-Reply-To: <1399465972-4026-6-git-send-email-namit@cs.technion.ac.il> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Il 07/05/2014 14:32, Nadav Amit ha scritto: > Relative jumps and calls do the masking according to the operand size, and not > according to the address size as the KVM emulator does today. In 64-bit mode, > the resulting RIP is always 64-bit. Otherwise it is masked according to the > instruction operand-size. Note that when 16-bit address size is used, bits > 63:32 are unmodified. The SDM says "If the operand-size attribute is 16, the upper two bytes of the EIP register are cleared, resulting in a maximum instruction pointer size of 16 bits". I'm not sure whether that should also imply that 63:32 are _not_ unmodified (because you do a 32-bit write not a 16-bit one), but in any case it looks like masked_increment is not the right function. Paolo