From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MuPrl-0007XS-Bv for qemu-devel@nongnu.org; Sun, 04 Oct 2009 08:07:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MuPrk-0007Wv-5H for qemu-devel@nongnu.org; Sun, 04 Oct 2009 08:07:04 -0400 Received: from [199.232.76.173] (port=50057 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MuPrj-0007Wm-MW for qemu-devel@nongnu.org; Sun, 04 Oct 2009 08:07:03 -0400 Received: from hall.aurel32.net ([88.191.82.174]:51500) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MuPri-0007AE-Iq for qemu-devel@nongnu.org; Sun, 04 Oct 2009 08:07:03 -0400 Date: Sun, 4 Oct 2009 14:06:59 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 2/4] TCG x86: add lock mov cr0 = cr8 Message-ID: <20091004120659.GP6691@hall.aurel32.net> References: <1253313049-25874-1-git-send-email-andre.przywara@amd.com> <1253313049-25874-3-git-send-email-andre.przywara@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1253313049-25874-3-git-send-email-andre.przywara@amd.com> Sender: Aurelien Jarno List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andre Przywara Cc: qemu-devel@nongnu.org On Sat, Sep 19, 2009 at 12:30:47AM +0200, Andre Przywara wrote: > AMD CPUs featuring a shortcut to access CR8 even from 32-bit mode. > If you use the LOCK prefix with "mov CR0", it accesses CR8 instead. > This behavior is guarded by the CR8_LEGACY CPUID bit > (Fn8000_0001:ECX[1]). Thanks, applied. > Signed-off-by: Andre Przywara > --- > target-i386/translate.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/target-i386/translate.c b/target-i386/translate.c > index aaa4492..134c870 100644 > --- a/target-i386/translate.c > +++ b/target-i386/translate.c > @@ -7362,6 +7362,10 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) > ot = OT_QUAD; > else > ot = OT_LONG; > + if ((prefixes & PREFIX_LOCK) && (reg == 0) && > + (s->cpuid_ext3_features & CPUID_EXT3_CR8LEG)) { > + reg = 8; > + } > switch(reg) { > case 0: > case 2: > -- > 1.6.1.3 > > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net