* [PATCH] Fix potential interrupts during alternative patching [was Re: [RFC] Avoid PIT SMP lockups]
[not found] ` <200610171505.53576.caglar@pardus.org.tr>
@ 2006-10-19 8:00 ` Zachary Amsden
2006-10-19 8:49 ` Jeremy Fitzhardinge
2006-10-20 5:25 ` Greg KH
0 siblings, 2 replies; 5+ messages in thread
From: Zachary Amsden @ 2006-10-19 8:00 UTC (permalink / raw)
To: caglar, Andi Kleen, lkml, Virtualization Mailing List, Greg KH,
Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 739 bytes --]
S.Çağlar Onur wrote:
> 17 Eki 2006 Sal 01:21 tarihinde, S.Çağlar Onur şunları yazmıştı:
>
>> 17 Eki 2006 Sal 01:17 tarihinde, Zachary Amsden şunları yazmıştı:
>>
>>> My nasty quick patch might not apply - the only tree I've got is a very
>>> hacked 2.6.18-rc6-mm1+local-patches thing, but the fix should be obvious
>>> enough.
>>>
>> Ok, I'll test and report back...
>>
>
> Both 2.6.18 and 2.6.18.1 boots without any problem (and of course without
> noreplacement workarund) with that patch.
>
> Cheers
>
So this patch is an obvious bugfix - please apply, and to stable as
well. I'm not sure when this broke, but taking interrupts in the middle
of self modifying code is not a pretty sight.
Zach
[-- Attachment #2: hotfix-alternative-irq-safety.patch --]
[-- Type: text/plain, Size: 1303 bytes --]
Interrupts must be disabled during alternative instruction patching.
On systems with high timer IRQ rates, or when running in an emulator,
timing differences can result in random kernel panics because of
running partially patched instructions. This doesn't yet fix NMIs,
which requires extricating the patch code from the late bug checking
and is logically separate (and also less likely to cause problems).
Signed-off-by: Zachary Amsden <zach@vmware.com>
diff -r 773ac0ebfeb4 arch/i386/kernel/alternative.c
--- a/arch/i386/kernel/alternative.c Wed Oct 18 06:03:56 2006 -0700
+++ b/arch/i386/kernel/alternative.c Wed Oct 18 06:07:03 2006 -0700
@@ -344,6 +344,7 @@ void alternatives_smp_switch(int smp)
void __init alternative_instructions(void)
{
+ unsigned long flags;
if (no_replacement) {
printk(KERN_INFO "(SMP-)alternatives turned off\n");
free_init_pages("SMP alternatives",
@@ -351,6 +352,8 @@ void __init alternative_instructions(voi
(unsigned long)__smp_alt_end);
return;
}
+
+ local_irq_save(flags);
apply_alternatives(__alt_instructions, __alt_instructions_end);
/* switch to patch-once-at-boottime-only mode and free the
@@ -386,4 +389,5 @@ void __init alternative_instructions(voi
alternatives_smp_switch(0);
}
#endif
-}
+ local_irq_restore(flags);
+}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix potential interrupts during alternative patching [was Re: [RFC] Avoid PIT SMP lockups]
2006-10-19 8:00 ` [PATCH] Fix potential interrupts during alternative patching [was Re: [RFC] Avoid PIT SMP lockups] Zachary Amsden
@ 2006-10-19 8:49 ` Jeremy Fitzhardinge
2006-10-19 9:00 ` Zachary Amsden
2006-10-20 5:25 ` Greg KH
1 sibling, 1 reply; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2006-10-19 8:49 UTC (permalink / raw)
To: Zachary Amsden
Cc: caglar, Andi Kleen, lkml, Virtualization Mailing List, Greg KH,
Andrew Morton
Zachary Amsden wrote:
> So this patch is an obvious bugfix - please apply, and to stable as
> well. I'm not sure when this broke, but taking interrupts in the
> middle of self modifying code is not a pretty sight.
I had actually seen this when I built the Xen paravirt kernel with SMP
on, but I assumed it was something in the pv_ops tree rather than
mainline...
J
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix potential interrupts during alternative patching [was Re: [RFC] Avoid PIT SMP lockups]
2006-10-19 8:49 ` Jeremy Fitzhardinge
@ 2006-10-19 9:00 ` Zachary Amsden
2006-10-20 10:36 ` S.Çağlar Onur
0 siblings, 1 reply; 5+ messages in thread
From: Zachary Amsden @ 2006-10-19 9:00 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: caglar, Andi Kleen, lkml, Virtualization Mailing List, Greg KH,
Andrew Morton
Jeremy Fitzhardinge wrote:
> Zachary Amsden wrote:
>> So this patch is an obvious bugfix - please apply, and to stable as
>> well. I'm not sure when this broke, but taking interrupts in the
>> middle of self modifying code is not a pretty sight.
>
> I had actually seen this when I built the Xen paravirt kernel with SMP
> on, but I assumed it was something in the pv_ops tree rather than
> mainline...
Very likely to show up in qemu as well, if you use that.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix potential interrupts during alternative patching [was Re: [RFC] Avoid PIT SMP lockups]
2006-10-19 8:00 ` [PATCH] Fix potential interrupts during alternative patching [was Re: [RFC] Avoid PIT SMP lockups] Zachary Amsden
2006-10-19 8:49 ` Jeremy Fitzhardinge
@ 2006-10-20 5:25 ` Greg KH
1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2006-10-20 5:25 UTC (permalink / raw)
To: Zachary Amsden
Cc: caglar, Andi Kleen, lkml, Virtualization Mailing List,
Andrew Morton
On Thu, Oct 19, 2006 at 01:00:55AM -0700, Zachary Amsden wrote:
> S.??a??lar Onur wrote:
> >17 Eki 2006 Sal 01:21 tarihinde, S.??a??lar Onur ??unlar?? yazm????t??:
> >
> >>17 Eki 2006 Sal 01:17 tarihinde, Zachary Amsden ??unlar?? yazm????t??:
> >>
> >>>My nasty quick patch might not apply - the only tree I've got is a very
> >>>hacked 2.6.18-rc6-mm1+local-patches thing, but the fix should be obvious
> >>>enough.
> >>>
> >>Ok, I'll test and report back...
> >>
> >
> >Both 2.6.18 and 2.6.18.1 boots without any problem (and of course without
> >noreplacement workarund) with that patch.
> >
> >Cheers
> >
>
> So this patch is an obvious bugfix - please apply, and to stable as
> well. I'm not sure when this broke, but taking interrupts in the middle
> of self modifying code is not a pretty sight.
Please send -stable patches to stable@kernel.org, not to me directly (we
are a team and hand off ownership to each other, by sending it to the
alias it makes sure that nothing gets lots in our individual mail
boxes.)
Also, please let stable know when this is upstream, we don't want to
apply it before then.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix potential interrupts during alternative patching [was Re: [RFC] Avoid PIT SMP lockups]
2006-10-19 9:00 ` Zachary Amsden
@ 2006-10-20 10:36 ` S.Çağlar Onur
0 siblings, 0 replies; 5+ messages in thread
From: S.Çağlar Onur @ 2006-10-20 10:36 UTC (permalink / raw)
To: Zachary Amsden
Cc: Jeremy Fitzhardinge, Andi Kleen, lkml,
Virtualization Mailing List, Greg KH, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 820 bytes --]
19 Eki 2006 Per 12:00 tarihinde, Zachary Amsden şunları yazmıştı:
> Jeremy Fitzhardinge wrote:
> > Zachary Amsden wrote:
> >> So this patch is an obvious bugfix - please apply, and to stable as
> >> well. I'm not sure when this broke, but taking interrupts in the
> >> middle of self modifying code is not a pretty sight.
> >
> > I had actually seen this when I built the Xen paravirt kernel with SMP
> > on, but I assumed it was something in the pv_ops tree rather than
> > mainline...
>
> Very likely to show up in qemu as well, if you use that.
I can confirm qemu and virtual pc 2004 gaves same exception without that
patch.
--
S.Çağlar Onur <caglar@pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/
Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-10-20 10:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1160170736.6140.31.camel@localhost.localdomain>
[not found] ` <453404F6.5040202@vmware.com>
[not found] ` <200610170121.51492.caglar@pardus.org.tr>
[not found] ` <200610171505.53576.caglar@pardus.org.tr>
2006-10-19 8:00 ` [PATCH] Fix potential interrupts during alternative patching [was Re: [RFC] Avoid PIT SMP lockups] Zachary Amsden
2006-10-19 8:49 ` Jeremy Fitzhardinge
2006-10-19 9:00 ` Zachary Amsden
2006-10-20 10:36 ` S.Çağlar Onur
2006-10-20 5:25 ` Greg KH
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).