Received: from eggs.gnu.org ([2001:4830:134:3::10]:43593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQrjf-00009c-0z for qemu-devel@nongnu.org; Sat, 23 Jul 2016 03:52:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQrje-0005eM-6Y for qemu-devel@nongnu.org; Sat, 23 Jul 2016 03:52:35 -0400 Date: Sat, 23 Jul 2016 03:51:19 -0400 (EDT) From: Paolo Bonzini Message-ID: <70840772.9841862.1469260279962.JavaMail.zimbra@redhat.com> In-Reply-To: <11445865-60ff-4d9a-ccfb-cfbcb3a92899@twiddle.net> References: <1469030260-28448-1-git-send-email-dave.hansen@intel.com> <11445865-60ff-4d9a-ccfb-cfbcb3a92899@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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: Richard Henderson Cc: Dave Hansen , dave@sr71.net, qemu-devel@nongnu.org, Dave Hansen , Eduardo Habkost , qemu-stable@nongnu.org > 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 Thanks, queued and CCed qemu-stable. Paolo