diff options
author | Yinghai Lu <Yinghai.Lu@Sun.COM> | 2008-02-25 00:36:28 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:40:50 -0400 |
commit | f8fffa458368ed3d57385698f775880db629bd1a (patch) | |
tree | 845bce35fea17284414d973a0fd0ea199d0947a6 /arch/x86/kernel/vsmp_64.c | |
parent | 34048c9e927d5ae29c6ba802c826370de2a046d2 (diff) |
x86: apic_is_clustered_box for vsmp
quad core 8 socket system will have apic id lifting.the apic id range could
be [4, 0x23]. and apic_is_clustered_box will think that need to three clusters
and that is larger than 2. So it is treated as a clustered_box.
and will get:
Marking TSC unstable due to TSCs unsynchronized
even if the CPUs have X86_FEATURE_CONSTANT_TSC set.
this quick fix will check if the cpu is from AMD.
but vsmp still needs that checking...
this patch is fix to make sure that vsmp not to be passed.
Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/vsmp_64.c')
-rw-r--r-- | arch/x86/kernel/vsmp_64.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index 54202b1805da..a00961d42e75 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c | |||
@@ -72,19 +72,34 @@ static unsigned __init vsmp_patch(u8 type, u16 clobbers, void *ibuf, | |||
72 | 72 | ||
73 | } | 73 | } |
74 | 74 | ||
75 | static int vsmp = -1; | ||
76 | |||
77 | int is_vsmp_box(void) | ||
78 | { | ||
79 | if (vsmp != -1) | ||
80 | return vsmp; | ||
81 | |||
82 | vsmp = 0; | ||
83 | if (!early_pci_allowed()) | ||
84 | return vsmp; | ||
85 | |||
86 | /* Check if we are running on a ScaleMP vSMP box */ | ||
87 | if (read_pci_config(0, 0x1f, 0, PCI_VENDOR_ID) == | ||
88 | (PCI_VENDOR_ID_SCALEMP || (PCI_DEVICE_ID_SCALEMP_VSMP_CTL << 16))) | ||
89 | vsmp = 1; | ||
90 | |||
91 | return vsmp; | ||
92 | } | ||
93 | |||
75 | void __init vsmp_init(void) | 94 | void __init vsmp_init(void) |
76 | { | 95 | { |
77 | void *address; | 96 | void *address; |
78 | unsigned int cap, ctl, cfg; | 97 | unsigned int cap, ctl, cfg; |
79 | 98 | ||
80 | if (!early_pci_allowed()) | 99 | if (!is_vsmp_box()) |
81 | return; | 100 | return; |
82 | 101 | ||
83 | /* Check if we are running on a ScaleMP vSMP box */ | 102 | if (!early_pci_allowed()) |
84 | if ((read_pci_config_16(0, 0x1f, 0, PCI_VENDOR_ID) != | ||
85 | PCI_VENDOR_ID_SCALEMP) || | ||
86 | (read_pci_config_16(0, 0x1f, 0, PCI_DEVICE_ID) != | ||
87 | PCI_DEVICE_ID_SCALEMP_VSMP_CTL)) | ||
88 | return; | 103 | return; |
89 | 104 | ||
90 | /* If we are, use the distinguished irq functions */ | 105 | /* If we are, use the distinguished irq functions */ |