Received: from eggs.gnu.org ([2001:4830:134:3::10]:60678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQlmi-00080C-B4 for qemu-devel@nongnu.org; Fri, 22 Jul 2016 21:31:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQlmd-0007om-9K for qemu-devel@nongnu.org; Fri, 22 Jul 2016 21:31:20 -0400 Received: from mail-pa0-x241.google.com ([2607:f8b0:400e:c03::241]:33594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQlmd-0007oh-1J for qemu-devel@nongnu.org; Fri, 22 Jul 2016 21:31:15 -0400 Received: by mail-pa0-x241.google.com with SMTP id q2so7737034pap.0 for ; Fri, 22 Jul 2016 18:31:14 -0700 (PDT) Sender: Richard Henderson References: <1469030260-28448-1-git-send-email-dave.hansen@intel.com> From: Richard Henderson Message-ID: <11445865-60ff-4d9a-ccfb-cfbcb3a92899@twiddle.net> Date: Sat, 23 Jul 2016 07:01:08 +0530 MIME-Version: 1.0 In-Reply-To: <1469030260-28448-1-git-send-email-dave.hansen@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] i386 translation: fix typo in xsetbv implementation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dave Hansen , dave@sr71.net, qemu-devel@nongnu.org Cc: Dave Hansen , Eduardo Habkost , Paolo Bonzini On 07/20/2016 09:27 PM, Dave Hansen wrote: > QEMU 2.6 added support for the XSAVE family of instructions, which > includes the XSETBV instruction which allows setting the 'XCR0' > register. > > But, when booting Linux kernels with XSAVE support enabled, I was > getting very early crashes where the instruction pointer was set > to 0x3. I tracked it down to a jump instruction generated by this: > > gen_jmp_im(s->pc - pc_start); > > where s->pc is pointing to the instruction after XSETBV and pc_start > is pointing _at_ XSETBV. Subtract the two and you get 0x3. Whoops. > > The fix is to replace this typo with the pattern found everywhere > else in the file when folks want to end the translation buffer. > > Richard Henderson confirmed that this is a bug and that this is the > correct fix. > > Signed-off-by: Dave Hansen > Cc: Paolo Bonzini > Cc: Eduardo Habkost > Cc: Richard Henderson > --- > target-i386/translate.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~