All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Huaitong Han <huaitong.han@intel.com>,
	kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area
Date: Tue, 1 Dec 2015 09:20:41 -0800	[thread overview]
Message-ID: <565DD6E9.1040906@twiddle.net> (raw)
In-Reply-To: <20151201171550.GN23717@thinpad.lan.raisama.net>

On 12/01/2015 09:15 AM, Eduardo Habkost wrote:
> On Tue, Dec 01, 2015 at 09:09:47AM -0800, Richard Henderson wrote:
>> On 11/30/2015 03:18 AM, Paolo Bonzini wrote:
>>> Because this is always little endian, I would write it as uint8_t[16][16].
>>
>> Maybe.  That isn't altogether handy for TCG, since we'll be wanting to bswap
>> these buffers (probably in uint64_t chunks).
>
> X86XSaveArea will be used only when loading/saving state using
> xsave, not for executing regular instructions.

... like the regular instruction xsave?

https://patchwork.ozlabs.org/patch/493318/

> In X86CPU, the
> data is already stored as XMMReg unions (the one with the
> XMM_[BWDQ] helpers).

Of course.  But those unions are arranged to be in big-endian format on 
big-endian hosts.  So we need to swap the data back to little-endian format for 
storage into guest memory.


r~

WARNING: multiple messages have this Message-ID (diff)
From: Richard Henderson <rth@twiddle.net>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org,
	Huaitong Han <huaitong.han@intel.com>
Subject: Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area
Date: Tue, 1 Dec 2015 09:20:41 -0800	[thread overview]
Message-ID: <565DD6E9.1040906@twiddle.net> (raw)
In-Reply-To: <20151201171550.GN23717@thinpad.lan.raisama.net>

On 12/01/2015 09:15 AM, Eduardo Habkost wrote:
> On Tue, Dec 01, 2015 at 09:09:47AM -0800, Richard Henderson wrote:
>> On 11/30/2015 03:18 AM, Paolo Bonzini wrote:
>>> Because this is always little endian, I would write it as uint8_t[16][16].
>>
>> Maybe.  That isn't altogether handy for TCG, since we'll be wanting to bswap
>> these buffers (probably in uint64_t chunks).
>
> X86XSaveArea will be used only when loading/saving state using
> xsave, not for executing regular instructions.

... like the regular instruction xsave?

https://patchwork.ozlabs.org/patch/493318/

> In X86CPU, the
> data is already stored as XMMReg unions (the one with the
> XMM_[BWDQ] helpers).

Of course.  But those unions are arranged to be in big-endian format on 
big-endian hosts.  So we need to swap the data back to little-endian format for 
storage into guest memory.


r~

  reply	other threads:[~2015-12-01 17:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-28 19:56 [for-2.6 PATCH 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes Eduardo Habkost
2015-11-28 19:56 ` [Qemu-devel] " Eduardo Habkost
2015-11-28 19:56 ` [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area Eduardo Habkost
2015-11-28 19:56   ` [Qemu-devel] " Eduardo Habkost
2015-11-30 11:18   ` Paolo Bonzini
2015-11-30 11:18     ` [Qemu-devel] " Paolo Bonzini
2015-11-30 14:48     ` Eduardo Habkost
2015-11-30 14:48       ` [Qemu-devel] " Eduardo Habkost
2015-12-01 17:09     ` Richard Henderson
2015-12-01 17:15       ` Eduardo Habkost
2015-12-01 17:15         ` Eduardo Habkost
2015-12-01 17:20         ` Richard Henderson [this message]
2015-12-01 17:20           ` Richard Henderson
2015-12-01 17:27           ` Paolo Bonzini
2015-12-01 17:27             ` Paolo Bonzini
2015-12-01 18:34             ` Eduardo Habkost
2015-12-01 18:34               ` Eduardo Habkost
2015-12-01 18:42               ` Richard Henderson
2015-12-01 18:42                 ` Richard Henderson
2015-11-28 19:56 ` [for-2.6 PATCH 2/3] target-i386: Use xsave structs for ext_save_area Eduardo Habkost
2015-11-28 19:56   ` [Qemu-devel] " Eduardo Habkost
2015-11-28 19:56 ` [for-2.6 PATCH 3/3] target-i386: kvm: Use X86XSaveArea struct for xsave save/load Eduardo Habkost
2015-11-28 19:56   ` [Qemu-devel] " Eduardo Habkost
2015-11-30 11:21 ` [for-2.6 PATCH 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes Paolo Bonzini
2015-11-30 11:21   ` [Qemu-devel] " Paolo Bonzini
2015-11-30 14:14   ` Eduardo Habkost
2015-11-30 14:14     ` [Qemu-devel] " Eduardo Habkost

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=565DD6E9.1040906@twiddle.net \
    --to=rth@twiddle.net \
    --cc=ehabkost@redhat.com \
    --cc=huaitong.han@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.