* [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
@ 2008-05-21 21:10 Maciej W. Rozycki
2008-05-27 20:18 ` Maciej W. Rozycki
0 siblings, 1 reply; 11+ messages in thread
From: Maciej W. Rozycki @ 2008-05-21 21:10 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel
Some systems incorrectly report the ExtINTA pin of the I/O APIC as the
genuine target of the timer interrupt. Here is a change that copies timer
pin information found to the other pin if one has been found only. This
way both a direct and a through-8259A route is tested with the pin letting
these problematic systems work well enough.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
patch-2.6.26-rc1-20080505-timer-pins-0
diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_32.c linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_32.c
--- linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_32.c 2008-05-21 18:52:36.000000000 +0000
+++ linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_32.c 2008-05-21 18:52:36.000000000 +0000
@@ -2166,6 +2166,21 @@ static inline void __init check_timer(vo
printk(KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
vector, apic1, pin1, apic2, pin2);
+ /*
+ * Some BIOS writers are clueless and report the ExtINTA
+ * I/O APIC input from the cascaded 8259A as the timer
+ * interrupt input. So just in case, if only one pin
+ * was found above, try it both directly and through the
+ * 8259A. --macro
+ */
+ if (pin1 == -1) {
+ pin1 = pin2;
+ apic1 = apic2;
+ } else if (pin2 == -1) {
+ pin2 = pin1;
+ apic2 = apic1;
+ }
+
if (pin1 != -1) {
/*
* Ok, does IRQ0 through the IOAPIC work?
@@ -2196,7 +2211,7 @@ static inline void __init check_timer(vo
if (timer_irq_works()) {
printk("works.\n");
timer_through_8259 = 1;
- if (pin1 != -1)
+ if (pin2 != pin1 || apic2 != apic1)
replace_pin_at_irq(0, apic1, pin1, apic2, pin2);
else
add_pin_to_irq(0, apic2, pin2);
diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_64.c linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_64.c
--- linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_64.c 2008-05-18 00:24:43.000000000 +0000
+++ linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_64.c 2008-05-18 00:24:43.000000000 +0000
@@ -1669,6 +1669,21 @@ static inline void __init check_timer(vo
apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
cfg->vector, apic1, pin1, apic2, pin2);
+ /*
+ * Some BIOS writers are clueless and report the ExtINTA
+ * I/O APIC input from the cascaded 8259A as the timer
+ * interrupt input. So just in case, if only one pin
+ * was found above, try it both directly and through the
+ * 8259A. --macro
+ */
+ if (pin1 == -1) {
+ pin1 = pin2;
+ apic1 = apic2;
+ } else if (pin2 == -1) {
+ pin2 = pin1;
+ apic2 = apic1;
+ }
+
if (pin1 != -1) {
/*
* Ok, does IRQ0 through the IOAPIC work?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
2008-05-21 21:10 Maciej W. Rozycki
@ 2008-05-27 20:18 ` Maciej W. Rozycki
0 siblings, 0 replies; 11+ messages in thread
From: Maciej W. Rozycki @ 2008-05-27 20:18 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel
On Wed, 21 May 2008, Maciej W. Rozycki wrote:
> Some systems incorrectly report the ExtINTA pin of the I/O APIC as the
> genuine target of the timer interrupt. Here is a change that copies timer
> pin information found to the other pin if one has been found only. This
> way both a direct and a through-8259A route is tested with the pin letting
> these problematic systems work well enough.
>
> Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
> ---
> patch-2.6.26-rc1-20080505-timer-pins-0
Please withdraw this patch only. I shall follow with a replacement
series straight away. Please apply patches in the order of submission.
You should end up with 15 patches from both series combined. Unless a
problem is reported I think this concludes the work required for the timer
for now.
Maciej
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
@ 2008-05-27 20:19 Maciej W. Rozycki
2008-05-31 10:18 ` Ingo Molnar
0 siblings, 1 reply; 11+ messages in thread
From: Maciej W. Rozycki @ 2008-05-27 20:19 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel
Some systems incorrectly report the ExtINTA pin of the I/O APIC as the
genuine target of the timer interrupt. Here is a change that copies timer
pin information found to the other pin if one has been found only. This
way both a direct and a through-8259A route is tested with the pin letting
these problematic systems work well enough. If no timer pin information
has been found for the I/O APIC, then local APIC variations are tried
only, similarly to what is done without the change (except without the
misleading messages).
Obviously if we try the first-chance path without being told by the BIOS
to do so, we should not complain either, so do not print the message in
this case.
The 64-bit variation should be updated with a call to
replace_pin_at_irq() which can be done with the upcoming merge. Since
add_pin_to_irq() is now always called in the first-chance path, the
condition to require it in the second-chance path no longer happens.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
Ingo,
Despite looking quite innocent, this is the most intrusive modification
in the series. I tested this change (on top of all the other 14 ones)
with as many variations of interrupt wiring configuration as I could
imagine and simulate with my system. Of course my machine is perfectly
unbroken, :) so chances are more exotic convolutions may have escaped my
attention. Also I tested the 32-bit variation only. So again, I
recommend a good amount of testing in the field before this patch is
propagated upstream.
Maciej
patch-2.6.26-rc1-20080505-timer-pins-2
diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_32.c linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_32.c
--- linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_32.c 2008-05-25 22:24:53.000000000 +0000
+++ linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_32.c 2008-05-27 19:42:31.000000000 +0000
@@ -2122,6 +2122,7 @@ static inline void __init unlock_ExtINT_
static inline void __init check_timer(void)
{
int apic1, pin1, apic2, pin2;
+ int no_pin1 = 0;
int vector;
unsigned int ver;
unsigned long flags;
@@ -2159,10 +2160,30 @@ static inline void __init check_timer(vo
printk(KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
vector, apic1, pin1, apic2, pin2);
+ /*
+ * Some BIOS writers are clueless and report the ExtINTA
+ * I/O APIC input from the cascaded 8259A as the timer
+ * interrupt input. So just in case, if only one pin
+ * was found above, try it both directly and through the
+ * 8259A. --macro
+ */
+ if (pin1 == -1) {
+ pin1 = pin2;
+ apic1 = apic2;
+ no_pin1 = 1;
+ } else if (pin2 == -1) {
+ pin2 = pin1;
+ apic2 = apic1;
+ }
+
if (pin1 != -1) {
/*
* Ok, does IRQ0 through the IOAPIC work?
*/
+ if (no_pin1) {
+ add_pin_to_irq(0, apic1, pin1);
+ setup_timer_IRQ0_pin(apic1, pin1, vector);
+ }
unmask_IO_APIC_irq(0);
if (timer_irq_works()) {
if (nmi_watchdog == NMI_IO_APIC) {
@@ -2174,26 +2195,23 @@ static inline void __init check_timer(vo
goto out;
}
clear_IO_APIC_pin(apic1, pin1);
- printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to "
- "IO-APIC\n");
- }
+ if (!no_pin1)
+ printk(KERN_ERR "..MP-BIOS bug: "
+ "8254 timer not connected to IO-APIC\n");
- printk(KERN_INFO "...trying to set up timer (IRQ0) through the 8259A ... ");
- if (pin2 != -1) {
+ printk(KERN_INFO "...trying to set up timer (IRQ0) "
+ "through the 8259A ... ");
printk("\n..... (found pin %d) ...", pin2);
/*
* legacy devices should be connected to IO APIC #0
*/
+ replace_pin_at_irq(0, apic1, pin1, apic2, pin2);
setup_timer_IRQ0_pin(apic2, pin2, vector);
unmask_IO_APIC_irq(0);
enable_8259A_irq(0);
if (timer_irq_works()) {
printk("works.\n");
timer_through_8259 = 1;
- if (pin1 != -1)
- replace_pin_at_irq(0, apic1, pin1, apic2, pin2);
- else
- add_pin_to_irq(0, apic2, pin2);
if (nmi_watchdog == NMI_IO_APIC) {
disable_8259A_irq(0);
setup_nmi();
@@ -2206,8 +2224,8 @@ static inline void __init check_timer(vo
*/
disable_8259A_irq(0);
clear_IO_APIC_pin(apic2, pin2);
+ printk(" failed.\n");
}
- printk(" failed.\n");
if (nmi_watchdog == NMI_IO_APIC) {
printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n");
diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_64.c linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_64.c
--- linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_64.c 2008-05-25 22:26:43.000000000 +0000
+++ linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_64.c 2008-05-27 19:44:19.000000000 +0000
@@ -1638,6 +1638,7 @@ static inline void __init check_timer(vo
struct irq_cfg *cfg = irq_cfg + 0;
int apic1, pin1, apic2, pin2;
unsigned long flags;
+ int no_pin1 = 0;
local_irq_save(flags);
@@ -1662,10 +1663,30 @@ static inline void __init check_timer(vo
apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
cfg->vector, apic1, pin1, apic2, pin2);
+ /*
+ * Some BIOS writers are clueless and report the ExtINTA
+ * I/O APIC input from the cascaded 8259A as the timer
+ * interrupt input. So just in case, if only one pin
+ * was found above, try it both directly and through the
+ * 8259A. --macro
+ */
+ if (pin1 == -1) {
+ pin1 = pin2;
+ apic1 = apic2;
+ no_pin1 = 1;
+ } else if (pin2 == -1) {
+ pin2 = pin1;
+ apic2 = apic1;
+ }
+
if (pin1 != -1) {
/*
* Ok, does IRQ0 through the IOAPIC work?
*/
+ if (no_pin1) {
+ add_pin_to_irq(0, apic1, pin1);
+ setup_timer_IRQ0_pin(apic1, pin1, vector);
+ }
unmask_IO_APIC_irq(0);
if (!no_timer_check && timer_irq_works()) {
nmi_watchdog_default();
@@ -1678,18 +1699,19 @@ static inline void __init check_timer(vo
goto out;
}
clear_IO_APIC_pin(apic1, pin1);
- apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not "
- "connected to IO-APIC\n");
- }
-
- apic_printk(APIC_VERBOSE,KERN_INFO "...trying to set up timer (IRQ0) "
- "through the 8259A ... ");
- if (pin2 != -1) {
+ if (!no_pin1)
+ apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: "
+ "8254 timer not connected to IO-APIC\n");
+
+ apic_printk(APIC_VERBOSE,KERN_INFO
+ "...trying to set up timer (IRQ0) "
+ "through the 8259A ... ");
apic_printk(APIC_VERBOSE,"\n..... (found apic %d pin %d) ...",
apic2, pin2);
/*
* legacy devices should be connected to IO APIC #0
*/
+ /* replace_pin_at_irq(0, apic1, pin1, apic2, pin2); */
setup_timer_IRQ0_pin(apic2, pin2, cfg->vector);
unmask_IO_APIC_irq(0);
enable_8259A_irq(0);
@@ -1709,8 +1731,8 @@ static inline void __init check_timer(vo
*/
disable_8259A_irq(0);
clear_IO_APIC_pin(apic2, pin2);
+ apic_printk(APIC_VERBOSE," failed.\n");
}
- apic_printk(APIC_VERBOSE," failed.\n");
if (nmi_watchdog == NMI_IO_APIC) {
printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n");
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
2008-05-27 20:19 [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance Maciej W. Rozycki
@ 2008-05-31 10:18 ` Ingo Molnar
2008-06-05 9:19 ` Ingo Molnar
0 siblings, 1 reply; 11+ messages in thread
From: Ingo Molnar @ 2008-05-31 10:18 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel, x86
* Maciej W. Rozycki <macro@linux-mips.org> wrote:
> Despite looking quite innocent, this is the most intrusive
> modification in the series. I tested this change (on top of all the
> other 14 ones) with as many variations of interrupt wiring
> configuration as I could imagine and simulate with my system. Of
> course my machine is perfectly unbroken, :) so chances are more exotic
> convolutions may have escaped my attention. Also I tested the 32-bit
> variation only. So again, I recommend a good amount of testing in the
> field before this patch is propagated upstream.
applied all 15 APIC patches of yours to tip/x86/apic, thanks Maciej!
Ingo
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
2008-05-31 10:18 ` Ingo Molnar
@ 2008-06-05 9:19 ` Ingo Molnar
2008-06-05 14:55 ` Maciej W. Rozycki
0 siblings, 1 reply; 11+ messages in thread
From: Ingo Molnar @ 2008-06-05 9:19 UTC (permalink / raw)
To: Maciej W. Rozycki
Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel,
the arch/x86 maintainers
Maciej,
-tip testing found an IO-APIC related hang, and i bisected it down to
the problem below. What do you think about my solution? Another option
would be to add the lapic as a clockevent device in the failure path.
(since we know the NMI watchdog wont work)
Ingo
------------>
Subject: x86, io-apic: fix nmi_watchdog=1 bootup hang
From: Ingo Molnar <mingo@elte.hu>
nmi_watchdog=1 hangs on 64-bit:
[ 0.250000] Detected 12.564 MHz APIC timer.
[ 0.254178] APIC timer registered as dummy, due to nmi_watchdog=1!
[ 0.260366] Testing NMI watchdog ... <4>WARNING: CPU#0: NMI appears to be stuck (0->0)!
[ ... ]
[ 0.470003] calling genl_init+0x0/0xd0
[ hard hang ]
bisected it down to:
git-bisect start
git-bisect good 1beee8dc8cf58e3f605bd7b34d7a39939be7d8d2
git-bisect bad 11582ece0aaa2d0f94f345c08a4ab9997078a083
git-bisect bad 5479c623bb44089844022c03d4c0eb16d5b7a15f
git-bisect bad cfb4c7fabeb499e1c29f9d1878968e37a938e28a
git-bisect good 246dd412d31e4f5de1d43aa6422a325b785f36e4
git-bisect bad 3f8237eaff7dc1e35fa791dae095574fd974e671
git-bisect good 90e23b13ab849e2a11f00c655eb3a2011b4623be
git-bisect bad 833526a34eeefc117df3191a594c3c3a4f15a9ac
git-bisect good 791b93d3dfaf16c23e978bec0cc0a3dd9d855d63
git-bisect bad 65767c64068f2c93e56a1accfed5c78230ac12d7
git-bisect bad 2abc5c05dd82c188e3bdf6641a274f013348d14b
git-bisect bad 317e1f2597ffb4d4db940577bbe56dc6e881ef07
| 317e1f2597ffb4d4db940577bbe56dc6e881ef07 is first bad commit
| commit 317e1f2597ffb4d4db940577bbe56dc6e881ef07
| Author: Maciej W. Rozycki <macro@linux-mips.org>
| Date: Wed May 21 22:10:22 2008 +0100
| x86: I/O APIC: clean up the 8259A on a NMI watchdog failure
the problem is that in the dummy-lapic branch we rely on the i8259A
but if the NMI watchdog fails we turn off IRQ 0 - which doesnt work
too well ;-)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/apic_32.c | 6 ++++--
arch/x86/kernel/apic_64.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
Index: linux/arch/x86/kernel/apic_32.c
===================================================================
--- linux.orig/arch/x86/kernel/apic_32.c
+++ linux/arch/x86/kernel/apic_32.c
@@ -547,11 +547,13 @@ void __init setup_boot_APIC_clock(void)
* PIT/HPET going. Otherwise register lapic as a dummy
* device.
*/
- if (nmi_watchdog != NMI_IO_APIC)
+ if (nmi_watchdog != NMI_IO_APIC) {
lapic_clockevent.features &= ~CLOCK_EVT_FEAT_DUMMY;
- else
+ } else {
printk(KERN_WARNING "APIC timer registered as dummy,"
" due to nmi_watchdog=1!\n");
+ timer_through_8259 = 1;
+ }
}
/* Setup the lapic or request the broadcast */
Index: linux/arch/x86/kernel/apic_64.c
===================================================================
--- linux.orig/arch/x86/kernel/apic_64.c
+++ linux/arch/x86/kernel/apic_64.c
@@ -413,11 +413,13 @@ void __init setup_boot_APIC_clock(void)
* PIT/HPET going. Otherwise register lapic as a dummy
* device.
*/
- if (nmi_watchdog != NMI_IO_APIC)
+ if (nmi_watchdog != NMI_IO_APIC) {
lapic_clockevent.features &= ~CLOCK_EVT_FEAT_DUMMY;
- else
+ } else {
printk(KERN_WARNING "APIC timer registered as dummy,"
" due to nmi_watchdog=1!\n");
+ timer_through_8259 = 1;
+ }
setup_APIC_timer();
}
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
2008-06-05 9:19 ` Ingo Molnar
@ 2008-06-05 14:55 ` Maciej W. Rozycki
2008-06-05 15:03 ` Ingo Molnar
0 siblings, 1 reply; 11+ messages in thread
From: Maciej W. Rozycki @ 2008-06-05 14:55 UTC (permalink / raw)
To: Ingo Molnar
Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel,
the arch/x86 maintainers
On Thu, 5 Jun 2008, Ingo Molnar wrote:
> -tip testing found an IO-APIC related hang, and i bisected it down to
> the problem below. What do you think about my solution? Another option
> would be to add the lapic as a clockevent device in the failure path.
> (since we know the NMI watchdog wont work)
It seems wrong to me to set timer_through_8259 in apic_{32,64}.c -- can I
get .config for this setup as well as the bootstrap log? Why is the 8259A
needed here to supply the timer interrupt? It shouldn't be needed except
as arranged in check_timer() -- elsewhere the corresponding I/O APIC input
is not set up correctly.
Note I have chosen the default value of timer_through_8259 deliberately
to trigger dodgy cases like this ;) so that they can be investigated.
Maciej
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
2008-06-05 14:55 ` Maciej W. Rozycki
@ 2008-06-05 15:03 ` Ingo Molnar
2008-06-05 18:33 ` Maciej W. Rozycki
0 siblings, 1 reply; 11+ messages in thread
From: Ingo Molnar @ 2008-06-05 15:03 UTC (permalink / raw)
To: Maciej W. Rozycki
Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel,
the arch/x86 maintainers
* Maciej W. Rozycki <macro@linux-mips.org> wrote:
> It seems wrong to me to set timer_through_8259 in apic_{32,64}.c --
> can I get .config for this setup as well as the bootstrap log? Why is
> the 8259A needed here to supply the timer interrupt? It shouldn't be
> needed except as arranged in check_timer() -- elsewhere the
> corresponding I/O APIC input is not set up correctly.
>
> Note I have chosen the default value of timer_through_8259
> deliberately to trigger dodgy cases like this ;) so that they can be
> investigated.
find them here:
http://redhat.com/~mingo/misc/config-Thu_Jun__5_16_40_50_CEST_2008.bad
http://redhat.com/~mingo/misc/log-Thu_Jun__5_16_40_50_CEST_2008.bad
NOTE: you need to copy out and use the boot parameters from the boot
log:
[ 0.000000] Command line: root=/dev/sda6 console=ttyS0,115200
earlyprintk=se rial,ttyS0,115200 debug initcall_debug apic=verbose
sysrq_always_enabled ignore _loglevel selinux=0 nmi_watchdog=1
profile=0 maxcpus=1 nosmp no_hz=off highres =0 noapic nolapic_timer
hpet=disable idle=mwait
as -tip testing occasionally randomizes boot parameters too. (to find
regressions like this) Let me know if you cannot reproduce this.
Ingo
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
2008-06-05 15:03 ` Ingo Molnar
@ 2008-06-05 18:33 ` Maciej W. Rozycki
2008-06-05 18:52 ` Cyrill Gorcunov
2008-06-05 19:00 ` Cyrill Gorcunov
0 siblings, 2 replies; 11+ messages in thread
From: Maciej W. Rozycki @ 2008-06-05 18:33 UTC (permalink / raw)
To: Ingo Molnar
Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel,
the arch/x86 maintainers
On Thu, 5 Jun 2008, Ingo Molnar wrote:
> NOTE: you need to copy out and use the boot parameters from the boot
> log:
>
> [ 0.000000] Command line: root=/dev/sda6 console=ttyS0,115200
> earlyprintk=se rial,ttyS0,115200 debug initcall_debug apic=verbose
> sysrq_always_enabled ignore _loglevel selinux=0 nmi_watchdog=1
> profile=0 maxcpus=1 nosmp no_hz=off highres =0 noapic nolapic_timer
> hpet=disable idle=mwait
>
> as -tip testing occasionally randomizes boot parameters too. (to find
> regressions like this) Let me know if you cannot reproduce this.
Thanks. I figured out I cannot build an x86-64 kernel, because my i386
compiler does not support the target. Probably because of target library
dependencies at the time I built my compiler. I would have to build a
bare-iron cross-compiler for the x86-64 which I'd rather not to just to
fix this small problem -- it usually takes a few days to sort out all the
pesky details when doing such a build from scratch, so it better be well
justified.
However, the reason is quite clear to me -- the command line specifies
"noapic" among others (there is also "nosmp", but probably overridden by
"maxcpus=1" -- I am afraid there is no clear precedence among these
options), so the bug is the I/O APIC NMI watchdog is tried at all. This
is also clearly seen from the log where the I/O APIC is not set up at all.
A fix along the lines of what I implemented for "nosmp" in the
"nosmp-watchdog" patch is needed which I will post shortly. It's needed
both for the i386 and the x86-64 target; hopefully the latter does not
differ too much from the former.
Maciej
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
2008-06-05 18:33 ` Maciej W. Rozycki
@ 2008-06-05 18:52 ` Cyrill Gorcunov
2008-06-05 19:47 ` Maciej W. Rozycki
2008-06-05 19:00 ` Cyrill Gorcunov
1 sibling, 1 reply; 11+ messages in thread
From: Cyrill Gorcunov @ 2008-06-05 18:52 UTC (permalink / raw)
To: Maciej W. Rozycki
Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel,
the arch/x86 maintainers
[Maciej W. Rozycki - Thu, Jun 05, 2008 at 07:33:04PM +0100]
| On Thu, 5 Jun 2008, Ingo Molnar wrote:
|
| > NOTE: you need to copy out and use the boot parameters from the boot
| > log:
| >
| > [ 0.000000] Command line: root=/dev/sda6 console=ttyS0,115200
| > earlyprintk=se rial,ttyS0,115200 debug initcall_debug apic=verbose
| > sysrq_always_enabled ignore _loglevel selinux=0 nmi_watchdog=1
| > profile=0 maxcpus=1 nosmp no_hz=off highres =0 noapic nolapic_timer
| > hpet=disable idle=mwait
| >
| > as -tip testing occasionally randomizes boot parameters too. (to find
| > regressions like this) Let me know if you cannot reproduce this.
|
| Thanks. I figured out I cannot build an x86-64 kernel, because my i386
| compiler does not support the target. Probably because of target library
| dependencies at the time I built my compiler. I would have to build a
| bare-iron cross-compiler for the x86-64 which I'd rather not to just to
| fix this small problem -- it usually takes a few days to sort out all the
| pesky details when doing such a build from scratch, so it better be well
| justified.
|
| However, the reason is quite clear to me -- the command line specifies
| "noapic" among others (there is also "nosmp", but probably overridden by
| "maxcpus=1" -- I am afraid there is no clear precedence among these
| options), so the bug is the I/O APIC NMI watchdog is tried at all. This
| is also clearly seen from the log where the I/O APIC is not set up at all.
|
| A fix along the lines of what I implemented for "nosmp" in the
| "nosmp-watchdog" patch is needed which I will post shortly. It's needed
| both for the i386 and the x86-64 target; hopefully the latter does not
| differ too much from the former.
|
| Maciej
|
Since I've got the same hang by using qemu - i think i could test ;)
- Cyrill -
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
2008-06-05 18:33 ` Maciej W. Rozycki
2008-06-05 18:52 ` Cyrill Gorcunov
@ 2008-06-05 19:00 ` Cyrill Gorcunov
1 sibling, 0 replies; 11+ messages in thread
From: Cyrill Gorcunov @ 2008-06-05 19:00 UTC (permalink / raw)
To: Maciej W. Rozycki
Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel,
the arch/x86 maintainers
[Maciej W. Rozycki - Thu, Jun 05, 2008 at 07:33:04PM +0100]
| On Thu, 5 Jun 2008, Ingo Molnar wrote:
|
| > NOTE: you need to copy out and use the boot parameters from the boot
| > log:
| >
| > [ 0.000000] Command line: root=/dev/sda6 console=ttyS0,115200
| > earlyprintk=se rial,ttyS0,115200 debug initcall_debug apic=verbose
| > sysrq_always_enabled ignore _loglevel selinux=0 nmi_watchdog=1
| > profile=0 maxcpus=1 nosmp no_hz=off highres =0 noapic nolapic_timer
| > hpet=disable idle=mwait
| >
| > as -tip testing occasionally randomizes boot parameters too. (to find
| > regressions like this) Let me know if you cannot reproduce this.
|
| Thanks. I figured out I cannot build an x86-64 kernel, because my i386
| compiler does not support the target. Probably because of target library
| dependencies at the time I built my compiler. I would have to build a
| bare-iron cross-compiler for the x86-64 which I'd rather not to just to
| fix this small problem -- it usually takes a few days to sort out all the
| pesky details when doing such a build from scratch, so it better be well
| justified.
|
| However, the reason is quite clear to me -- the command line specifies
| "noapic" among others (there is also "nosmp", but probably overridden by
| "maxcpus=1" -- I am afraid there is no clear precedence among these
| options), so the bug is the I/O APIC NMI watchdog is tried at all. This
| is also clearly seen from the log where the I/O APIC is not set up at all.
|
| A fix along the lines of what I implemented for "nosmp" in the
| "nosmp-watchdog" patch is needed which I will post shortly. It's needed
| both for the i386 and the x86-64 target; hopefully the latter does not
| differ too much from the former.
|
| Maciej
|
Btw, just for the record: my hang was exactly on same line as Ingo reported:
static int __init pci_acpi_init(void) {
...
printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
...
}
well, Ingo had a few additional messages caused by debug_initcall,
but I guess there was a real hang. I mean acpi_irq_penalty_init()
is never reached (I've added a few printk there to be sure).
- Cyrill -
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance
2008-06-05 18:52 ` Cyrill Gorcunov
@ 2008-06-05 19:47 ` Maciej W. Rozycki
0 siblings, 0 replies; 11+ messages in thread
From: Maciej W. Rozycki @ 2008-06-05 19:47 UTC (permalink / raw)
To: Cyrill Gorcunov
Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, linux-kernel,
the arch/x86 maintainers
On Thu, 5 Jun 2008, Cyrill Gorcunov wrote:
> Since I've got the same hang by using qemu - i think i could test ;)
I can reproduce the hang, except with a slightly different options. I
have spotted the places where the watchdog is set up incorrectly. I shall
post fixes shortly, once I have got them polished and tested. Feel free
to throw them at your qemu.
Also it's worth noting there's more breakage of the NMI watchdog for this
configuration ("maxcpus=1 noapic") -- it fails to tick on the CPU #0 on my
system for some reason, but that's well beyond the scope of this series,
so I am not going to look into it.
Maciej
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-06-05 19:48 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-27 20:19 [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance Maciej W. Rozycki
2008-05-31 10:18 ` Ingo Molnar
2008-06-05 9:19 ` Ingo Molnar
2008-06-05 14:55 ` Maciej W. Rozycki
2008-06-05 15:03 ` Ingo Molnar
2008-06-05 18:33 ` Maciej W. Rozycki
2008-06-05 18:52 ` Cyrill Gorcunov
2008-06-05 19:47 ` Maciej W. Rozycki
2008-06-05 19:00 ` Cyrill Gorcunov
-- strict thread matches above, loose matches on Subject: below --
2008-05-21 21:10 Maciej W. Rozycki
2008-05-27 20:18 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox