public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Mikael Pettersson <mikpe@it.uu.se>,
	Andi Kleen <andi@firstfloor.org>,
	mingo@elte.hu, tglx@linutronix.de, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, roland@redhat.com, drepper@redhat.com,
	Hongjiu.lu@intel.com, linux-kernel@vger.kernel.org,
	arjan@linux.intel.com, rmk+lkml@arm.linux.org.uk, dan@debian.org,
	asit.k.mallick@intel.com
Subject: Re: [RFC] x86: xsave/xrstor support, ucontext_t extensions
Date: Thu, 22 May 2008 19:45:36 -0700	[thread overview]
Message-ID: <48362FD0.9030104@zytor.com> (raw)
In-Reply-To: <20080523014855.GA18385@linux-os.sc.intel.com>

Suresh Siddha wrote:
> On Thu, May 22, 2008 at 02:34:45PM -0700, H. Peter Anvin wrote:
>> Suresh Siddha wrote:
>>> can you please elaborate? even in presence of virtualization, appropriate
>>> cpuid bits need to be set/visible for application, for xsave/xrstor to work
>>> properly.
>>>
>> For many paravirtualization solutions, CPUID "leak" from the hypervisor. 
>>  The fact that CPUID cannot be disabled (made ring 0 only) is a major 
>> flaw in the architecture.
>>
>> Therefore, relying on CPUID is too dangerous.
> 
> hmm.. so the kernel needs to export all the cpuid info (that the kernel enables
> and supports) to the user through some mechanism then?

Not really.  Most of the CPUID information doesn't have a OS-dependent 
portion, but the parts that do cause problems (there are other issues, 
like the hypervisor wanting to limit the feature set available to the 
client, but there is no real solution to that, and certainly it would be 
out of scope for this discussion.)

> atleast in the xsave case, hypervisor can completely control the
> OSXSAVE flag. I am still not convinced whether I need to add prctl()
> to indicate the layout. If I have to add, then it should not just
> be about whether xsave information is included in _fpstate or not, it should also
> be about the whole cpuid information provided by the xsave architecture. Because
> the user potentially needs all that information, to make sense out of
> the data layout included in the extended state area.

Agreed that this information is needed, although it probably would be 
better to leave it in the frame itself; that way at least the rt frames 
would stand on their own.  I'm worried about using the reserved fields 
since they could be messed up by ptrace, but you could also argue that 
if you have the ability to trace the process you can do anything else to 
it; that way we could use a reserved field to signal the presence of the 
XSAVE information in the frame; I would hope that that XSAVE information 
would be self-describing (perhaps a linked list of blocks or a separate 
chain of descriptors.)

In other words, we know of a place to stash the presence flag for rt 
signal frames, the uc_flags field; we effectively need to find a place 
to stash the uc_flags field for the non-rt frame.

Michael, you wrote:

> Hmm, right now it seems this field has a de-facto ABI of being
> either 0xffff (plain) or 0x0000 (fxsr). Using other values would
> confuse at least one application I know of. Sad.

... could you share what application that is?  This otherwise would be 
ideal.

	-hpa

  parent reply	other threads:[~2008-05-23  6:02 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-13  1:10 [RFC] x86: xsave/xrstor support, ucontext_t extensions Suresh Siddha
2008-05-16 13:26 ` Mikael Pettersson
2008-05-18  1:34   ` Suresh Siddha
2008-05-19 14:52     ` Mikael Pettersson
2008-05-19 15:04       ` Andi Kleen
2008-05-19 16:29       ` H. Peter Anvin
2008-05-19 16:57         ` Suresh Siddha
2008-05-19 17:45           ` H. Peter Anvin
2008-05-20  1:57       ` Suresh Siddha
2008-05-20  8:58         ` Mikael Pettersson
2008-05-20 10:01         ` Andi Kleen
2008-05-20 13:19           ` Mikael Pettersson
2008-05-20 14:58             ` H. Peter Anvin
2008-05-20 15:20               ` Mikael Pettersson
2008-05-20 17:53                 ` Suresh Siddha
2008-05-20 17:59                   ` H. Peter Anvin
2008-05-22  0:28                   ` H. Peter Anvin
2008-05-22  0:53                     ` Roland McGrath
2008-05-22  1:38                       ` H. Peter Anvin
2008-05-22  6:40                         ` Roland McGrath
2008-05-22  7:18                           ` H. Peter Anvin
2008-05-22  8:49                       ` Mikael Pettersson
2008-05-22  8:57                     ` Mikael Pettersson
2008-05-22 20:56                       ` Suresh Siddha
2008-05-22 21:02                         ` H. Peter Anvin
2008-05-22 21:29                           ` Suresh Siddha
2008-05-22 21:34                             ` H. Peter Anvin
2008-05-22 22:22                               ` Mikael Pettersson
2008-05-23  1:48                               ` Suresh Siddha
2008-05-23  2:12                                 ` Roland McGrath
2008-05-23  2:49                                   ` H. Peter Anvin
2008-05-23 18:09                                     ` Suresh Siddha
2008-06-06  0:28                                       ` x86: xsave/xrstor support; " H. Peter Anvin
2008-06-06 20:14                                         ` Suresh Siddha
2008-06-06 23:03                                           ` H. Peter Anvin
2008-05-23  2:45                                 ` H. Peter Anvin [this message]
2008-05-23 11:46                                   ` [RFC] x86: xsave/xrstor support, " Mikael Pettersson
2008-05-23 12:11                                     ` Andi Kleen
2008-05-22 21:32                           ` Chris Wright
2008-05-22 22:15                             ` Mikael Pettersson
2008-05-22 22:29                               ` Chris Wright
2008-05-23  0:32                                 ` H. Peter Anvin
2008-05-23  0:44                                   ` Chris Wright
2008-05-22 22:36                           ` Mikael Pettersson
2008-05-23  0:33                             ` H. Peter Anvin
2008-05-23  0:42                               ` Suresh Siddha
2008-05-23  1:33                                 ` Roland McGrath
2008-05-23 16:57                                   ` H. Peter Anvin
2008-05-23 17:50                                     ` Suresh Siddha
2008-05-23  2:27                                 ` H. Peter Anvin
2008-05-20 17:57                 ` H. Peter Anvin
2008-05-20 14:55           ` H. Peter Anvin
2008-05-20 15:03             ` Andi Kleen
2008-05-20 20:10               ` Roland McGrath
2008-05-22  0:05                 ` H. Peter Anvin
2008-05-22  0:47                   ` Roland McGrath
2008-05-22  8:14                     ` Andi Kleen

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=48362FD0.9030104@zytor.com \
    --to=hpa@zytor.com \
    --cc=Hongjiu.lu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=arjan@linux.intel.com \
    --cc=asit.k.mallick@intel.com \
    --cc=dan@debian.org \
    --cc=drepper@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    --cc=mingo@elte.hu \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=roland@redhat.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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