Patchwork x86: Execute WP test after interrupts are enabled

login
register
mail settings
Submitter Jeremy Fitzhardinge
Date Aug. 25, 2009, 7:53 p.m.
Message ID <4A94411E.708@goop.org>
Download mbox | patch
Permalink /patch/43799/
State New, archived
Headers show

Comments

Jeremy Fitzhardinge - Aug. 25, 2009, 7:53 p.m.
On 08/25/09 12:38, Pekka Enberg wrote:
> On Tue, 2009-08-25 at 12:34 -0700, Jeremy Fitzhardinge wrote:
>   
>> I don't think this is the real fix, and it seems a bit ugly.  I'm OK
>> with it as a workaround, but I think it will end up getting reverted if
>> applied.
>>     
> Yeah, I'm fine with that. It's just that we're really late in the
> release cycle now so I'd like to keep the fix as simple as possible.

Yeah, that's fine, but I think something like this would be simpler. 
Arnd, could you test it please?

From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Date: Tue, 25 Aug 2009 12:47:17 -0700
Subject: [PATCH] xen: suppress WP test

Xen always runs on CPUs which properly support WP enforcement in
privileged mode, so there's no need to test for it.

This also works around a crash reported by Arnd Hannemann, though
I think its just a band-aid for that case.

Reported-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>



>  Do you think the real bug lies in Xen or...?
>   

I'm unsure.  If handling a trap ends up enabling interrupts for some
reason, then things would break horribly all over the place, so it would
have to be something a bit more subtle.  I'm looking into it.

    J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Pekka Enberg - Aug. 25, 2009, 7:58 p.m.
On Tue, Aug 25, 2009 at 10:53 PM, Jeremy Fitzhardinge<jeremy@goop.org> wrote:
> On 08/25/09 12:38, Pekka Enberg wrote:
>> On Tue, 2009-08-25 at 12:34 -0700, Jeremy Fitzhardinge wrote:
>>
>>> I don't think this is the real fix, and it seems a bit ugly.  I'm OK
>>> with it as a workaround, but I think it will end up getting reverted if
>>> applied.
>>>
>> Yeah, I'm fine with that. It's just that we're really late in the
>> release cycle now so I'd like to keep the fix as simple as possible.
>
> Yeah, that's fine, but I think something like this would be simpler.
> Arnd, could you test it please?
>
> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> Date: Tue, 25 Aug 2009 12:47:17 -0700
> Subject: [PATCH] xen: suppress WP test
>
> Xen always runs on CPUs which properly support WP enforcement in
> privileged mode, so there's no need to test for it.
>
> This also works around a crash reported by Arnd Hannemann, though
> I think its just a band-aid for that case.
>
> Reported-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> Cc: Pekka Enberg <penberg@cs.helsinki.fi>
>
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index 16d0d70..e5b903b 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -1069,6 +1069,7 @@ asmlinkage void __init xen_start_kernel(void)
>        /* set up basic CPUID stuff */
>        cpu_detect(&new_cpu_data);
>        new_cpu_data.hard_math = 1;
> +       new_cpu_data.wp_works_ok = 1;
>        new_cpu_data.x86_capability[0] = cpuid_edx(1);
>  #endif

Yeah, this is even better assuming it works. :-)

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Ingo Molnar - Aug. 25, 2009, 8:03 p.m.
* Pekka Enberg <penberg@cs.helsinki.fi> wrote:

> On Tue, Aug 25, 2009 at 10:53 PM, Jeremy Fitzhardinge<jeremy@goop.org> wrote:
> > On 08/25/09 12:38, Pekka Enberg wrote:
> >> On Tue, 2009-08-25 at 12:34 -0700, Jeremy Fitzhardinge wrote:
> >>
> >>> I don't think this is the real fix, and it seems a bit ugly. ?I'm OK
> >>> with it as a workaround, but I think it will end up getting reverted if
> >>> applied.
> >>>
> >> Yeah, I'm fine with that. It's just that we're really late in the
> >> release cycle now so I'd like to keep the fix as simple as possible.
> >
> > Yeah, that's fine, but I think something like this would be simpler.
> > Arnd, could you test it please?
> >
> > From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> > Date: Tue, 25 Aug 2009 12:47:17 -0700
> > Subject: [PATCH] xen: suppress WP test
> >
> > Xen always runs on CPUs which properly support WP enforcement in
> > privileged mode, so there's no need to test for it.
> >
> > This also works around a crash reported by Arnd Hannemann, though
> > I think its just a band-aid for that case.
> >
> > Reported-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
> > Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> > Cc: Pekka Enberg <penberg@cs.helsinki.fi>
> >
> > diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> > index 16d0d70..e5b903b 100644
> > --- a/arch/x86/xen/enlighten.c
> > +++ b/arch/x86/xen/enlighten.c
> > @@ -1069,6 +1069,7 @@ asmlinkage void __init xen_start_kernel(void)
> > ? ? ? ?/* set up basic CPUID stuff */
> > ? ? ? ?cpu_detect(&new_cpu_data);
> > ? ? ? ?new_cpu_data.hard_math = 1;
> > + ? ? ? new_cpu_data.wp_works_ok = 1;
> > ? ? ? ?new_cpu_data.x86_capability[0] = cpuid_edx(1);
> > ?#endif
> 
> Yeah, this is even better assuming it works. :-)
> 
> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>

yeah, we should do this one for .31.

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Arnd Hannemann - Aug. 25, 2009, 8:03 p.m.
Jeremy Fitzhardinge schrieb:
> On 08/25/09 12:38, Pekka Enberg wrote:
>> On Tue, 2009-08-25 at 12:34 -0700, Jeremy Fitzhardinge wrote:
>>
>>> I don't think this is the real fix, and it seems a bit ugly.  I'm
>>> OK with it as a workaround, but I think it will end up getting
>>> reverted if applied.
>>>
>> Yeah, I'm fine with that. It's just that we're really late in the
>> release cycle now so I'd like to keep the fix as simple as
>> possible.
>
> Yeah, that's fine, but I think something like this would be simpler.
>  Arnd, could you test it please?

Yes, this indeed also fixes my problem.


Best regards,
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 16d0d70..e5b903b 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1069,6 +1069,7 @@  asmlinkage void __init xen_start_kernel(void)
 	/* set up basic CPUID stuff */
 	cpu_detect(&new_cpu_data);
 	new_cpu_data.hard_math = 1;
+	new_cpu_data.wp_works_ok = 1;
 	new_cpu_data.x86_capability[0] = cpuid_edx(1);
 #endif