public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH][2.5] Honour dont_enable_local_apic flag
@ 2003-06-01 11:23 mikpe
  2003-06-01 16:26 ` Brian J. Murrell
  2003-06-01 17:25 ` Brian J. Murrell
  0 siblings, 2 replies; 12+ messages in thread
From: mikpe @ 2003-06-01 11:23 UTC (permalink / raw)
  To: zwane; +Cc: alan, brian, linux-kernel

On Sat, 31 May 2003 23:30:10 -0400 (EDT), Zwane Mwaikambo wrote:
>--- linux-2.5/arch/i386/kernel/apic.c	30 May 2003 20:14:41 -0000	1.50
>+++ linux-2.5/arch/i386/kernel/apic.c	31 May 2003 05:53:34 -0000
>@@ -665,6 +665,7 @@ static int __init detect_init_APIC (void
> 	return 0;
> 
> no_apic:
>+	dont_enable_local_apic = 1;
> 	printk("No local APIC present or hardware disabled\n");
> 	return -1;
> }
>@@ -1127,6 +1128,9 @@ asmlinkage void smp_error_interrupt(void
>  */
> int __init APIC_init_uniprocessor (void)
> {
>+	if (dont_enable_local_apic)
>+		return -1;
>+
> 	if (!smp_found_config && !cpu_has_apic)
> 		return -1;

I didn't follow this thread closely, but:

1. dont_enable_local_apic was originally only intended for those
   systems (i.e., Dell laptops) where enabling the local APIC in
   HW (via APIC_BASE MSR) causes problems due to broken BIOSen.
   It was never intended as a "Kernel, please don't use the local
   APIC even though I configured it" option. It doesn't help you
   if your machine boots with the local APIC enabled, but the
   local APIC doesn't work for some reason.

2. The only way to reach no_apic is if we boot on a vendor/model
   combination that isn't known to have a local APIC that can be
   enabled in software. And the second patch hunk only makes a
   difference if the CPU boots with an enabled local APIC.

   So what vendor/model CPU is used in the failure case?

   (And if its local APIC is broken, cpu_has_apic should be cleared
   rather than setting the dont_enable flag. Post-boot code may
   access the local APIC if CONFIG_X86_LOCAL_APIC && cpu_has_apic.)

3. What is the exact failure? Hang or crash? Where? UP or SMP kernel?
   (If SMP kernel, does booting with "nosmp" help?)

/Mikael

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH][2.5] Honour dont_enable_local_apic flag
@ 2003-06-01 23:09 mikpe
  0 siblings, 0 replies; 12+ messages in thread
From: mikpe @ 2003-06-01 23:09 UTC (permalink / raw)
  To: brian; +Cc: alan, linux-kernel, zwane

On 01 Jun 2003 13:25:33 -0400, Brian J. Murrell wrote:
>So would you prefer something more along the lines of:
>
>--- arch/i386/kernel/setup.c.orig       2003-04-26 10:34:35.000000000 -0400
>+++ arch/i386/kernel/setup.c    2003-06-01 13:11:47.000000000 -0400
>@@ -845,6 +845,10 @@
>                 */
>                else if (!memcmp(from, "highmem=3D", 8))
>                        highmem_pages =3D memparse(from+8, &from) >> PAGE_S=
>HIFT;
>+               else if (!memcmp(from, "nolapic", 7)) {
>+                               clear_bit(X86_FEATURE_APIC, &boot_cpu_data.=
>x86_capability);
>+                               set_bit(X86_FEATURE_APIC, &disabled_x86_cap=
>s);
>+               }

Yes, but I meant using a __setup() or doing it in the no_apic case
in detect_init_APIC().

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH][2.5] Honour dont_enable_local_apic flag
@ 2003-06-01 23:08 mikpe
  2003-06-01 23:52 ` Brian J. Murrell
  0 siblings, 1 reply; 12+ messages in thread
From: mikpe @ 2003-06-01 23:08 UTC (permalink / raw)
  To: brian; +Cc: alan, linux-kernel, zwane

On 01 Jun 2003 12:26:56 -0400, Brian J. Murrell wrote:
>>    So what vendor/model CPU is used in the failure case?
>
>VMware 2.0.4.

Details, please. What does `cat /proc/cpuinfo` say?

My intention here is that we should be able to detect
this apparently broken "CPU" by its vendor/model and
clear cpu_has_apic for it.

Alternatively the no_apic label in detect_init_APIC()
could clear cpu_has_apic.

>> 3. What is the exact failure? Hang or crash?
>
>Normal boot until here:
>
>Using local APIC timer interrupts.
>calibrating APIC timer ...
>..... CPU clock speed is 1658.7651 MHz.
>..... host bus clock speed is 0.0000 MHz.
>cpu: 0, clocks: 0, slice: 0

Hmm, obviously a 2.4 kernel.
Looks like a hang in setup_APIC_timer(). My guess is that
the do loops in that procedure don't work if clocks==0
or the local APIC timer registers are frozen.

/Mikael

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH][2.5] Honour dont_enable_local_apic flag
@ 2003-06-01  3:30 Zwane Mwaikambo
  0 siblings, 0 replies; 12+ messages in thread
From: Zwane Mwaikambo @ 2003-06-01  3:30 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Alan Cox, Mikael Pettersson, brian

This flag doesn't get honoured in all cases, we still try and frob the 
APIC in APIC_init_uniprocessor, Tested by Brian.

Alan can i also send you a patch to disable the local apic from the kernel 
command line? It would be dependent on this patch.

	Zwane

Index: linux-2.5/arch/i386/kernel/apic.c
===================================================================
RCS file: /home/cvs/linux-2.5/arch/i386/kernel/apic.c,v
retrieving revision 1.50
diff -u -p -B -r1.50 apic.c
--- linux-2.5/arch/i386/kernel/apic.c	30 May 2003 20:14:41 -0000	1.50
+++ linux-2.5/arch/i386/kernel/apic.c	31 May 2003 05:53:34 -0000
@@ -665,6 +665,7 @@ static int __init detect_init_APIC (void
 	return 0;
 
 no_apic:
+	dont_enable_local_apic = 1;
 	printk("No local APIC present or hardware disabled\n");
 	return -1;
 }
@@ -1127,6 +1128,9 @@ asmlinkage void smp_error_interrupt(void
  */
 int __init APIC_init_uniprocessor (void)
 {
+	if (dont_enable_local_apic)
+		return -1;
+
 	if (!smp_found_config && !cpu_has_apic)
 		return -1;
 

-- 
function.linuxpower.ca

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-06-02 17:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-01 11:23 [PATCH][2.5] Honour dont_enable_local_apic flag mikpe
2003-06-01 16:26 ` Brian J. Murrell
2003-06-01 17:25 ` Brian J. Murrell
  -- strict thread matches above, loose matches on Subject: below --
2003-06-01 23:09 mikpe
2003-06-01 23:08 mikpe
2003-06-01 23:52 ` Brian J. Murrell
2003-06-02  4:50   ` Zwane Mwaikambo
2003-06-02 13:46     ` Brian J. Murrell
2003-06-02 14:56     ` mikpe
2003-06-02 16:20       ` Zwane Mwaikambo
2003-06-02 17:30         ` Brian J. Murrell
2003-06-01  3:30 Zwane Mwaikambo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox