qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Cc: Alexander Graf <alex@csgraf.de>
Subject: Re: [Qemu-devel] [5318] SYSENTER/SYSEXIT IA-32e implementation (Alexander Graf).
Date: Mon, 29 Sep 2008 11:10:58 -0500	[thread overview]
Message-ID: <48E0FE12.5080408@codemonkey.ws> (raw)
In-Reply-To: <E1KivO1-0005Gh-Nh@cvs.savannah.gnu.org>

Andrzej Zaborowski wrote:
> Revision: 5318
>           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5318
> Author:   balrog
> Date:     2008-09-25 18:16:18 +0000 (Thu, 25 Sep 2008)
>
> Log Message:
> -----------
> SYSENTER/SYSEXIT IA-32e implementation (Alexander Graf).
>
> On Intel CPUs, sysenter and sysexit are valid in 64-bit mode. This patch
> makes both 64-bit aware and enables them for Intel CPUs.
> Add cpu save/load for 64-bit wide sysenter variables.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
>   

This change broke save/restore.  It was already broken when this commit 
happened so it really just further broke it :-)

> Modified: trunk/target-i386/cpu.h
> ===================================================================
> --- trunk/target-i386/cpu.h	2008-09-25 18:11:30 UTC (rev 5317)
> +++ trunk/target-i386/cpu.h	2008-09-25 18:16:18 UTC (rev 5318)
> @@ -549,8 +549,8 @@
>  
>      /* sysenter registers */
>      uint32_t sysenter_cs;
>   

is a u32

> -    uint32_t sysenter_esp;
> -    uint32_t sysenter_eip;
> +    target_ulong sysenter_esp;
> +    target_ulong sysenter_eip;
>      uint64_t efer;
>      uint64_t star;
>   

But is being saved as a target_ulong.

> -    qemu_put_be32s(f, &env->sysenter_cs);
> -    qemu_put_be32s(f, &env->sysenter_esp);
> -    qemu_put_be32s(f, &env->sysenter_eip);
> +    qemu_put_betls(f, &env->sysenter_cs);
> +    qemu_put_betls(f, &env->sysenter_esp);
> +    qemu_put_betls(f, &env->sysenter_eip);
>  
>      qemu_put_betls(f, &env->cr[0]);
>      qemu_put_betls(f, &env->cr[2]);
> @@ -169,7 +169,7 @@

And loaded as a u32.

>  
>      qemu_get_be32s(f, &env->sysenter_cs);
> -    qemu_get_be32s(f, &env->sysenter_esp);
> -    qemu_get_be32s(f, &env->sysenter_eip);
> +    if (version_id >= 7) {
> +        qemu_get_betls(f, &env->sysenter_esp);
> +        qemu_get_betls(f, &env->sysenter_eip);
> +    } else {
> +        qemu_get_be32s(f, &env->sysenter_esp);
> +        qemu_get_be32s(f, &env->sysenter_eip);
> +    }
>  

When making changes to target-i386, please make sure to test both qemu 
and qemu-system-x86_64.  In this case, the code would have worked with 
qemu but it doesn't work with qemu-system-x86_64.

Regards,

Anthony Liguori

  reply	other threads:[~2008-09-29 16:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-25 18:16 [Qemu-devel] [5318] SYSENTER/SYSEXIT IA-32e implementation (Alexander Graf) Andrzej Zaborowski
2008-09-29 16:10 ` Anthony Liguori [this message]
2008-09-29 16:20   ` Alexander Graf
2008-09-29 16:28     ` Anthony Liguori

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=48E0FE12.5080408@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=alex@csgraf.de \
    --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).