public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Richter <robert.richter@amd.com>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 6/7] x86, xsave: disable xsave in i387 emulation mode
Date: Thu, 22 Jul 2010 14:36:03 +0200	[thread overview]
Message-ID: <20100722123603.GU26154@erda.amd.com> (raw)
In-Reply-To: <1279736162.2812.3.camel@sbs-t61.sc.intel.com>

On 21.07.10 14:16:02, Suresh Siddha wrote:

> I think it is cleaner to clear these cpu capabilities in the function
> which handles no387 boot parameter.

This does not cover all (of course weird but potentially existing)
cases. Disabling xsave in the no387 setup would only work if an fpu
exists. The implementation below disables it if the soft fpu is actual
used. An artificial condition that would break your approach would be
no fpu but xsave. There is no hardware like this but maybe virtual
machines configurations.

So I think it does not hurt to deactivate xsave directly when enabling
soft fpu. The only drawback here is if fpu and xsave initialization
order changes. Hmm...

-Robert

> 
> Otherwise Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
> 
> thanks.
> 
> > 
> > Signed-off-by: Robert Richter <robert.richter@amd.com>
> > ---
> >  arch/x86/kernel/i387.c |    6 ++++++
> >  1 files changed, 6 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
> > index e73c54e..ff81143 100644
> > --- a/arch/x86/kernel/i387.c
> > +++ b/arch/x86/kernel/i387.c
> > @@ -67,6 +67,12 @@ static void __cpuinit init_thread_xstate(void)
> >  	 */
> >  
> >  	if (!HAVE_HWFP) {
> > +		/*
> > +		 * Disable xsave as we do not support it if i387
> > +		 * emulation is enabled.
> > +		 */
> > +		setup_clear_cpu_cap(X86_FEATURE_XSAVE);
> > +		setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
> >  		xstate_size = sizeof(struct i387_soft_struct);
> >  		return;
> >  	}
> 
> 

-- 
Advanced Micro Devices, Inc.
Operating System Research Center


  reply	other threads:[~2010-07-22 12:39 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-21 17:03 [PATCH 0/7] x86, xsave: some code cleanups and reworks, -v2 Robert Richter
2010-07-21 17:03 ` [PATCH 1/7] x86, xsave: separate fpu and xsave initialization Robert Richter
2010-07-21 22:36   ` [tip:x86/xsave] x86, xsave: Separate " tip-bot for Robert Richter
2010-07-21 17:03 ` [PATCH 2/7] x86, xsave: introduce xstate enable functions Robert Richter
2010-07-21 21:10   ` H. Peter Anvin
2010-07-21 21:20     ` Suresh Siddha
2010-07-21 21:53       ` H. Peter Anvin
2010-07-21 22:32         ` Suresh Siddha
2010-07-22 12:15         ` Robert Richter
2010-07-22 12:23           ` H. Peter Anvin
2010-07-22 13:16             ` Robert Richter
2010-07-21 22:38     ` [tip:x86/xsave] x86, xsave: Make xstate_enable_boot_cpu() __init, protect on CPU 0 tip-bot for H. Peter Anvin
2010-07-21 22:37   ` [tip:x86/xsave] x86, xsave: Introduce xstate enable functions tip-bot for Robert Richter
2010-07-21 17:03 ` [PATCH 3/7] x86, xsave: check cpuid level for XSTATE_CPUID (0x0d) Robert Richter
2010-07-21 22:37   ` [tip:x86/xsave] x86, xsave: Check " tip-bot for Robert Richter
2010-07-21 17:03 ` [PATCH 4/7] x86, xsave: make init_xstate_buf static Robert Richter
2010-07-21 22:37   ` [tip:x86/xsave] x86, xsave: Make " tip-bot for Robert Richter
2010-07-21 17:03 ` [PATCH 5/7] x86, xsave: add __init attribute to setup_xstate_features() Robert Richter
2010-07-21 22:37   ` [tip:x86/xsave] x86, xsave: Add " tip-bot for Robert Richter
2010-07-21 17:03 ` [PATCH 6/7] x86, xsave: disable xsave in i387 emulation mode Robert Richter
2010-07-21 18:16   ` Suresh Siddha
2010-07-22 12:36     ` Robert Richter [this message]
2010-07-23 17:50       ` Suresh Siddha
2010-07-26 16:42         ` Robert Richter
2010-07-26 18:26       ` H. Peter Anvin
2010-07-27  8:53         ` Robert Richter
2010-08-12 22:06   ` [tip:x86/fpu] x86, xsave: Disable " tip-bot for Robert Richter
2010-07-21 17:03 ` [PATCH 7/7] x86: removing boot_cpu_id variable Robert Richter
2010-08-12 21:03   ` [tip:x86/cleanups] x86, cleanup: Remove obsolete " tip-bot for Robert Richter
2010-07-21 18:19 ` [PATCH 0/7] x86, xsave: some code cleanups and reworks, -v2 Suresh Siddha
2010-07-21 20:55 ` H. Peter Anvin
2010-07-21 21:07   ` H. Peter Anvin
2010-08-10 19:24 ` [osrc-patches] " Robert Richter

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=20100722123603.GU26154@erda.amd.com \
    --to=robert.richter@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=suresh.b.siddha@intel.com \
    /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