lkml.org 
[lkml]   [2008]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 8/8] x86: apic - unify init_bsp_APIC
Remove redundant apic_read(APIC_LVR) and add check for
reserved bit on P4/Xeon in 64bit mode. For now it's
not really needed and made in a sake of unification.
#ifdef would be added probably.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

Index: linux-2.6.git/arch/x86/kernel/apic_32.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic_32.c 2008-08-14 22:23:04.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic_32.c 2008-08-14 22:24:49.000000000 +0400
@@ -927,7 +927,7 @@ void __init sync_Arb_IDs(void)
*/
void __init init_bsp_APIC(void)
{
- unsigned long value;
+ unsigned int value;

/*
* Don't do the setup now if we have a SMP BIOS as the
@@ -962,7 +962,8 @@ void __init init_bsp_APIC(void)
*/
apic_write(APIC_LVT0, APIC_DM_EXTINT);
value = APIC_DM_NMI;
- if (!lapic_is_integrated()) /* 82489DX */
+ /* discrete on 82489DX */
+ if (!lapic_is_integrated())
value |= APIC_LVT_LEVEL_TRIGGER;
apic_write(APIC_LVT1, value);
}
Index: linux-2.6.git/arch/x86/kernel/apic_64.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic_64.c 2008-08-14 22:23:04.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic_64.c 2008-08-14 22:24:49.000000000 +0400
@@ -776,8 +776,6 @@ void __init init_bsp_APIC(void)
if (smp_found_config || !cpu_has_apic)
return;

- value = apic_read(APIC_LVR);
-
/*
* Do not trust the local APIC being empty at bootup.
*/
@@ -789,7 +787,12 @@ void __init init_bsp_APIC(void)
value = apic_read(APIC_SPIV);
value &= ~APIC_VECTOR_MASK;
value |= APIC_SPIV_APIC_ENABLED;
- value |= APIC_SPIV_FOCUS_DISABLED;
+ /* This bit is reserved on P4/Xeon and should be cleared */
+ if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) &&
+ (boot_cpu_data.x86 == 15))
+ value &= ~APIC_SPIV_FOCUS_DISABLED;
+ else
+ value |= APIC_SPIV_FOCUS_DISABLED;
value |= SPURIOUS_APIC_VECTOR;
apic_write(APIC_SPIV, value);

@@ -798,6 +801,9 @@ void __init init_bsp_APIC(void)
*/
apic_write(APIC_LVT0, APIC_DM_EXTINT);
value = APIC_DM_NMI;
+ /* discrete on 82489DX */
+ if (!lapic_is_integrated())
+ value |= APIC_LVT_LEVEL_TRIGGER;
apic_write(APIC_LVT1, value);
}

--


\
 
 \ /
  Last update: 2008-08-14 20:51    [W:0.412 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site