From: Aurelien Jarno <aurelien@aurel32.net>
To: Andre Przywara <andre.przywara@amd.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/4] TCG x86: add lock mov cr0 = cr8
Date: Sun, 4 Oct 2009 14:06:59 +0200 [thread overview]
Message-ID: <20091004120659.GP6691@hall.aurel32.net> (raw)
In-Reply-To: <1253313049-25874-3-git-send-email-andre.przywara@amd.com>
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 <andre.przywara@amd.com>
> ---
> 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
next prev parent reply other threads:[~2009-10-04 12:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-18 22:30 [Qemu-devel] [PATCH 0/4] TCG: add some instructions Andre Przywara
2009-09-18 22:30 ` [Qemu-devel] [PATCH 1/4] TCG x86: implement lzcnt emulation Andre Przywara
2009-10-04 12:02 ` Aurelien Jarno
2009-10-05 8:20 ` [Qemu-devel] [PATCH 1/4 v2] " Andre Przywara
2009-10-05 13:57 ` [Qemu-devel] " Aurelien Jarno
2009-10-23 11:44 ` [Qemu-devel] [PATCH v3] " Andre Przywara
2009-09-18 22:30 ` [Qemu-devel] [PATCH 2/4] TCG x86: add lock mov cr0 = cr8 Andre Przywara
2009-10-04 12:06 ` Aurelien Jarno [this message]
2009-09-18 22:30 ` [Qemu-devel] [PATCH 3/4] TCG x86: add SSE4a instruction support Andre Przywara
2009-10-04 12:10 ` Aurelien Jarno
2009-09-18 22:30 ` [Qemu-devel] [PATCH 4/4] TCG x86: add RDTSCP support Andre Przywara
2009-10-04 12:47 ` Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091004120659.GP6691@hall.aurel32.net \
--to=aurelien@aurel32.net \
--cc=andre.przywara@amd.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).