qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/4] TCG x86: add lock mov cr0 = cr8


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH 2/4] TCG x86: add lock mov cr0 = cr8
Date: Sun, 4 Oct 2009 14:06:59 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

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 <address@hidden>
> ---
>  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
address@hidden                 http://www.aurel32.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]