Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88662
b: refs/heads/master
c: f8fffa4
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Apr 17, 2008
1 parent 026f9e1 commit abc3555
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 34048c9e927d5ae29c6ba802c826370de2a046d2
refs/heads/master: f8fffa458368ed3d57385698f775880db629bd1a
4 changes: 2 additions & 2 deletions trunk/arch/x86/kernel/apic_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,9 +1182,9 @@ __cpuinit int apic_is_clustered_box(void)
* there is not this kind of box with AMD CPU yet.
* Some AMD box with quadcore cpu and 8 sockets apicid
* will be [4, 0x23] or [8, 0x27] could be thought to
* have three apic_clusters. So go out early.
* vsmp box still need checking...
*/
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
if (!is_vsmp_box() && (boot_cpu_data.x86_vendor == X86_VENDOR_AMD))
return 0;

bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
Expand Down
27 changes: 21 additions & 6 deletions trunk/arch/x86/kernel/vsmp_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,34 @@ static unsigned __init vsmp_patch(u8 type, u16 clobbers, void *ibuf,

}

static int vsmp = -1;

int is_vsmp_box(void)
{
if (vsmp != -1)
return vsmp;

vsmp = 0;
if (!early_pci_allowed())
return vsmp;

/* Check if we are running on a ScaleMP vSMP box */
if (read_pci_config(0, 0x1f, 0, PCI_VENDOR_ID) ==
(PCI_VENDOR_ID_SCALEMP || (PCI_DEVICE_ID_SCALEMP_VSMP_CTL << 16)))
vsmp = 1;

return vsmp;
}

void __init vsmp_init(void)
{
void *address;
unsigned int cap, ctl, cfg;

if (!early_pci_allowed())
if (!is_vsmp_box())
return;

/* Check if we are running on a ScaleMP vSMP box */
if ((read_pci_config_16(0, 0x1f, 0, PCI_VENDOR_ID) !=
PCI_VENDOR_ID_SCALEMP) ||
(read_pci_config_16(0, 0x1f, 0, PCI_DEVICE_ID) !=
PCI_DEVICE_ID_SCALEMP_VSMP_CTL))
if (!early_pci_allowed())
return;

/* If we are, use the distinguished irq functions */
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/asm-x86/apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@ extern unsigned boot_cpu_id;
*/
#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
extern int is_vsmp_box(void);
#else
#define apic_write native_apic_write
#define apic_write_atomic native_apic_write_atomic
#define apic_read native_apic_read
#define setup_boot_clock setup_boot_APIC_clock
#define setup_secondary_clock setup_secondary_APIC_clock
static int inline is_vsmp_box(void)
{
return 0;
}
#endif

static inline void native_apic_write(unsigned long reg, u32 v)
Expand Down

0 comments on commit abc3555

Please sign in to comment.