diff options
Diffstat (limited to 'arch/x86_64/kernel/apic.c')
-rw-r--r-- | arch/x86_64/kernel/apic.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c index 29ef99001e05..b2ead91df218 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86_64/kernel/apic.c | |||
@@ -100,7 +100,7 @@ void clear_local_APIC(void) | |||
100 | maxlvt = get_maxlvt(); | 100 | maxlvt = get_maxlvt(); |
101 | 101 | ||
102 | /* | 102 | /* |
103 | * Masking an LVT entry on a P6 can trigger a local APIC error | 103 | * Masking an LVT entry can trigger a local APIC error |
104 | * if the vector is zero. Mask LVTERR first to prevent this. | 104 | * if the vector is zero. Mask LVTERR first to prevent this. |
105 | */ | 105 | */ |
106 | if (maxlvt >= 3) { | 106 | if (maxlvt >= 3) { |
@@ -851,7 +851,18 @@ void disable_APIC_timer(void) | |||
851 | unsigned long v; | 851 | unsigned long v; |
852 | 852 | ||
853 | v = apic_read(APIC_LVTT); | 853 | v = apic_read(APIC_LVTT); |
854 | apic_write(APIC_LVTT, v | APIC_LVT_MASKED); | 854 | /* |
855 | * When an illegal vector value (0-15) is written to an LVT | ||
856 | * entry and delivery mode is Fixed, the APIC may signal an | ||
857 | * illegal vector error, with out regard to whether the mask | ||
858 | * bit is set or whether an interrupt is actually seen on input. | ||
859 | * | ||
860 | * Boot sequence might call this function when the LVTT has | ||
861 | * '0' vector value. So make sure vector field is set to | ||
862 | * valid value. | ||
863 | */ | ||
864 | v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR); | ||
865 | apic_write(APIC_LVTT, v); | ||
855 | } | 866 | } |
856 | } | 867 | } |
857 | 868 | ||
@@ -909,15 +920,13 @@ int setup_profiling_timer(unsigned int multiplier) | |||
909 | return -EINVAL; | 920 | return -EINVAL; |
910 | } | 921 | } |
911 | 922 | ||
912 | #ifdef CONFIG_X86_MCE_AMD | 923 | void setup_APIC_extened_lvt(unsigned char lvt_off, unsigned char vector, |
913 | void setup_threshold_lvt(unsigned long lvt_off) | 924 | unsigned char msg_type, unsigned char mask) |
914 | { | 925 | { |
915 | unsigned int v = 0; | 926 | unsigned long reg = (lvt_off << 4) + K8_APIC_EXT_LVT_BASE; |
916 | unsigned long reg = (lvt_off << 4) + 0x500; | 927 | unsigned int v = (mask << 16) | (msg_type << 8) | vector; |
917 | v |= THRESHOLD_APIC_VECTOR; | ||
918 | apic_write(reg, v); | 928 | apic_write(reg, v); |
919 | } | 929 | } |
920 | #endif /* CONFIG_X86_MCE_AMD */ | ||
921 | 930 | ||
922 | #undef APIC_DIVISOR | 931 | #undef APIC_DIVISOR |
923 | 932 | ||
@@ -983,7 +992,7 @@ void smp_apic_timer_interrupt(struct pt_regs *regs) | |||
983 | } | 992 | } |
984 | 993 | ||
985 | /* | 994 | /* |
986 | * oem_force_hpet_timer -- force HPET mode for some boxes. | 995 | * apic_is_clustered_box() -- Check if we can expect good TSC |
987 | * | 996 | * |
988 | * Thus far, the major user of this is IBM's Summit2 series: | 997 | * Thus far, the major user of this is IBM's Summit2 series: |
989 | * | 998 | * |
@@ -991,7 +1000,7 @@ void smp_apic_timer_interrupt(struct pt_regs *regs) | |||
991 | * multi-chassis. Use available data to take a good guess. | 1000 | * multi-chassis. Use available data to take a good guess. |
992 | * If in doubt, go HPET. | 1001 | * If in doubt, go HPET. |
993 | */ | 1002 | */ |
994 | __cpuinit int oem_force_hpet_timer(void) | 1003 | __cpuinit int apic_is_clustered_box(void) |
995 | { | 1004 | { |
996 | int i, clusters, zeros; | 1005 | int i, clusters, zeros; |
997 | unsigned id; | 1006 | unsigned id; |
@@ -1022,8 +1031,7 @@ __cpuinit int oem_force_hpet_timer(void) | |||
1022 | } | 1031 | } |
1023 | 1032 | ||
1024 | /* | 1033 | /* |
1025 | * If clusters > 2, then should be multi-chassis. Return 1 for HPET. | 1034 | * If clusters > 2, then should be multi-chassis. |
1026 | * Else return 0 to use TSC. | ||
1027 | * May have to revisit this when multi-core + hyperthreaded CPUs come | 1035 | * May have to revisit this when multi-core + hyperthreaded CPUs come |
1028 | * out, but AFAIK this will work even for them. | 1036 | * out, but AFAIK this will work even for them. |
1029 | */ | 1037 | */ |